Oracle 11gR2 (11.2.0.4) RMAN cold backup | Media recovery

oracleoracle-11g-r2rman

I'm planning to setup a test server with production data. The intended actions are, making a cold backup & restoring it in the Test server.

The cold backup routine is

run
{
shutdown immediate;
startup mount;
backup database;
}

As I am restoring a cold backup, should be bothered about losing some data? The database is on Archive logging mode. Should I do a recover media as part of the restore process?

Best Answer

SHUTDOWN

IMMEDIATE

Does not wait for current calls to complete or users to disconnect from the database.

Further connects are prohibited. The database is closed and dismounted. The instance is shutdown and no instance recovery is required on the next database startup.

SHUTDOWN

ABORT

Performs an inconsistent shutdown of the target instance, with the following consequences:

All current client SQL statements are immediately terminated.

Uncommitted transactions are not rolled back until next startup.

All connected users are disconnected.

Instance recovery is performed on the database at next startup.

IMMEDIATE

Performs an immediate, consistent shutdown of the target database, with the following consequences:

Current client SQL statements being processed by the database are allowed to complete.

Uncommitted transactions are rolled back.

All connected users are disconnected.

A cold backup is consistent already, requires no further recovery. All you need to do is open the restored database with:

alter database open resetlogs;

You will have your database as it existed when you took the cold backup. If you need a state newer than that, only then you need to recover further the restored database.