Backup and Recovery Practices

1. How to take physical backup while Database is NO ARCHIVELOG Mode?

1. How to take physical backup while Database is NO ARCHIVELOG Mode?

RMAN> backup full database;

Starting backup at 26-JUL-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=63 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/XE/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/XE/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/XE/example01.dbf
input datafile file number=00006 name=/u01/app/oracle/oradata/XE/scott.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/XE/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/XE/users01.dbf
channel ORA_DISK_1: starting piece 1 at 26-JUL-13
channel ORA_DISK_1: finished piece 1 at 26-JUL-13
piece handle=/u01/app/oracle/flash_recovery_area/XE/backupset/2013_07_26/o1_mf_nnndf_TAG20130726T113307_8z4f2437_.bkp tag=TAG20130726T113307 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
Finished backup at 26-JUL-13

Starting Control File and SPFILE Autobackup at 26-JUL-13
piece handle=/u01/app/oracle/flash_recovery_area/XE/autobackup/2013_07_26/o1_mf_s_821791923_8z4f37od_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 26-JUL-13

2. Complete Closed Database Recovery.

– It is assumed that your control files are still accessible.
– You have a backup, done for example with backup database plus archivelog;
i) Your first step is to make sure that the target database is shut down:
$ sqlplus “/ as SYSDBA”
SQL> shutdown abort;
ORACLE instance shut down.

ii) Next, you need to start up your target database in mount mode.
RMAN cannot restore datafiles unless the database is at least in mount mode because RMAN needs to be able to access the control file to determine which backup sets are necessary to recover the database.

– If the control file isn’t available, you have to recover it first.

Issue the STARTUP MOUNT command shown in the following example to mount the database:
SQL> startup mount;
Oracle instance started.
Database mounted.

iii) Use RMAN to restore the database and recover the database.
To use RMAN, connect to the target database:

$ rman target / catalog rman/rman@rmancat

When the restore command is executed, RMAN will automatically go to its last good backup set
and restore the datafiles to the state they were in when that backup set was created.
When restoring database files, RMAN reads the datafile header and makes the determination as
to whether the file needs to be restored. The recovery is done by allocating a channel for I/O
and then issuing the RMAN restore database command.

You don’t need to allocate a channel explicitly. Instead, you can use the default channel mode:

RMAN> restore database;
RMAN> recover database;
SQL> alter database open;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s