This manual describes a method for a ‘RMAN Restore and Recover a Oracle Database using a Catalog Server’.
Prereq
- Installation of Oracle Enterprise Linux or other.
- Installation of Oracle Database Server 10/11/12.
Software
The necessary software can be downloaded by clicking on the link(s) below.
- n.a.
Restore and Recover methods
Default restore of Oracle Database
When you want to restore to the same server and you backup files are in registerd in a catalog server, you can use the following statements.
1 |
oracle> rman target sys/<PASSWORD>@<SID> catalog <USERNAME>/<PASSWORD>@<SID> |
1 2 3 4 5 6 |
oracle> sqlplus / as sysdba SQL> startup mount; SQL> restore database; SQL> recover database; SQL> alter database open; SQL> exit |
1 2 3 4 |
RMAN> list backup summary; RMAN> list backup of database; RMAN> list backup of controlfile; RMAN> list backup of archivelog all; |
Restore from scratch
1 2 3 4 5 6 7 8 9 10 11 |
oracle> export ORACLE_SID=dbname oracle> cd $ORACLE_BASE/admin oracle> mkdir $ORACLE_SID oracle> cd $ORACLE_SID oracle> mkdir adump bdump cdump dpdump pfile scripts udump oracle> cd /u02/oradata oracle> mkdir $ORACLE_SID oracle> chmod 750 $ORACLE_SID oracle> cd /usr/local/oracle oracle> mkdir $ORACLE_SID oracle> chmod 750 $ORACLE_SID |
1 |
oracle> vi /etc/oratab |
Spfile
1 2 3 4 5 6 7 8 9 10 |
oracle> . oraenv oracle> rman target / catalog <USERNAME>/<PASSWORD>@<SID> RMAN> startup nomount note. expecting a ORA-01078 at first startup try but rman starts the instance anyway RMAN> restore spfile; RMAN> shutdown immediate RMAN> startup nomount |
Database
Restore the database.
1 2 3 4 5 |
RMAN> restore database; Note. other possible syntaxes, #restore archivelog from tag=TAG20160205T162010; #restore archivelog scn between 214433 and 214438; |
Control file
Restore the controlfiles.
1 2 3 4 5 |
RMAN> restore controlfile; RMAN> alter database mount; Note. other possible syntaxes, #restore controlfile from '/u01/backup/ctl_CHECK1_708D94097_6_1'; |
Archivelogs
1 2 3 4 5 6 7 |
RMAN> list backup of archivelog all; RMAN> restore archivelog sequence 27; RMAN> restore archivelog sequence 28; RMAN> restore archivelog sequence 29; #restore archivelog from logseq=568 until logseq=582; #restore archivelog all; |
Recover
1 |
RMAN> list incarnation of database; |
1 |
RMAN> list backup; |
1 2 3 4 |
RMAN> recover database from tag="..." validate; RMAN> recover database from tag="..."; RMAN> alter database open XXXXXX RMAN> list incarnation of database; |
1 2 3 4 5 6 7 8 9 |
oracle> . oraenv oracle> sqlplus / as sysdba SQL> recover database until cancel using backup controlfile; SQL> alter database open; SQL> exit oracle> rman target / catalog <USERNAME>/<PASSWORD>@<SID> RMAN> list incarnation of database; |
1 2 3 4 |
RMAN> recover database noredo; alter database open resetlogs; list incarnation of database; |
Restore database LVL0 backup
Backup lvl0 and lvl1
1 2 |
oracle> rman target / RMAN> connect catalog <USERNAME>/<PASSWORD>@<SID> |
1 2 3 4 5 6 7 |
RMAN> run { allocate channel 'dev_0' type disk; allocate channel 'dev_0' type disk; allocate channel 'dev_0' type disk; allocate channel 'dev_0' type disk; backup incremental level 0 database tag='DB_Level_0'; } |
1 2 3 4 5 6 7 |
RMAN> run { allocate channel 'dev_0' type disk; allocate channel 'dev_0' type disk; allocate channel 'dev_0' type disk; allocate channel 'dev_0' type disk; backup incremental level 1 database TAG='DB_Level_1'; } |
1 |
RMAN> list backup summary; |
Information
- n.a.
Please let me know if this manual ‘RMAN Restore and Recover a Oracle Database using a Catalog Server’ was usefull to you. If there are faults or you have suggestions regarding this manual, please let me know. No rights can be derived from this manual.
Regards,
Maarten