欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Oracle 11g在ASM磁盘组上添加控制文件

程序员文章站 2022-06-12 12:57:37
...

ORACLE使用ASM存储,建库时默认只有一个控制文件,如果想多加几个控制文件,需要通过手工来添加,以下是具体步骤:

1. 查看现在的控制文件

[oracle@Oracle-LAB dbs]$sqlplus /nolog

SQL> conn /assystem

SQL> conn /assysdba

SQL> set line 200

SQL> column nameformat a50

SQL> select * from v$controlfile;

STATUS NAME IS_ BLOCK_SIZE FILE_SIZE_BLKS

---------- ------------------------------------------------ ---------- ----

+DATA/orcl/controlfile/current.259.833372337 NO 16384 594

2.

SQL> alter system setcontrol_files='+DATA/orcl/controlfile/current.259.833372337','+DATA','+FRA'scope=spfile sid='*';

System altered.

3.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLEinstance shut down.

[oracle@Oracle-LAB/]$ rman target/

Recovery Manager:Release 11.2.0.3.0 - Production on Thu Dec 5 11:49:47 2013

Copyright (c)1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database (not started)

RMAN> startup nomount

Oracle instancestarted

Total SystemGlobal Area 1653518336 bytes

Fixed Size 2228904 bytes

VariableSize 973081944 bytes

DatabaseBuffers 671088640 bytes

Redo Buffers 7118848 bytes

RMAN> restore controlfile from '+DATA/orcl/controlfile/current.259.833372337';

Starting restore at 05-DEC-13

using target database control fileinstead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=14 devicetype=DISK

channel ORA_DISK_1: copied controlfile copy

output filename=+DATA/orcl/controlfile/current.259.833372337

output filename=+DATA/orcl/controlfile/current.261.833376309

output filename=+FRA/orcl/controlfile/current.256.833376309

Finishedrestore at 05-DEC-13

4. 打开数据库

RMAN> sql ' alter database mount';

sqlstatement: alter database mount

released channel:ORA_DISK_1

RMAN> sql 'alter database open';

sql statement: alter database open

5. 验证控制文件是否添加成功

SQL> select name from v$controlfile;

NAME

--------------------------------------------------------------------------------

+DATA/orcl/controlfile/current.259.833372337

+DATA/orcl/controlfile/current.261.833376309

+FRA/orcl/controlfile/current.256.833376309

6.

SQL> alter system set control_files='+DATA/orcl/controlfile/current.261.833376309','+DATA/orcl/controlfile/current.259.833372337','+FRA/orcl/controlfile/current.256.833376309' scope=spfile sid='*';

System altered.

7.

SQL> shutdown immediate

SQL> startup

SQL> select name, value fromV$PARAMETER where name like '%control%';

SQL> select * fromv$controlfile;

How to duplicate a controlfilewhen ASM is involved [ID 345180.1]