Adding controlfile in database means copy an existing controlfile and making database aware of copy by modifying control_files parameter .
Steps to Add controlfile :
==================================
Step 1:-
Alter the initialization CONTROL_FILES parameter to include new location and name of controlfile.
Step 2:-
Shutdown database
Step 3:-
Use OS command to copy existing good control file to new location and rename .
Step 4:-
start database
If database use pfile
============================
shutdown database,
copy one of controlfile to new locations,
manually edit pfile
startup database.
Example:
[oracle@mylab ~]$ sqlplus "/as sysdba"
**************************************************************
check current controlfiles location information
***************************************************************
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /u01/app/oracle/oradata/bsnl/control01.ctl, /u01/app/oracle/fast_recovery_area/bsnl/control02.ctl
SQL>
*****************************************************************************
Make change CONTROL_FILES parameter with new location using below command
*****************************************************************************
SQL > alter system set control_files= '/u01/app/oracle/oradata/bsnl/control01.ctl', '/u01/app/oracle/fast_recovery_area/bsnl/control02.ctl', '/u01/app/oracle/oradata/bsnl/control_files/control03.ctl' scope=spfile;
*******************************************
Shut down database
*****************************************
SQL> shut immediate
**********************************************
Use OS command copy controlfile to new location
**********************************************
[oracle@mylab bsnl]$
[oracle@mylab bsnl]$ cp control01.ctl control_files/control03.ctl
[oracle@mylab bsnl]$
********************************************
Start database
********************************************
[oracle@mylab ~]$ sqlplus "/as sysdba"
SQL> startup
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /u01/app/oracle/oradata/bsnl/control01.ctl, /u01/app/oracle/fast_recovery_area/bsnl/control02.ctl, /u01/app/oracle/oradata/bsnl/control_files/control03.ctl
No comments:
Post a Comment