Thursday 2 January 2014

Multiplexing the controlfile using pfile in oracle database?

What is multiplexing ?

Storing each copy of controlfile on different physical disk is called  multiplexing.
One controlfile is lost another copy of controlfile can be used to re start  the instance without database recovery.


++++++++++++++++++++++++++++++++++++++++
Steps for  multiplexing controlfile
++++++++++++++++++++++++++++++++++++++
1)Check the number of controlfile in the database.
2)Shutdown the database
3)Copy the controlfile to new location
4)add the new controlfile location in pfile and start the database with pfile.
5)query the v$controlfile view.

SQL> show parameter control_files
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_files                        string      /d02/oracle/oradata/orcl/contr
                                                 ol01.ctl, /d02/oracle/flash_re
                                                 covery_area/orcl/control02.ctl
SQL> ---Now shutdown the database --
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@wasiq ~]$
+++++++++++++++++++++++++++
Copy the controlfile to new location
+++++++++++++++++++++++++++++++++
[oracle@wasiq orcl]$  cp -r /d02/oracle/flash_recovery_area/orcl/control02.ctl /d08/dbdata/data1/orcl/control03.ctl
++++++++++++++++++++++++++++++++++
Moved the spfile if it is there in
$ORACLE_HOME/dbs location.
++++++++++++++++++++++++++++++++++
[oracle@wasiq dbs]$ ls -tlrh *.ora
-rw-r----- 1 oracle dba 3.5K Jan  2 14:08 spfileorcl.ora
-rw-r--r-- 1 oracle dba 1003 Jan  2 14:13 initorcl.ora
[oracle@wasiq dbs]$ mv spfileorcl.ora spfileorcl.ora_latest
[oracle@wasiq dbs]$


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Go to $ORACLE_HOME/dbs location and in pfile  edit the parameter control_files and add new location where you want
to multiplex the controlfile.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/d02/oracle/prod/11.2.0/dbs
[oracle@wasiq dbs]$ ls -ltrh *.ora
-rw-r--r-- 1 oracle dba 2.8K May 15  2009 init.ora
-rw-r--r-- 1 oracle dba  964 Dec 28 21:05 initorcl.ora
-rw-r----- 1 oracle dba 3.5K Jan  2 14:08 spfileorcl.ora
[oracle@wasiq dbs]$ vi initorcl.ora
orcl.__db_cache_size=973078528
orcl.__java_pool_size=16777216
orcl.__large_pool_size=16777216
orcl.__oracle_base='/d02/oracle'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=469762048
orcl.__sga_target=1375731712
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=335544320
orcl.__streams_pool_size=16777216
*.audit_file_dest='/d02/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/d02/oracle/oradata/orcl/control01.ctl','/d02/oracle/flash_recovery_area/orcl/control02.ctl','/d08/dbdata/data1/orcl/control03.ctl'
*.db_block_size=8192
*.db_domain='oracle.com'
*.db_name='orcl'
*.db_recovery_file_dest='/d02/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4039114752
*.diagnostic_dest='/d02/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.local_listener='LISTENER_ORCL'
*.open_cursors=300
*.pga_aggregate_target=455081984
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=1365245952
*.undo_tablespace='UNDOTBS1'
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
:wq!
++++++++++++++++++++++++++++++++++
Now startup the database with pfile
++++++++++++++++++++++++++++++++++++
/d02/oracle/prod/11.2.0/dbs
[oracle@wasiq dbs]$ ls -tlrh *.ora
-rw-r--r-- 1 oracle dba 1003 Jan  2 14:13 initorcl.ora
[oracle@wasiq dbs]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.1.0 Production on Thu Jan 2 14:23:52 2014
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> --- I have only pfile in $ORACLE_HOME/dbs location,if i give startup then it will use pfile and bring up the instance--
SQL> startup
ORACLE instance started.
Total System Global Area 1372651520 bytes
Fixed Size                  1336428 bytes
Variable Size             385878932 bytes
Database Buffers          973078528 bytes
Redo Buffers               12357632 bytes
Database mounted.
Database opened.
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/d02/oracle/oradata/orcl/control01.ctl
/d02/oracle/flash_recovery_area/orcl/control02.ctl
/d08/dbdata/data1/orcl/control03.ctl

SQL>

No comments:

Post a Comment