开发者

How to use Data Pump utilities without a tnsnames.ora file

开发者 https://www.devze.com 2022-12-29 00:51 出处:网络
I want to be able to run expdp and impdp by directly specifying the c开发者_Go百科onnection parameters instead of a TNS name that resides in tnsnames.ora. Is this possible?You may be able to specify i

I want to be able to run expdp and impdp by directly specifying the c开发者_Go百科onnection parameters instead of a TNS name that resides in tnsnames.ora. Is this possible?


You may be able to specify it all on the command line with a Connection String instead of a TNSName. Remove the whitespace from your TNS entry you would have used to connect, here is an example that works with SQLPLUS...

Here is how to connect to a local OracleXE install on Windows:

sqlplus scott/tiger@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=xe)))

On *Nix you may need to quote the entry so the parens aren't interpreted incorrectly:

sqlplus 'scott/tiger@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=xe)))'


You might try an EZCONNECT string:

expdp userid=user/pw@//host:port/service-name

You will need a sqlnet.ora parameter on the client side that includes EZCONNECT, e.g.:

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
0

精彩评论

暂无评论...
验证码 换一张
取 消