Pages

Monday, January 11, 2010

Enable ARCHIVELOG and FLASHBACK mode on ASM

To enable ARCHIVELOG on ASM and configure FLASHBACK (without enabling it) you need to set up the appropriate initialization parameters (db_recovery_file_dest_size, db_recovery_file_dest, db_flashback_retention_target).

SQL>alter system set db_recovery_file_dest_size = '400G' scope=both sid='*';
SQL>alter system set db_recovery_file_dest = '+DATA_RAC3' scope=both sid='*';
SQL> alter system set db_flashback_retention_target =





ALTER DATABASE FLASHBACK

Add a controlfile into ASM when original controlfile is stored on ASM

Some days ago I installed Oracle 11gR2 on a RAC formed by two nodes. The default installation on ASM use just a controlfile. So I decided to add another one and the following are the steps I've done.

I'm using of course an spfile for my instance.
From a sqlplus sessions I needed to know where my current controlfile was and then altered the system to add another one. So I typed:
sql> show parameter control_files
sql> alter system set control_files='+DATA_RAC3/rac3/controlfile/current.260.706989187', '+DATA_RAC3' scope=spfile sid='*';


After I needed to put the instance in NOMOUNT mode, so as the oracle user, I typed:
srvctl stop database -d RAC3 -o immediate


From rman I was able to duplicate the controlfile, using the following commands:
$ rman nocatalog
RMAN>connect target
RMAN> restore controlfile from '+DATA_RAC3/rac3/controlfile/current.260.706989187';

After those commands, I put the database in OPEN mode, always from RMAN console:
RMAN> sql 'alter database mount';
RMAN> sql 'alter database open;


From a new sqlplus session I was able to see my new duplicated controlfile:
sql> select name from v$controlfile;


And now the last step. I needed to alter again the system, modifing the control_file parameter with the complete path of the new file:
sql> alter system set control_files='+DATA_RAC3/rac3/controlfile/current.260.706989187', '+DATA_RAC3/rac3/controlfile/current.268.707763013' scope=spfile sid='*';