NEW: archivelog backup scripts

This commit is contained in:
xpk 2022-10-07 10:48:59 +08:00
parent 7c0e554335
commit 06100d65de
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,15 @@
connect target /
run {
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK MAXPIECESIZE 5G;
crosscheck archivelog all;
backup archivelog all not backed up 1 times format '/orabackup/arch/%d_%s_%p_%t';
release channel disk1 ;
}
run
{
delete noprompt archivelog until time = 'sysdate-2' backed up 1 times to device type disk;
}
exit;

View File

@ -0,0 +1,10 @@
#!/bin/bash
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_home
export PATH=$ORACLE_HOME/bin:$PATH
export LOG_DIR=/orabackup/logs
export DATE=$(date +%d)
for i in bvcprsu1 bvalfpr1 bvcprsw1; do
export ORACLE_SID=$i
rman cmdfile=/orabackup/scripts/rman-archivelog-backup.rcv log=$LOG_DIR/${DATE}_${ORACLE_SID}.log
done