Oracle Data Pump Export through Windows batch File
Follow up by mail Click here


Subject: Oracle Data Pump Export through Windows batch File
Author: Rakesh Sarkar, India
Date: Jan 03, 2019, 09:53, 12 days ago
Os info: Windows 2012 R2
Oracle info: Oracle 11.2.0.4
Message: Hi

We are trying to use expdp to take oracle database backup , which is running fine as per the following syntax in a command prompt.

E:\Oracle11g\product\11.2.0\dbhome_1\BIN\expdp.exe system/xxxxx@ohepm schemas='PRODHFM' dumpfile=expACCOUNTS%date:~6,4%%date:~3,2%%date:~0,2%.dmp logfile=expACCOUNTS%date:~6,4%%date:~3,2%%date:~0,2%.log directory=HFMDATA INCLUDE=TABLE:\"LIKE \'%ACCOUNTS%\'\"


But if I put the same syntax in the batch file and try to execute that it is throwing an error.

Connected to: Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_01": system/********@ohepm schemas='PRODHFM' dumpfile=expACCOUNTS'20190102.dmp' logfile=expACCOUNTS20190102.log directory=HFMDATA INCLUDE=TABLE:"LIKE \'\'"
Estimate in progress using BLOCKS method...
Total estimation using BLOCKS method: 0 KB
ORA-39165: Schema PRODHFM was not found.
ORA-39168: Object path TABLE was not found.
ORA-31655: no data or metadata objects selected for job
Job "SYSTEM"."SYS_EXPORT_SCHEMA_01" completed with 3 error(s) at Wed Jan 2 17:51:16 2019 elapsed 0 00:00:04

Please help.

Regards
Rakesh
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: Oracle Data Pump Export through Windows batch File
Author: Jan Schnackenberg, Germany
Date: Jan 03, 2019, 11:28, 12 days ago
Message: First the necessary disclaimer:
An export is not a backup!

You need to understand this. Even if you are forced to do an export instead of an actual backup, you need to know this and keep telling it to everyone who doesn't want to listen. Especially to the ones who do not want to listen.


Now, your frist Error (ORA-39165) tells you, that the schema you want to export does not exist. Everything after taht is irrelevant.

1. Check you are actually connecting to the expected database
2. Check that, when connecting to the database, you can see a Schema named "PRODHFM"

Regards,
Jan
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: Oracle Data Pump Export through Windows batch File
Author: Rakesh Sarkar, India
Date: Jan 03, 2019, 11:38, 12 days ago
Message: Hi
Schema is already present. I have checked.

Regards
Rakesh
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: Oracle Data Pump Export through Windows batch File
Author: Bruno Vroman, Belgium
Date: Jan 03, 2019, 15:35, 12 days ago
Message: Hello Rakesh,

how is @ohepm resolved in your command line? And how is it resolved in the .bat file (maybe you use another ORACLE_HOME, or in one case you have a TNS_ADMIN variable...)? I suspect that you have two different targets...

As Jan wrote, the message <<ORA-39165: Schema PRODHFM was not found>> is clear. I slightly amend it: the schema is not found in the database to which the job connects...

And I repeat that expdp is NOT a backup; in addition: if there are several tables %ACCOUNTS% you should probably take a "consistent export", see the datapump expdp parameter FLASHBACK_TIME and or FLASHBACK_SCN -and the account used to process the export needs the "FLASHBACK ANY TABLE" privilege (more information in the Oracle documentation)

Best regards,

Bruno Vroman.
P.S.: https://www.dba-village.com/village/dvp_forum.OpenThread?ThreadIdA=92186
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: Oracle Data Pump Export through Windows batch File
Author: Rakesh Sarkar, India
Date: Jan 03, 2019, 15:37, 12 days ago
Message: Hi
Thanks for your feedback.

Regards
Rakesh
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here

Subject: Re: Oracle Data Pump Export through Windows batch File
Author: Bruno Vroman, Belgium
Date: Jan 06, 2019, 12:07, 9 days ago
Score:   Score: 200 PtsScore: 200 PtsScore: 200 PtsScore: 200 PtsScore: 200 Pts
Message: Hello Rakesh,

<<Hi
Thanks for your feedback.

Regards
Rakesh
>>
?
It is your feedback that is expected... If you don't want to help us to help you you won't get far...
Could you answer to my questions? Or maybe explain what was the problem and how you solved it if everything is OK now.

Regards,
Bruni
Your rating?: This reply is Good Excellent
Goto: Reply - Top of page 
If you think this item violates copyrights, please click here