Saturday, June 10, 2017

Duplicate a controlfile when ASM is involved with OMF


1. Modify the spfile specifically the parameter control_files


SQL> alter system set control_files='+RECO/ORCL/CONTROLFILE/current.257.946348789','+DATA' scope=spfile sid='*';
System altered.

2. Start the instance in NOMOUNT mode.


[oracle@rac1-12c ~]$ . oraenv
ORACLE_SID = [orcl] ? orcl1
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@rac1-12c ~]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.2.0 Production on Sun Jun 11 03:48:49 2017
Copyright (c) 1982, 2014, Oracle.  All rights reserved.

SQL> connect sys/oracle as sysdba
Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 2499805184 bytes
Fixed Size      2927480 bytes
Variable Size    738198664 bytes
Database Buffers  1744830464 bytes
Redo Buffers     13848576 bytes
SQL> 

3. From rman, duplicate the controlfile


[oracle@rac1-12c ~]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Sun Jun 11 03:49:25 2017
Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (not mounted)

RMAN> restore controlfile from '+RECO/ORCL/CONTROLFILE/current.257.946348789';

Starting restore at 11-JUN-17
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=13 instance=orcl1 device type=DISK

channel ORA_DISK_1: copied control file copy
output file name=+RECO/ORCL/CONTROLFILE/current.257.946348789
output file name=+DATA/ORCL/CONTROLFILE/current.425.946352989
Finished restore at 11-JUN-17

RMAN> exit

4. Modify the control_files parameter with the complete path of the new file: 


[oracle@rac1-12c ~]$ . oraenv
ORACLE_SID = [orcl1] ? orcl1
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/12.1.0.2/db_1
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@rac1-12c ~]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.2.0 Production on Sun Jun 11 03:50:56 2017
Copyright (c) 1982, 2014, Oracle.  All rights reserved.

SQL> connect sys/oracle as sysdba
Connected.

SQL> select open_mode from v$database;
select open_mode from v$database
                      *
ERROR at line 1:
ORA-01507: database not mounted

SQL> alter system set control_files='+RECO/ORCL/CONTROLFILE/current.257.946348789',
                                    '+DATA/ORCL/CONTROLFILE/current.425.946352989' 
                                     scope=spfile sid='*';
System altered.

SQL> shu immediate;
ORA-01507: database not mounted
ORACLE instance shut down.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options

5. Check control_files parameter


[oracle@rac1-12c ~]$ srvctl start database -d orcl

[oracle@rac1-12c ~]$ . oraenv
ORACLE_SID = [orcl] ? orcl
The Oracle base remains unchanged with value /u01/app/oracle

[oracle@rac1-12c ~]$ sqlplus /nolog
SQL*Plus: Release 12.1.0.2.0 Production on Sun Jun 11 03:54:34 2017
Copyright (c) 1982, 2014, Oracle.  All rights reserved.

SQL> connect sys/oracle@orcl as sysdba
Connected.

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
orcl2

SQL> show parameter control

NAME         TYPE  VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time      integer  7
control_files        string  +RECO/ORCL/CONTROLFILE/current.257.946348789, 
       +DATA/ORCL/CONTROLFILE/current.425.946352989
control_management_pack_access      string  DIAGNOSTIC+TUNING

1 comment:

  1. Are you tired of seeking loans and Mortgages,have you been turned down constantly By your banks and other financial institutions,We offer any form of loan to individuals and corporate bodies at low interest rate.If you are interested in taking a loan,feel free to contact us today,we promise to offer you the best services ever.Just give us a try,because a trial will convince you.What are your Financial needs?Do you need a business loan?Do you need a personal loan?Do you want to buy a car?Do you want to refinance?Do you need a mortgage loan?Do you need a huge capital to start off your business proposal or expansion? Have you lost hope and you think there is no way out, and your financial burdens still persists? Contact us (gaincreditloan1@gmail.com)

    Your Name:...............
    Your Country:...............
    Your Occupation:...............
    Loan Amount Needed:...............
    Loan Duration...............
    Monthly Income:...............
    Your Telephone Number:.....................
    Business Plan/Use Of Your Loan:...............
    Contact Us At : gaincreditloan1@gmail.com
    Phone number :+44-75967-81743 (WhatsApp Only)

    ReplyDelete