Tuesday, October 2, 2018

Datapump backup in Windows and backup files deleted older than N days


set mydate=%date:/=%
set mytime=%time::=%
set dt=%mydate: =_%_%mytime:.=_%
D:\app11g\product\11.2.0\dbhome_1\BIN\expdp dbbkp/*** directory=dir1 dumpfile=utilitydb_%dt%.dmp schemas=webserv,bautility logfile=utilitydb_%dt%.log

 forfiles /P D:\database_backup\ /S /M *.dmp  /D -7 /C "cmd /c del @PATH"
forfiles /P D:\database_backup\ /S /M *.log  /D -7 /C "cmd /c del @PATH"


batch File Name: utilitydb.bat

No comments:

Post a Comment