Oracle自动备份批处理
set rq=%date:~0,10% rem exp dlsjzs/dlsjzs@orcl file=d:\dbbak\dlsjzs%date:~0,4%%date:~5,2%%date:~8,2%.dmp expdp dlsjzs/dlsjzs@orcl logfile=log.log directory=expdp_dmp dumpfile
set rq=%date:~0,10% rem exp dlsjzs/dlsjzs@orcl file=d:\dbbak\dlsjzs%date:~0,4%%date:~5,2%%date:~8,2%.dmp expdp dlsjzs/dlsjzs@orcl logfile=log.log directory=expdp_dmp dumpfile
--当天 select * from dual where Trunc(Sysdate)-Trunc(字段) = 0 --前一天 select * from dual where Trunc(Sysdate)-Trunc(字段) = 1 --月初月末 select to_char(trunc(add_months(last_day(sysdate), -1) + 1), 'yyyy-mm-dd