@echo off
set ORACLE_HOME=F:\Oracle_client_21c\client
set DB_PASSWORD="_S-uFRsT3-S#mH0teX4R"
set DB_NAME=todsadb
set RUN_ID=1
set YYYYMMDD=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%
REM set ORA_SCN=982347558041

echo.
echo ==================================================
echo [BEGIN]: Exporting the %DB_NAME% database.
echo ==================================================
echo.
%ORACLE_HOME%\bin\expdp ADMIN/%DB_PASSWORD%@%DB_NAME% directory=DATA_PUMP_DIR DUMPFILE=EXPDP_%DB_NAME%_%YYYYMMDD%_META.DMP%L.dmp logfile=EXPDP_%DB_NAME%_%YYYYMMDD%_%RUN_ID%.log FULL=YES CONTENT=METADATA_ONLY LOGTIME=ALL REUSE_DUMPFILES=YES

               set PAR_CHUNK=%DB_NAME%&  set EXP_CHUNK=01_all&         start run_expdp_ODS.bat 
timeout  4500 & set PAR_CHUNK=SBIODS&     set EXP_CHUNK=02_OU_RIAD&     start run_expdp_ODS.bat 
timeout  3000 & set PAR_CHUNK=SBIODS&     set EXP_CHUNK=03_OU_SHS&      start run_expdp_ODS.bat 
timeout  3000 & set PAR_CHUNK=SBIODS&     set EXP_CHUNK=04_OU_TMS&      start run_expdp_ODS.bat 
timeout  9000 & set PAR_CHUNK=SBIODS&     set EXP_CHUNK=05_CSDB_TAB_1&  start run_expdp_ODS.bat 
timeout  3000 & set PAR_CHUNK=SBIODS&      set EXP_CHUNK=06_CSDB_TAB_2&  start run_expdp_ODS.bat 
timeout  3000 & set PAR_CHUNK=SBIODS&      set EXP_CHUNK=07_CSDB_TAB_3&  start run_expdp_ODS.bat 
timeout  3000 & set PAR_CHUNK=SBIODS&      set EXP_CHUNK=08_CSDB_TAB_4&  start run_expdp_ODS.bat 
timeout  3000 & set PAR_CHUNK=SBIODS&     set EXP_CHUNK=09_OU_CSDB_all& start run_expdp_ODS.bat  
pause