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

夙愿已清 提交于 2019-12-01 07:38:16

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).

EXPDP can use a database link (NETWORK_LINK) and, in 11g, compression but that does require the Advanced Compression option to be licensed.

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.

As @Gary says, not natively, but it's possible to get compression using an SSH tunnel, assuming you have command-line access anyway. 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; and you may need to experiment with CompressionLevel in ssh_config to get the best results for your situation.

For example, if your existing link is defined to connect to remote_server port 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 -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.

Of course you have to make sure the SSH link is up whenever you use the DB link. If it's down you'll get an ORA-12541: TNS:no listener error, since nothing will be listening on your local port 1522.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!