oracle : use dblink by command line

must be added tnsnames

[DB Links] object not enough ~

 

 

vi /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora

 

REMOTETNS1 = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.10)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = XE)))

 

# su - oracle -c "expdp dbuser/xxxxxx@REMOTETNS1 dumpfile=file.dmp logfile= file.log directory=BACKUP_DIR reuse_dumpfiles=y"