0% found this document useful (0 votes)
26 views5 pages

Oracle Database Full Backup Restore and Recovery 1718864230

Oracle

Uploaded by

cszgmwpwqq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views5 pages

Oracle Database Full Backup Restore and Recovery 1718864230

Oracle

Uploaded by

cszgmwpwqq
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

RMAN Database Full Backup & Recovery

In this guide, we will cover how to take an RMAN Full backup and perform database
recovery using the Full backup.

Steps for RMAN Full Backup & Recovery

1. Take RMAN Database Full Backup

Connect to the target database, then take a full database backup along with the archive logs.
RMAN> backup database plus archivelog;

Once the backup is completed, check the backup tag using the following command:
RMAN> list backup of database summary;

2. Create User and Table


Create a new user and table to simulate database activity:
SQL> create user mgr2 identified by mgr2;
SQL> grant connect, resource, create session to mgr2;
SQL> conn mgr2/mgr2
SQL> create table test(serial number(2), name varchar2(5));
SQL> insert into test values (1, 'one');
SQL> insert into test values (2, 'Two');
SQL> insert into test values (3, 'Three');
SQL> insert into test values (4, 'Four');
SQL> commit;

3. Simulate Failure

Get the locations of the SPFILE, datafiles, and control files:


SQL> show parameter spfile;
SQL> select name from v$controlfile;
SQL> select name from v$datafile;
Delete all the SPFILE, datafiles, and control files from the server:
rm -rf <datafile locations>
rm -rf <control file locations>
rm -rf <spfile location>

4. Start Database Recovery

Kill the database instance if it is running. You can perform a shutdown abort or kill the
process at the OS level.

Start the database instance and begin the recovery process:


RMAN> STARTUP FORCE NOMOUNT;

RMAN> RESTORE SPFILE TO


'D:\Oracle\Database\Ora12cDB\database\spfilePRD_DB.ora' FROM AUTOBACKUP;

RMAN> STARTUP FORCE NOMOUNT;


RMAN> restore controlfile from autobackup;
RMAN> alter database mount;
RMAN> restore database from tag TAG20240617T173213;
RMAN> recover database;
RMAN> alter database open RESETLOGS;
In Case AUTOBACKUP is OFF

Restore SPFILE and Control File using the backup tag:


RMAN> list backup of spfile summary;
RMAN> list backup tag <latest-tag>;
RMAN> restore spfile from tag '<latest-tag>';

RMAN> list backup of controlfile summary;


RMAN> list backup tag <latest-tag>;
RMAN> restore controlfile from tag '<latest-tag>';

5. DB Recovery with Manual Channels

You can allocate manual channels and define an RMAN run block to perform complete
database recovery. This method provides fast and unmonitored recovery.
sql
Copy code
RMAN> startup force nomount;
run {
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
restore spfile from tag TAG20240617T173213;
startup force nomount;
restore controlfile from autobackup;
sql 'alter database mount';
restore database from tag TAG20240617T173213;
recover database;
sql 'alter database open RESETLOGS';
release channel ch1;
release channel ch2;
}

You might also like