Which of the following statements is true?

Your database is up and running and one of your three control files is accidentally erased.
You start RMAN and run the following command:
RESTORE CONTROLFILE FROM AUTOBACKUP;
Which of the following statements is true? (Choose all that apply.)

Your database is up and running and one of your three control files is accidentally erased.
You start RMAN and run the following command:
RESTORE CONTROLFILE FROM AUTOBACKUP;
Which of the following statements is true? (Choose all that apply.)

A.
The command restores only the missing control file.

B.
The command restores all the control files.

C.
The command fails because the database is running.

D.
This is the correct way to address this problem.

E.
This is not the correct way to address this problem.

Explanation:
During the database running, the control files are locked by the database instance, you must
shutdown the database and startup at NOMOUNT status to restore a missing control file.
And you have to open database with RESETLOGS option, due to control file change.



Leave a Reply to Vic Cancel reply3

Your email address will not be published. Required fields are marked *

13 + 8 =


Andrew

Andrew

The correct answers are B and E.

C is not correct because Instance immediately aborts if even one of the Control Files specified in the Initialization Parameter File is lost.

Vic

Vic

Here is testcase which explains why C & E are correct:

## Backup controlfile

RMAN> backup current controlfile;

Starting backup at 24-JAN-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=39 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 24-JAN-17
channel ORA_DISK_1: finished piece 1 at 24-JAN-17
piece handle=/oracle/fra/OCP/backupset/2017_01_24/o1_mf_ncnnf_TAG20170124T161308_d8gnq593_.bkp tag=TAG20170124T161308 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 24-JAN-17

RMAN> list backup of controlfile;

List of Backup Sets
===================

BS Key Type LV Size Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
1 Full 9.33M DISK 00:00:01 24-JAN-17
BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20170124T161308
Piece Name: /oracle/fra/OCP/backupset/2017_01_24/o1_mf_ncnnf_TAG20170124T161308_d8gnq593_.bkp
Control File Included: Ckp SCN: 1138736 Ckp time: 24-JAN-17

## Remove controlfile while database is running

SQL> select name from v$controlfile;

NAME
——————————————————————————–
+DATA_001/ocp/controlfile/current.260.934031875
/oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl

SQL> !rm /oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl^C

SQL> !ls /oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl
/oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl

SQL> !rm /oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl

SQL> !ls /oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl
ls: cannot access /oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl: No such file or directory

SQL> select status from v$instance;

STATUS
————
OPEN

## Connect to RMAN
oracle@s001tst-rhcsa|16:17|/oracle/oradump:rman target /

Recovery Manager: Release 11.2.0.4.0 – Production on Tue Jan 24 16:17:24 2017

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

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-00554: initialization of internal recovery manager package failed
RMAN-06003: ORACLE error from target database:
ORA-00210: cannot open the specified control file
ORA-00202: control file: ‘/oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl’
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

## Stop instance and restore controlfile
## Even controlfile had been deleted the instance was still OPEN.

SQL> select status from v$instance;

STATUS
————
OPEN

SQL> shutdown immediate;
ORA-00210: cannot open the specified control file
ORA-00202: control file: ‘/oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl’
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3

SQL> shutdown abort;
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

## Restore control file
RMAN> startup nomount

Oracle instance started

Total System Global Area 1369579520 bytes

Fixed Size 2253104 bytes
Variable Size 419434192 bytes
Database Buffers 939524096 bytes
Redo Buffers 8368128 bytes

RMAN> restore controlfile from ‘/oracle/fra/OCP/backupset/2017_01_24/o1_mf_ncnnf_TAG20170124T161308_d8gnq593_.bkp’;

Starting restore at 24-JAN-17
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=+DATA_001/ocp/controlfile/current.260.934031875
output file name=/oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl
Finished restore at 24-JAN-17

## Here ‘alter databae open’ failed because no resetlogs was specified

RMAN> sql ‘alter database open’;

sql statement: alter database open
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 01/24/2017 16:22:03
RMAN-11003: failure during parse/execution of SQL statement: alter database open
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open

RMAN> sql ‘alter database open resetlogs’;

sql statement: alter database open resetlogs
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of sql command on default channel at 01/24/2017 16:22:12
RMAN-11003: failure during parse/execution of SQL statement: alter database open resetlogs
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: ‘+DATA_001/ocp/datafile/system.256.934031819’

RMAN> recover database;

Starting recover at 24-JAN-17
Starting implicit crosscheck backup at 24-JAN-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
Finished implicit crosscheck backup at 24-JAN-17

Starting implicit crosscheck copy at 24-JAN-17
using channel ORA_DISK_1
Finished implicit crosscheck copy at 24-JAN-17

searching for all files in the recovery area
cataloging files…
cataloging done

List of Cataloged Files
=======================
File Name: /oracle/fra/OCP/backupset/2017_01_24/o1_mf_ncnnf_TAG20170124T161308_d8gnq593_.bkp

using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 14 is already on disk as file +DATA_001/ocp/onlinelog/group_2.262.934031879
archived log file name=+DATA_001/ocp/onlinelog/group_2.262.934031879 thread=1 sequence=14
media recovery complete, elapsed time: 00:00:00
Finished recover at 24-JAN-17

RMAN> sql ‘alter database open resetlogs’;

sql statement: alter database open resetlogs

SQL> select status from v$instance;

STATUS
————
OPEN

SQL> select name from v$controlfile;

NAME
——————————————————————————–
+DATA_001/ocp/controlfile/current.260.934031875
/oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl

Vic

Vic

SQL> select status from v$instance;

STATUS
————
OPEN

RMAN> restore controlfile from ‘/oracle/fra/OCP/backupset/2017_01_24/o1_mf_ncnnf_TAG20170124T161308_d8gnq593_.bkp’;

Starting restore at 24-JAN-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=34 device type=DISK

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 01/24/2017 16:40:47
RMAN-06496: must use the TO clause when the database is mounted or open

RMAN> restore controlfile to ‘/oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl’ from ‘/oracle/fra/OCP/backupset/2017_01_24/o1_mf_ncnnf_TAG20170124T161308_d8gnq593_.bkp’;

Starting restore at 24-JAN-17
using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 01/24/2017 16:41:49
ORA-19607: /oracle/fra/OCP/controlfile/o1_mf_d8cp2mpq_.ctl is an active control file