Datasheet

40
Chapter 1
Using Oracle ASM
RMAN>shutdown
RMAN>startup nomount
RMAN>restore controlfile from autobackup;
RMAN>recover database;
RMAN>alter database open resetlogs;
Note that instead of setting the DB_CREATE_FILE_DEST parameter, you could set the
CONTROL_FILES parameter, as shown here:
alter system set control_files=
‘+COOKED_DGROUP1/11GDB/controlfile/current.259.613088323’,
‘+COOKED_DGROUP2/11GDB/controlfile/current.257.613088325’;
If you have restored the control files to a disk group, you may not know what the file-
names are in order to set the
CONTROL_FILES parameter (the RMAN output does not give
you the ASM filenames that are created). In this case, you can query the
V$ASM_FILE view
from the ASM instance and derive the filename for the newly created control file.
Recall that the format for an ASM filename is
file_type_flag.file#.incarnation#.
Knowing this, you can derive the control-file names. For example, here is a query against the
V$ASM_FILE view in our database after we restored the control files to our ASM instance:
SQL> select a.group_number, b.name, a.incarnation, a.file_number, a.type
2 from v$ASM_DISKGROUPS b, v$asm_file a
3 where a.group_number= b.group_number
4 and a.type=’CONTROLFILE’;
GROUP_NUMBER NAME INCARNATION FILE_NUMBER TYPE
------------ ------------------------------ ----------- ----------- -----------
1 COOKED_DGROUP1 613087119 258 CONTROLFILE
2 COOKED_DGROUP2 613087131 256 CONTROLFILE
From this, we can surmise that our CONTROL_FILES parameter should be set to the
following:
alter system set control_files=
’+COOKED_DGROUP1/11GDB/controlfile/current.258.613087119’,
’+COOKED_DGROUP1/11GDB/controlfile/current.258.613087131’
Scope=spfile;
Of course, you can reverse this process and move control files out of ASM and put them
into cooked file systems at any time. As should always be standard practice, make sure you
back up your database before you begin moving any database-related files around.
95134c01.indd 40 1/28/09 9:43:46 AM