How to execute datapump commands as sysdba from remote machine

data-pumporacle

I would like to know the syntax to call datapump commands (expdp/impdp) logged as 'sys as sysdba' from a remote machine.

I know that when logged on the machine which runs the database, I can use :

expdp \"/ as sysdba\"

However, I cannot find how to do this from a remote machine, for example, these does not work :

expdp 'SYS@SID AS SYSDBA'
expdp "SYS AS SYSDBA"@SID

In both case, the error message is :

LRM-00108: invalid positional parameter value [...]

Best Answer

expdp \"SYS@service AS SYSDBA\"

This works for me (10.2 and 11.1), but you need either to define service in your tnsnames.ora or to use proper SCAN. Generally, ORACLE_SID is a different identifier than TNS service, but for simplicity they often are administratively set to the same value.