Database 11g

Sunday, December 31, 2017

Multiplexing of Controlfiles in Oracle ASM


>> Some Points regarding controlfile importance.


>> What is a controlfile & What it contains ?

 Controlfile is a small binary file that records the physical structure of the database.

>> When Oracle database is started this is the file which oracle reads to get the names of datafiles and their locations.

Which means :

1. The database name and locations of datafiles and redolog files.

2. Timestamp of database creation.

3. Curent logsequence Number.

4. Checkpoint Information.

5. Backup set Details.

6. SCN number etc....

Note: Server Process is responsible for Continuously updating during these operations.


>> Why to Multiplex controlfiles ?

> In database we should have at least two control files, each Should stored on a different physical
  disk to safeguard the database.


>> Scenarios When to Create 'NEW' Control File.


1. All control files for the database have been permanently damaged and you do not have a control file backup.

2. You want to change one of the permanent database parameter settings originally specified in the
   CREATE DATABASE statement. These settings include the database's name and the following parameters:
   MAXLOGFILES, MAXLOGMEMBERS, MAXLOGHISTORY, MAXDATAFILES, and MAXINSTANCES.


       HOW TO MULTIPLEX CONTROLFILES IN ASM ENVIRONMENT


SQL> select name from v$controlfile;

NAME
-------------------------------------------------
+DATA/kkprod/controlfile/current.262.962995555

>> Set new disk-group for new controlfile.

SQL> alter system set control_files='+DATA/kkprod/controlfile/current.262.962995555', '+DATA1' scope=spfile;

System altered.

SQL> show parameter control_files;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      +DATA/kkprod/controlfile/current.262.962995555

SQL> shut immediate

Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup nomount;

ORACLE instance started.
Total System Global Area 2087780352 bytes
Fixed Size                  2256784 bytes
Variable Size             536871024 bytes
Database Buffers         1543503872 bytes
Redo Buffers                5148672 bytes

>> Disk group 'DATA1' is added.

SQL> show parameter control_files;

NAME             TYPE        VALUE
-----------------------------------------------------------------------------------
control_files   string      +DATA/kkprod/controlfile/current.262.962995555, +DATA1

RMAN> restore controlfile from '+DATA/kkprod/controlfile/current.262.962995555';

Starting restore at 28-DEC-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=130 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+DATA/kkprod/controlfile/current.262.962995555
output file name=+DATA1/kkprod/controlfile/current.256.963941387

Finished restore at 28-DEC-17

C:\Windows\system32> sqlplus / as sysdba

Here you need to add both the controlfiles  from the above RMAN restore output

SQL> alter system set control_files='+DATA/kkprod/controlfile/current.262.962995555','+DATA1/kkprod/controlfile/current.256.963941387' scope=spfile;

System altered.

SQL> shut immediate

ORA-01507: database not mounted
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 2087780352 bytes
Fixed Size                  2256784 bytes
Variable Size             536871024 bytes
Database Buffers         1543503872 bytes
Redo Buffers                5148672 bytes
Database mounted.
Database opened.

SQL> select instance_name,status from v$instance;

INSTANCE_NAME       STATUS
-------------------------------------------------
kkprod                              OPEN


SQL> select name from v$controlfile;

NAME
------------------------------------------------
+DATA/kkprod/controlfile/current.262.962995555
+DATA1/kkprod/controlfile/current.256.963941387


SQL> show parameter control_files

NAME                 TYPE        VALUE
--------------------------------------------------------------------------------
control_files       string      +DATA/kkprod/controlfile/current.262.962995555,
                                          +DATA1/kkprod/controlfile/current.256.963941387




Happy Learning...

No comments:

Post a Comment