Oracle exp export with full tns-string

Handling the oracle tns-names file can be a pain in the ass, especially if you don’t want to rely on it. For example you want a user to enter dynamically a connection with typical “host, port, sid, username, password” configuration. In oracle you can also use the full tns-string to connect to a database. I struggled some time finding the correct escape and quotation configuration, but finally this worked:

Linux
(if the line is too long to fit in the browser window mark it completely (double-click) and copy&paste it in your favourite editor)

exp userid=\'sys/yourpw@\(DESCRIPTION\=\(ADDRESS_LIST\=\(ADDRESS\=\(PROTOCOL\=TCP\)\(Host\=192.168.123.123\)\(Port\=1521\)\)\)\(CONNECT_DATA\=\(SID\=xe\)\)\) as sysdba\' file=/tmp/testexp.dmp full=y

Oracle-Documentation
http://docs.oracle.com/cd/B19306_01/server.102/b14215/exp_imp.htm

pixelstats trackingpixel

Leave a comment

Your comment

Time limit is exhausted. Please reload the CAPTCHA.