简体   繁体   English

是通过Oracle 10g中的数据库链接传输压缩的吗?可能吗?

[英]Is transfer via database link in Oracle 10g compressed ? Is it possible?

I'm transferring data from one base to another via database links (using INSERT INTO SELECT ... ). 我正在通过数据库链接将数据从一个基站传输到另一个基站(使用INSERT INTO SELECT ... )。

I want to know if data transferred through the link is compressed or can be compressed to avoid too much network use. 我想知道通过链接传输的数据是否已压缩或可以压缩以避免过多的网络使用。 I have very little bandwidth, and I think that would help if it's not already done. 我的带宽非常小,我认为如果还没有完成,那会有所帮助。

There's some de-duplication but no serious compression. 有一些重复数据删除但没有严重的压缩。

There is a UTL_COMPRESS function but it would be tricky to get that to decompress on the destination (maybe a trigger, or instead of view - but it is clunky). 有一个UTL_COMPRESS函数,但要在目标上解压缩(可能是触发器,或者代替视图 - 但它很笨重)会很棘手。

EXPDP can use a database link ( NETWORK_LINK ) and, in 11g, compression but that does require the Advanced Compression option to be licensed . EXPDP可以使用数据库链接( NETWORK_LINK ),并在11g中进行压缩,但这需要许可高级压缩选项

Lastly there's conventional extract, zip, transfer, unzip, load 最后是传统的提取,拉链,转移,解压缩,加载

In 11gR2 you can use external tables with a preprocessor to unzip , so you could semi-automate that final option. 在11gR2中,您可以使用带有预处理器的外部表进行解压缩 ,因此您可以半自动化该最终选项。

As @Gary says, not natively, but it's possible to get compression using an SSH tunnel, assuming you have command-line access anyway. 正如@Gary所说,不是本地的,但是可以使用SSH隧道进行压缩,假设您无论如何都有命令行访问权限。 The SSH man page notes that compression can slow things down on a fast network, but that trade-off may be worth it if you're severely bandwidth-constrained; SSH手册页指出,压缩可以减慢快速网络上的速度,但如果你受到严格的带宽限制,这种权衡可能是值得的。 and you may need to experiment with CompressionLevel in ssh_config to get the best results for your situation. 并且您可能需要在ssh_config试验CompressionLevel以获得最适合您情况的结果。

For example, if your existing link is defined to connect to remote_server port 1521 : 例如,如果您的现有链接已定义为连接到remote_server端口1521

create database link direct connect to usr identified by pwd
using 'DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=remote_server)(PORT=1521))
(CONNECT_DATA=(SERVICE_NAME=remote_service)))'

You can create an SSH tunnel using a free local port, with something like: 您可以使用免费的本地端口创建SSH隧道,例如:

ssh -C -N -L1522:localhost:1521 remote_server

And then you can have a DB link that points to the local side of the tunnel: 然后你可以有一个指向隧道本地端的数据库链接:

create database link direct connect to usr identified by pwd
using 'DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1522))
(CONNECT_DATA=(SERVICE_NAME=remote_service)))'

So you just change the host and port. 所以你只需更改主机和端口。 If your existing link is using a tnsnames entry then you can just modify that instead, to point to localhost:1522 instead of remote_server:1521 . 如果您现有的链接使用的是tnsnames条目,那么您只需修改它,指向localhost:1522而不是remote_server:1521

Of course you have to make sure the SSH link is up whenever you use the DB link. 当然,只要您使用数据库链接,就必须确保SSH链接已启动。 If it's down you'll get an ORA-12541: TNS:no listener error, since nothing will be listening on your local port 1522. 如果它失败你会得到一个ORA-12541: TNS:no listener错误,因为没有任何东西会在你的本地端口1522上监听。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM