⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 os_bak_arch.bat

📁 oracle数据库备份与恢复的详细资料集合
💻 BAT
字号:

call I:\example\backup\rman_backup_script_win\set_env.bat

@echo.
@echo ************************************* OS_bak_arch.bat file run begin *******************************
@echo.


@echo  display and write the err tag, if the previous scp to the backup server operation was failed

@%DBS_BIN_FILE_DIC%\cat.exe %DBS_TAG_DIC%\rman_db_bak.flag | %DBS_BIN_FILE_DIC%\grep.exe rman_db_bak_begin
@IF %ERRORLEVEL% EQU 0 (
	echo Warnning : " %DBS_TAG_DIC%\rman_db_bak.flag " is rman db bak begin
  	echo.
  	echo !!!!!!!!!! The action of scp backup Oracle archived redo log Files to backup server Failed !!!!!!!!!!!
  	echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  because the rman backup is working !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  	echo.
  	
  	exit 1;
)

@%DBS_BIN_FILE_DIC%\cat.exe %DBS_TAG_DIC%\arch_scp_bak.flag | %DBS_BIN_FILE_DIC%\grep.exe yes
@IF %ERRORLEVEL% EQU 1 (
	echo xxxxxxxxxxxxxxx ERROR: " %DBS_TAG_DIC%\db_scp_bak.flag " is no xxxxxxxxxxxxxxx 
  	echo.
  	echo "xxxxxxxxxxxxxxx  The operation of scping RMAN backup Files to backup server Failed xxxxxxxxxxxxxxx 
  	echo.
  	echo yes > %DBS_TAG_DIC%\arch_scp_bak_err.flag
)

@IF NOT EXIST %DBS_TAG_DIC%\db_backup.tag (
	%DBS_BIN_FILE_DIC%\touch.exe %DBS_TAG_DIC%\backup_arch.flag
)

@echo     Mannual switch online redo log
@sqlplus -s %USERPASS% @%DBS_CONF_FILE_DIC%\archive_arch.sql

@IF %ERRORLEVEL% EQU 1 (
	echo.
	echo xxxxxxxxxxxxxxx ERROR:  Mannual switch online redo log failed xxxxxxxxxxxxxxx 
  	echo.
)


@echo  generate backup arch files for the first archived directory
@cd %ARCH_DEST1%
@%DBS_BIN_FILE_DIC%\find.exe %ARCH_DEST1% -newer %DBS_TAG_DIC%\backup_arch.flag -a -type f -print > %DBS_BAK_ARCH_DIC1%\bk_arch_t.list

@%DBS_BIN_FILE_DIC%\awk.exe '{ full_name = $0; gsub("/","\\",full_name); print full_name;}' %DBS_BAK_ARCH_DIC1%\bk_arch_t.list >%DBS_BAK_ARCH_DIC1%\bk_arch.list

@%DBS_BIN_FILE_DIC%\awk.exe 'BEGIN {arch_target=ENVIRON["DBS_BAK_ARCH_DIC1"]; arch_test=ENVIRON["ARCH_DEST1"]} { full_name = $0; if($0!="") {n = length(arch_test); log_name = substr(full_name,n + 2); print "copy " full_name " " arch_target "\\" log_name}}' %DBS_BAK_ARCH_DIC1%\bk_arch.list >%DBS_GEN_SQL_DIC%\arch.%ORACLE_SID%.bat

@%DBS_BIN_FILE_DIC%\touch.exe %DBS_TAG_DIC%\backup_arch.flag


@echo     Copying first archived directory ...
@%DBS_GEN_SQL_DIC%\arch.%ORACLE_SID%.bat



@echo.
@echo  ************************************* OS_bak_arch.bat file run end *******************************
@echo.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -