0% found this document useful (0 votes)
36 views4 pages

Rman Cold - Consistent - Offline Backup

The document describes steps to take an offline backup of an Oracle database using RMAN and recover the database on another server. It shows how to connect to RMAN, shutdown the database, take backups of the control file, SPFILE and database, copy the backups to another server, restore the control file, SPFILE and database files using RMAN on the other server, and open the database with a resetlogs.

Uploaded by

oracleharidba
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)
36 views4 pages

Rman Cold - Consistent - Offline Backup

The document describes steps to take an offline backup of an Oracle database using RMAN and recover the database on another server. It shows how to connect to RMAN, shutdown the database, take backups of the control file, SPFILE and database, copy the backups to another server, restore the control file, SPFILE and database files using RMAN on the other server, and open the database with a resetlogs.

Uploaded by

oracleharidba
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/ 4

RMAN BACKUP OFFLINE and RECOVERY

Step1:- connect to rman

[oracle@sipl-24 ~]$ export ORACLE_SID=nsg


[oracle@sipl-24 ~]$ rman target /
Recovery Manager: Release 19.0.0.0.0 - Production on Tue Jun 6 11:39:22 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database: NSG (DBID=2817594157)

RMAN> shutdown immediate;

using target database control file instead of recovery catalog


database closed
database dismounted
Oracle instance shut down

RMAN> startup mount;

Oracle instance started


database mounted

Total System Global Area 2399140616 bytes

Fixed Size 8899336 bytes


Variable Size 553648128 bytes
Database Buffers 1828716544 bytes
Redo Buffers 7876608 bytes

Step2:- take backup in rman

RMAN> backup database format ‘/tmp/backup/nsg/db_%U’;

RMAN> backup current controlfile format ‘/tmp/backup/nsg/control_%U’;

RMAN> backup spfile format ‘/tmp/backup/nsg/spfile’;

Step3:- scp to another machine

[oracle@sipl-24 nsg]$ ls -l
total 882272
-rw-rw----. 1 oracle oracle 8650752 Jun 6 11:44 control_4t1u17pe_1_1
-rw-rw----. 1 oracle oracle 894681088 Jun 6 11:43 db_4r1u17n2_1_1
-rw-rw----. 1 oracle oracle 114688 Jun 6 11:45 spfile

[oracle@sipl-24 nsg]$ scp * [email protected]:/tmp/backup/nsg


[email protected]'s password:
Step3: login to another machine and run rman recovery step as follows

[oracle@sipl-95 ~]$ export ORACLE_SID=nsg


[oracle@sipl-95 ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Tue Jun 6 11:52:39 2023


Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.
connected to target database (not started)

RMAN> startup nomount force;

Oracle instance started


Total System Global Area 2399140616 bytes
Fixed Size 8899336 bytes
Variable Size 553648128 bytes
Database Buffers 1828716544 bytes
Redo Buffers 7876608 bytes

RMAN> restore spfile from '/tmp/backup/nsg/spfile';

Starting restore at 06-JUN-23


using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=132 device type=DISK
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /tmp/backup/nsg/spfile
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 06-JUN-23

RMAN> restore spfile to pfile '/oracle/app/oracle/product/19.0.0/dbhome_1/dbs/initnsg.ora' from


'/tmp/backup/nsg/spfile';

Starting restore at 06-JUN-23


using channel ORA_DISK_1
channel ORA_DISK_1: restoring spfile from AUTOBACKUP /tmp/backup/nsg/spfile
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 06-JUN-23

RMAN> shutdown immediate;


Oracle instance shut down

RMAN> startup nomount;

connected to target database (not started)


Oracle instance started
Total System Global Area 2399140616 bytes
Fixed Size 8899336 bytes
Variable Size 553648128 bytes
Database Buffers 1828716544 bytes
Redo Buffers 7876608 bytes
RMAN> restore controlfile from '/tmp/backup/nsg/control_4t1u17pe_1_1';

Starting restore at 06-JUN-23


allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=136 device type=DISK

channel ORA_DISK_1: restoring control file


channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/oradata/nsg/control01.ctl
output file name=/u02/oradata/nsg/control02.ctl
Finished restore at 06-JUN-23

RMAN> restore controlfile from '/tmp/backup/nsg/control_4t1u17pe_1_1';

Starting restore at 06-JUN-23


allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=136 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/oradata/nsg/control01.ctl
output file name=/u02/oradata/nsg/control02.ctl
Finished restore at 06-JUN-23

RMAN> catalog start with '/tmp/backup/nsg';

searching for all files that match the pattern /tmp/backup/nsg

List of Files Unknown to the Database


=====================================
File Name: /tmp/backup/nsg/control_4t1u17pe_1_1
File Name: /tmp/backup/nsg/spfile

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files


=======================
File Name: /tmp/backup/nsg/control_4t1u17pe_1_1
File Name: /tmp/backup/nsg/spfile

RMAN> restore database preview summary;

Starting restore at 06-JUN-23


using channel ORA_DISK_1

List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
33 B F A DISK 06-JUN-23 1 1 NO TAG20230606T114329
recovery will be done up to SCN 3297666
Media recovery start SCN is 3297666
Recovery must be done beyond SCN 3297666 to clear datafile fuzziness
Finished restore at 06-JUN-23

RMAN> restore database;

Starting restore at 06-JUN-23


using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore


channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/oradata/nsg/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /u02/oradata/nsg/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u02/oradata/nsg/undo.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u03/oradata/nsg/user.dbf
channel ORA_DISK_1: reading from backup piece /tmp/backup/nsg/db_4r1u17n2_1_1
channel ORA_DISK_1: piece handle=/tmp/backup/nsg/db_4r1u17n2_1_1
tag=TAG20230606T114329
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:56
Finished restore at 06-JUN-23

RMAN> recover database noredo;

Starting recover at 06-JUN-23


using channel ORA_DISK_1
Finished recover at 06-JUN-23

RMAN> alter database open resetlogs;


Statement processed

You might also like