@echo off
set ORACLE_HOME=C:\OracleClient\oracle64\19.3.0\client
set DB_PASSWORD=Btf_lLS9TKck2my1c2dnKlaQV
set DB_NAME=psbiods_svc.prd.tns
set PDB_NAME=PSBIODS
set RUN_ID=1

set YYYYMMDD=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%
set ORA_SCN=41443046653971

echo.
echo ==================================================
echo [BEGIN]: Exporting the %PDB_NAME% database.
echo ==================================================
echo.
%ORACLE_HOME%\bin\expdp PDBADMIN/%DB_PASSWORD%@%DB_NAME% directory=%PDB_NAME%_DUMP_DIR DUMPFILE=EXPDP_%PDB_NAME%_%YYYYMMDD%_META.DMP logfile=EXPDP_%PDB_NAME%_%YYYYMMDD%_META_%RUN_ID%.log FULL=YES CONTENT=METADATA_ONLY FLASHBACK_SCN=%ORA_SCN% LOGTIME=ALL REUSE_DUMPFILES=YES

             set PAR_CHUNK=%PDB_NAME%&  set EXP_CHUNK=01_all&         start run_expdp_ODS.bat 
timeout  450 & set PAR_CHUNK=SBIODS&      set EXP_CHUNK=02_OU_RIAD&     start run_expdp_ODS.bat 
timeout  300 & set PAR_CHUNK=SBIODS&      set EXP_CHUNK=03_OU_SHS&      start run_expdp_ODS.bat 
timeout  300 & set PAR_CHUNK=SBIODS&      set EXP_CHUNK=04_OU_TMS&      start run_expdp_ODS.bat 
timeout  900 & set PAR_CHUNK=SBIODS&      set EXP_CHUNK=05_CSDB_TAB_1&  start run_expdp_ODS.bat 
rem timeout  300 & set PAR_CHUNK=SBIODS&      set EXP_CHUNK=06_CSDB_TAB_2&  start run_expdp_ODS.bat 
rem timeout  300 & set PAR_CHUNK=SBIODS&      set EXP_CHUNK=07_CSDB_TAB_3&  start run_expdp_ODS.bat 
rem timeout  300 & set PAR_CHUNK=SBIODS&      set EXP_CHUNK=08_CSDB_TAB_4&  start run_expdp_ODS.bat 
timeout  300 & set PAR_CHUNK=SBIODS&      set EXP_CHUNK=09_OU_CSDB_all& start run_expdp_ODS.bat     
pause

