回复 15# ksly1227
那就继续往上推啊- @echo on
- set ORACLE_HOME=G:\oracle\product\10.2.0\db_1
- rem echo %ORACLE_HOME%
- set ORACLE_SID=test
- rem echo %ORACLE_SID%
- set NLS_LANG=SIMPLIFIED CHINESE_CHINA.ZHS16GBK
- rem echo %NLS_LANG%
- set PATH=%ORACLE_HOME%\bin
- rem echo %PATH%
- set RMAN=%ORACLE_HOME%\bin\rman.exe
- set date=%date:~0,10%
- set BACKUP_DIR=D:\bk\full\%date%
- IF NOT EXIST %BACKUP_DIR% (
- mkdir %BACKUP_DIR%
- )
- set RQ=%date:~4,10%
- set RMAN_LOG_FILE=%BACKUP_DIR%\rman_%RQ%.log
- set BACKUPTYPE=incremental level 0 database
- set NAME=full05_%%d_%%T_%%U
- set ARCHIVE=arch_%%d_%%T_%%U
-
- set DAY=%date:~13,14%
- echo,%DAY%
- if "%DAY%" EQU "一" (
- set CTL=ctl1_%%d_%%T_%%U
- )
-
- if "%DAY%" EQU "二" (
- set CTL=ctl2_%%d_%%T_%%U
- )
-
- if "%DAY%" EQU "三" (
- set CTL=ctl3_%%d_%%T_%%U
- )
-
- if "%DAY%" EQU "四" (
- set CTL=ctl4_%%d_%%T_%%U
- )
-
- if "%DAY%" EQU "五" (
- set CTL=ctl5_%%d_%%T_%%U
- )
-
- if "%DAY%" EQU "六" (
- set CTL=ctl6_%%d_%%T_%%U
- )
-
- if "%DAY%" EQU "日" (
- set CTL=ctl0_%%d_%%T_%%U
- )
- echo,%DAY%
- echo,%CTL%
- (
- echo run {
- echo allocate channel c1 type disk;
- echo backup current controlfile format '%BACKUP_DIR%\%CTL%';
- echo release channel c1;
- echo }
- ) | %RMAN% target / msglog '%RMAN_LOG_FILE%'
复制代码
|