Archive for 二月 13th, 2009

ASM add controlfile

星期五, 二月 13th, 2009
为了增加ORACLE的安全性,我们需要给ASM添加一个控制文件,默认的ASM安装后,如果只有一个磁盘组的话,是只有一个的
 
步骤如下:
首先查看当前控制文件的存放路径
 
QL> select * from v$controlfile;
 
STATUS-------NAME--------------------------------------------------------------------------------IS_ BLOCK_SIZE FILE_SIZE_BLKS
 
+
DATA_TRADE/zqdb/controlfile/current.256.678128657 NO       16384            932
 
二、修改
SFILE
SQL> alter system set control_files='+DATA_TRADE/zqdb/controlfile/current.256.678128657','+DATA_TRADE' scope=spfile sid='*';
 
System altered.
三、关闭数据库启动到
MOUNT状态
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
 
Total System Global Area 1.2583E+10 bytes
Fixed Size                  2175816 bytes
Variable Size            1990053048 bytes
Database Buffers         1.0586E+10 bytes
Redo Buffers                4259840 bytes
SQL> exit   
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
 
 
四 恢复控制文件
 
rman target / nocatalog
RMAN> restore controlfile from '+DATA_TRADE/zqdb/controlfile/current.256.678128657';
 
Starting restore at 13-2月 -09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=795 instance=zqdb1 devtype=DISK
 
channel ORA_DISK_1: copied control file copy
output filename=+DATA_TRADE/zqdb/controlfile/current.256.678128657
output filename=+DATA_TRADE/zqdb/controlfile/current.316.678713155
Finished restore at 13-2月 -09
 
RMAN> sql 'alter database mount';
 
sql statement: alter database mount
released channel: ORA_DISK_1
 
RMAN> sql 'alter database open';
 
 
五、再次修改
SPFILE
 
SQL> alter system set control_files='+DATA_TRADE/zqdb/controlfile/current.256.678128657','+DATA_TRADE/zqdb/controlfile/current.316.678713155' scope=spfile sid='*';
 
System altered.
 
SQL> shutdown immediate;
 
确认
 
SQL> select name from v$controlfile;
 
NAME
------------------------------------------------------------------------------
--
+DATA_TRADE/zqdb/controlfile/current.256.678128657

+
DATA_TRADE/zqdb/controlfile/current.316.678713155