Beruflich Dokumente
Kultur Dokumente
RMAN> exit
1
Recovery Manager: Release 9.2.0.1.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
RMAN>
Full Backup :
Next we perform a Full database backup every Sunday using the following
Shell script:
rman <<EOF
connect target sys/oth1quin@OTH1
connect catalog rman/rman@TPS1
run { allocate channel d1 type disk;
backup full tag backup_1 filesperset 2
format '/u07/oradata/TPS1/bkp_rman/rman_BACKUP_
%d_%t.%p.%s.%c.%n.%u.bus'
database plus archivelog;
release channel d1;
}
EOF
Explanation :
• The control file backup set is created in the dbs directory of the target
database i.e. /u01/app/oracle/product/9.2.0/dbs/ and the bacjup sets
are created on the path specified in the format.
2
Incremental Backups (cumulative type)
For taking the incremental backups the following scripts needs to be set up in
cronjob.
The very first incremental would be of Level 0 i.e. on Monday and after that
Level 1 incremental backup would be taken from Tuesday till Saturday.
rman <<EOF
connect target sys/oth1quin@OTH1
connect catalog rman/rman@TPS1
run { allocate channel d1 type disk;
backup incremental level 0
filesperset 2
format '/u07/oradata/TPS1/bkp_rman/rman_LVL0_%d.
%t.%p.%c.bus'
database plus archivelog;
release channel d1;
}
EOF
rman <<EOF
connect target sys/oth1quin@OTH1
connect catalog rman/rman@TPS1
run { allocate channel d1 type disk;
backup incremental level 1
filesperset 2
format '/u07/oradata/TPS1/bkp_rman/rman_LVL1_%d.%t.%p.%c.bus'
database plus archivelog;
release channel d1;
}
EOF
5. The most important task after every backup taken using RMAN is to resync
the catalog database with the target database and this can be achieved by
the following command ,
RMAN> resync catalog;
The same can be set in cronjob but keeping in mind that it is run after the
incremental or full backup completes for that day.
• Run the following in SQL prompt from rman login to the catalog database:
• Select DB_ID,stamp,backup_type,incremental_level,pieces,start_time,
controlfile_included from RC_BACKUP_SET;
• To Check the backup progress run the following query ( it shows output if
the backup operation is too long due to the big size of the target
database):
select sid, serial#, context,
round(sofar/totalwork*100,2) "% Complete",
3
substr(to_char(sysdate,'yymmdd hh24:mi:ss'),1,15) "Time Now"
from v$session_longops;
iii. Using date as a range specifier. i.e. list archives older then 3 days.
list backupset of archivelog until time "sysdate - 3";
iv. List how many incarnations of the database and the key numbers.
list incarnation of database;
viii. To report what has not had a backup for 5 days or more for the database.
report need backup days 5 database;
ix. Report which backupsets are not consistent and cannot be used for
recovery.
report unrecoverable database;
x. To find the backup sets for last 7 days in order to find backupsets that
can be removed from the catalog use:
report obsolete redundancy 7;
xii. To report files that will require the application of 5 incremental backups
to recover the database.
4
7. Problems / Issues and Solutions:
• If below mentioned error is faced then we need to check the init.ora file
on target database server for the following parameter and it should be set to
EXCLUSIVE i.e. “remote_login_passwordfile=EXCLUSIVE”
RMAN-00571:
==========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS
===============
RMAN-00571:
==========================================================
=
RMAN-00554: initialization of internal recovery manager package failed
RMAN-04005: error from target database:
ORA-01031: insufficient privileges