Oracle SQL Plus expdp in bat file

1

I try to export all my bases with a .bat file, but when the .bat file open and connect in sqlplus, the program don't read the last of file.

I need export and log all export with Spool.

The .bat is something like this:

sqlplus / as sysdba
spool c:\logs\oracle\backup.log
expdp SYSTEM/usuario schemas=schemaname1 file=filename1.dmp log=logname1.log
expdp SYSTEM/usuario schemas=schemaname2 file=filename2.dmp log=logname2.log
...
expdp SYSTEM/usuario schemas=schemaname16 file=filename16.dmp log=logname16.log
spool off

but the program stop after sqlplus / as sysdba without any errors =(

Yuri Fraay

Posted 2015-01-14T20:34:26.520

Reputation: 26

@fixer1234 ok, I'll hold off on that then. Thank you – Nordlys Jeger – 2018-09-24T08:06:02.433

Answers

0

Not sure why you're connecting to SQL*Plus. expdp is an OS utility and is meant to be run from outside SQL*Plus. Skip the first 2 lines.

expdp SYSTEM/usuario schemas=schemaname1 file=filename1.dmp log=logname1.log
expdp SYSTEM/usuario schemas=schemaname2 file=filename2.dmp log=logname2.log
...
expdp SYSTEM/usuario schemas=schemaname16 file=filename16.dmp log=logname16.log

Sathyajith Bhat

Posted 2015-01-14T20:34:26.520

Reputation: 58 436

I want to create a task in windows server to execute the .bat file and I run the script in windows "cmd" – Yuri Fraay – 2015-01-20T21:42:11.530