amitabh pandey
amitabh pandey

Reputation: 75

Expdp command from java

I have to take oracle table export and import dump file from java using expdp command.

Form cmd it is working as expected. But when the I'm doing the same from java there are two issues:

  1. if expdp command have include keyword then it shows the syntax error.
  2. If expdp command don't have include keyword it works but did not return the status, program continue to run even the dump has been exported and finish.

I am using java Runtime.getRuntime().exec. It waits on waitFor method for return.

Please anyone have done this or have any idea please help.

Upvotes: 0

Views: 854

Answers (1)

user10868856
user10868856

Reputation: 1

Try the following:

Runtime.getRuntime().exec("cmd /C C:\\oraclexe\\app\\oracle\\product\\11.2.0\\server\\bin\\expdp.exe SYSTEM/oracle@xe DIRECTORY=backupxe DUMPFILE=dbname.dmp SCHEMAS=dbname OWNER=SYSTEM");

Upvotes: -1

Related Questions