---
title: "ASM中怎样冗余控制文件"
author: "libin123"
date: "2010-07-14T17:36:00Z"
tags: []
categories: ["数据库"]
slug: "asm"
draft: false
lastmod: "2010-07-14T17:41:56Z"
id: 712751
url: "https://dbua.iteye.com/blog/712751"
---

**1.查看当前系统的控制文件信息**

\[oracle@rac02 dbs]$ exit  
exit

SQL&gt; show parameter control\_files

NAME                                 TYPE        VALUE  
\------------------------------------ ----------- ------------------------------  
control\_files                        string      +DISKGRP1/orac/controlfile/bac  
                                                 kup.257.719218371

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production  
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

**2.用RAMN复制控制文件到新的地方**  
\[oracle@rac02 dbs]$ rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Sun Jul 4 05:00:02 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: ORAC (DBID=986088201, not open)

RMAN&gt; shutdown immediate;

database dismounted  
Oracle instance shut down

RMAN&gt; startup nomount;

connected to target database (not started)  
Oracle instance started

Total System Global Area     167772160 bytes

Fixed Size                     1218316 bytes  
Variable Size                 88082676 bytes  
Database Buffers              75497472 bytes  
Redo Buffers                   2973696 bytes

RMAN&gt;  restore controlfile to '+FLS' from '+DISKGRP1/orac/controlfile/backup.257.719218371';

Starting restore at 04-JUL-10  
allocated channel: ORA\_DISK\_1  
channel ORA\_DISK\_1: sid=150 instance=ORAC2 devtype=DISK  
allocated channel: ORA\_DISK\_2  
channel ORA\_DISK\_2: sid=149 instance=ORAC2 devtype=DISK

channel ORA\_DISK\_2: skipped, autobackup already found  
channel ORA\_DISK\_1: copied control file copy  
Finished restore at 04-JUL-10

RMAN&gt; RMAN&gt; exit

Recovery Manager complete.

**3.查找新控制文件的位置**  
\[oracle@rac02 dbs]$ export ORACLE\_SID=+ASM2  
\[oracle@rac02 dbs]$ asmcmd  
ASMCMD&gt; find -t controlfile . *  
+DISKGRP1/orac/CONTROLFILE/backup.257.719218371  
+FLS/ORAC/CONTROLFILE/backup.273.723445753  
ASMCMD&gt; exit

**4.修改控制文件参数**  
\[oracle@rac02 dbs]$ export ORACLE\_SID=ORAC2  
\[oracle@rac02 dbs]$ sqlplus / as sysdba

SQL\*Plus: Release 10.2.0.1.0 - Production on Sun Jul 4 05:13:58 2010

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

Connected to:  
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production  
With the Partitioning, Real Application Clusters, OLAP and Data Mining options  
SQL&gt; show parameter control\_files;

NAME                                 TYPE        VALUE  
\------------------------------------ ----------- ------------------------------  
control\_files                        string      +DISKGRP1/orac/controlfile/bac  
                                                 kup.257.719218371  
SQL&gt; alter system set control\_files='+DISKGRP1/orac/controlfile/backup.257.719218371',  
'+FLS/ORAC/CONTROLFILE/backup.273.723445753' scope=spfile;

System altered.

SQL&gt; shutdown immediate;  
ORA-01507: database not mounted

ORACLE instance shut down.

**5.从新启动数据库**  
SQL&gt; startup;  
ORACLE instance started.

Total System Global Area  167772160 bytes  
Fixed Size                  1218316 bytes  
Variable Size              88082676 bytes  
Database Buffers           75497472 bytes  
Redo Buffers                2973696 bytes  
Database mounted.  
Database opened.  
SQL&gt;  select * from v$controlfile;  
/  
STATUS  NAME  
\------- ------------------------------------------------------------------------  
        +DISKGRP1/orac/controlfile/backup.257.719218371  
        +FLS/orac/controlfile/backup.273.723445753

SQL&gt;  show parameter control\_files;

NAME                                 TYPE        VALUE  
\------------------------------------ ----------- ------------------------------  
control\_files                        string      +DISKGRP1/orac/controlfile/bac  
                                                 kup.257.719218371, +FLS/orac/c  
                                                 ontrolfile/backup.273.72344575  
                                                 3