Friday, February 13, 2009

Multiplexing Control Files and Redo Log Files in Oracle Database

Placing the oracle server processing files such as redo log and control files in multiple destination is multiplexing. It is good practise to run database in muliplexing mode such that one can recover or run the database from the multiplexed files in case of failure.

Multiplexing Control Files

Create pfile from spfile;
Shutdown the database;
shutdown immediate;
Change
control_files='filepath1\CONTROL01.CTL',
filepath1\CONTROL02.CTL',
filepath1\CONTROL03.CTL'
To
control_files='filepath1\CONTROL01.CTL',filepath2\CONTROL01.CTL',
filepath1\CONTROL02.CTL',filepath2\CONTROL02.CTL',
filepath1\CONTROL03.CTL',filepath2\CONTROL03.CTL' in pfile.

Copy control files from the first destination to second destination
Start the database
statup;
confirm the muliplexing.
show parameter control_files

Multiplexing Redo Log files

List the status of the Redo Log files by firing
SELECT * FROM V$LOG;
Drop all the redolog that are in inactive and unused state by issuning
ALTER DATABASE DROP LOGFILE 'filepath\logfilename.log';

Then create the redolog files group in muliple destination by issuning
ALTER DATABASE ADD LOGFILE GROUP group_number ('filepath1\logname.log','filepath2\logname.log') SIZE 5M;
Repeat the process to add the group each time

To drop active and current log files Switch the logfile to next by issuing
ALTER SYSTEM SWITCH LOGFILE;
Then drop the redo log and create the new group as before.

Then issue
SELECT * FROM V$LOG;

Remember that for best performance redo log files must be of same size.
This completes the muliplexing of control files and redo log files.

No comments: