RUN {
ALLOCATE CHANNEL ch00 TYPE 'DISK';
BACKUP
TAG CONTROLFILE_BACKUP
FORMAT '/u02/rman_backup/cntrl_%s_%p_%t'
CURRENT CONTROLFILE;
RELEASE CHANNEL ch00;
ALLOCATE CHANNEL ch00 TYPE DISK;
ALLOCATE CHANNEL ch01 TYPE DISK;
ALLOCATE CHANNEL ch02 TYPE DISK;
ALLOCATE CHANNEL ch03 TYPE DISK;
sql 'alter system archive log current';
sql 'alter sytem switch logfile;
BACKUP
TAG MEIS_DB_BACKUP
FORMAT '/u02/rman_backup/MEIS_%s_%p_%t'
DATABASE;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
ALLOCATE CHANNEL ch00 TYPE 'DISK';
ALLOCATE CHANNEL ch01 TYPE 'DISK';
BACKUP
TAG ARCHIVELOG_BACKUP
FORMAT '/u02/rman_backup/arc_MEIS_%s_%p_%t'
ARCHIVELOG ALL DELETE INPUT;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
}
EXP: Shell Script
==========================================================
#!/bin/bash
cd
. .bash_profile
export BACKUPPATH="path_to_backup_file"
for i in DB1 DB2
do
export DATAFILE="${i}_DATAFILE_$(date '+%Y%m%d')"
echo $DATAFILE
export ARCHIVEDLOG="${i}_ARCHIVEDLOG_$(date '+%Y%m%d')"
echo $ARCHIVEDLOG
export CONTROLFILE="${i}_CONTROLFILE_$(date '+%Y%m%d')"
echo $CONTROLFILE
export RMAN_LOG_FILE="RMAN_FULL_BACKUP_${i}_$(date '+%Y%m%d').out"
echo $RMAN_LOG_FILE
echo Backup_data_file_path=$BACKUPPATH
export ORACLE_SID=$i
rman target / msglog ${BACKUPPATH}/log/$RMAN_LOG_FILE <<EOF
run
{
ALLOCATE CHANNEL ch00 TYPE DISK;
ALLOCATE CHANNEL ch01 TYPE DISK;
ALLOCATE CHANNEL ch02 TYPE DISK;
ALLOCATE CHANNEL ch03 TYPE DISK;
BACKUP
TAG "${DATAFILE}"
FORMAT '${BACKUPPATH}/${i}/DATA_${i}_%s_%p_%t'
DATABASE;
sql 'alter system archive log current';
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
RELEASE CHANNEL ch02;
RELEASE CHANNEL ch03;
ALLOCATE CHANNEL ch00 TYPE DISK;
ALLOCATE CHANNEL ch01 TYPE DISK;
BACKUP
TAG "${ARCHIVEDLOG}"
FORMAT '${BACKUPPATH}/${i}/arc_${i}_%s_%p_%t'
ARCHIVELOG ALL DELETE INPUT;
RELEASE CHANNEL ch00;
RELEASE CHANNEL ch01;
ALLOCATE CHANNEL ch00 TYPE DISK;
BACKUP
TAG "${CONTROLFILE}"
FORMAT '${BACKUPPATH}/${i}/cntrl_${i}_%s_%p_%t'
CURRENT CONTROLFILE;
RELEASE CHANNEL ch00;
}
CROSSCHECK BACKUP;
DELETE NOPROMPT OBSOLETE;
EXIT;
EOF
echo $i
done
tip: SCN
Controlfile----> Datafile----> Archivelog
Subscribe to:
Post Comments (Atom)
ALCATEL 6900
write memory copy running certified reload from working no rollback-timeout
-
grant execute on utl_http to wc grant execute on dbms_lock to wc; BEGIN DBMS_NETWORK_ACL_ADMIN.create_acl ( acl => &...
-
:system view system-view or sys :show all config dis current-configuration :create vlan vlan vlan_number :show ip interface ...
-
``` sda: add missing path sda: failed to get udev uid: Invalid argument sda: failed to get sysfs uid: Invalid argument sda: failed to ge...
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.