Tuesday, September 7, 2021

Control File recovery Using RMAN backup

 


Control File recovery Using RMAN backup

 

Step 1- view the control file location

 

SQL> select name from v$controlfile;

 

NAME

--------------------------------------------------------------------------------

/u01/app/oracle/oradata/ORCL/controlfile/o1_mf_jkfb1xvw_.ctl

/u01/app/oracle/fast_recovery_area/ORCL/controlfile/o1_mf_jkfb1y1l_.ctl

 

Step 2- copy the control file to other location

 

 [oracle@sample ~]$ cp /u01/app/oracle/oradata/ORCL/controlfile/o1_mf_jkfb1xvw_.ctl /backup/rman

 

 

Step 3- connect and shut down the database

 

 [oracle@sample ~]$ . .orcl.env

[oracle@sample ~]$ sqlplus / as sysdba

 

Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0

 

SQL> shut immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> exit

Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0

 

Step 4- connect rman and start the database to spectify the copied control file location

[oracle@sample ~]$ rman target/

 

Recovery Manager: Release 19.0.0.0.0 - Production on Sun Sep 5 23:27:39 2021

Version 19.3.0.0.0

 

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

 

connected to target database (not started)

 

Step -5

 

set database id

 

RMAN> set dbid 1608294549;

 

executing command: SET DBID

 

start the database nomount stage

 

RMAN>  STARTUP NOMOUNT;

 

Oracle instance started

 

Total System Global Area    2147481656 bytes

 

Fixed Size                     8898616 bytes

Variable Size               1694498816 bytes

Database Buffers             436207616 bytes

Redo Buffers                   7876608 bytes

 

Restore the database mention the control file location

 

RMAN> RESTORE CONTROLFILE FROM "/backup/rman/o1_mf_jkfb1xvw_.ctl";

 

Starting restore at 05-SEP-21

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=38 device type=DISK

 

channel ORA_DISK_1: copied control file copy

output file name=/u01/app/oracle/oradata/ORCL/controlfile/o1_mf_jkfb1xvw_.ctl

output file name=/u01/app/oracle/fast_recovery_area/ORCL/controlfile/o1_mf_jkfb1y1l_.ctl

Finished restore at 05-SEP-21

 

Finally mount and open the database

 

RMAN>  alter database mount;

 

released channel: ORA_DISK_1

Statement processed

 

 

No comments:

Post a Comment

Auto Shutdown and Restart of Oracle DB Systems in OCI Using Functions

  🔹 Introduction Oracle Cloud Infrastructure (OCI) Database Systems incur compute costs even when idle. If you're running non-producti...