oracle之 RAC 11G ASM下控制文件多路复用

如果数据库仅有一组control file文件,需要添加一组或者多组,保证一组文件损坏或者丢失导致数据库宕机。

-- 环境说明
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production

SQL> show parameter cluster;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cluster_database boolean TRUE
cluster_database_instances integer 2
cluster_interconnects string

0、记录现有控制文件路径

SQL>select name from v$controlfile;SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
+DATA/devdb/controlfile/current.260.936769367
+FLASH/devdb/controlfile/current.256.936769367

1、关闭两个节点

$ srvctl stop database -d devdb

2、在其中一个节点上启动rman

[[email protected] ~]$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Tue Dec 27 16:59:10 2016

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

connected to target database (not started)

3、将数据库启动到nomount状态下

RMAN> startup nomount;

Oracle instance started

Total System Global Area 4275781632 bytes

Fixed Size 2260088 bytes
Variable Size 989856648 bytes
Database Buffers 3271557120 bytes
Redo Buffers 12107776 bytes

4、采用restore拷贝一份controlfile到新路径

RMAN> restore controlfile to ‘+FLASH/devdb/controlfile/current.256.936769368‘ from ‘+DATA/devdb/controlfile/current.260.936769367‘;

Starting restore at 27-DEC-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=50 instance=orcl1 device type=DISK

channel ORA_DISK_1: copied control file copy
Finished restore at 27-DEC-16

说明:’+FLASH/devdb/controlfile/current.256.936769368’是拷贝的新的控制文件,
如果asm自动管理的,可能名字不会按照你的命名,需要确定下新的文件名字。

ASMCMD> pwd
+FLASH/devdb/controlfile/
ASMCMD> ls
current.303.956019293 > 跟你指定的不一样

5. sqlplus 中 修改控制文件路径, 修改完成后,关闭数据库
SQL> alter system set control_files=‘+DATA/devdb/controlfile/current.260.936769367‘,‘+FLASH/devdb/controlfile/current.256.936769367‘,‘+FLASH/devdb/controlfile/current.303.956019293‘ scope=spfile sid=‘*‘;

SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.

6、启动数据库

[[email protected] oracle]$ srvctl start database -d devdb

7、验证

SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
+DATA/devdb/controlfile/current.260.936769367
+FLASH/devdb/controlfile/current.256.936769367
+FLASH/devdb/controlfile/current.303.956019293

时间: 2024-08-29 11:44:16

oracle之 RAC 11G ASM下控制文件多路复用的相关文章

如何获取 oracle RAC 11g asm spfile 的位置

 方法一: [[email protected] ~]# su - grid [[email protected] ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 3 09:36:27 2014 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise

Oracle Study之案例--重建数据库控制文件

Oracle Study之案例--重建数据库控制文件 系统环境: 操作系统: Linux RH6 数据库:   Oracle 11gR2    案例分析:           数据库中所有的控制文件被意外破坏,非归档的库,在有trace备份的情况下,重建控制文件. 1.控制文件trace脚本 [[email protected] ~]$ cat crctr.sql  CREATE CONTROLFILE REUSE DATABASE "TEST3" NORESETLOGS  NOARC

【翻译自mos文章】尽管指定了目的地,asmcmd cp命令还是在 +DATA/ASM 下创建文件

尽管指定了目的地,asmcmd cp命令还是在  +DATA/ASM 下创建文件 参考原文: ASMCMD Cp Creates Files In +DATA/ASM Instead Of Destination Specified (Doc ID 1488934.1) 适用于: Oracle Database - Enterprise Edition - Version 11.2.0.3 and later Information in this document applies to any

【翻译自mos文章】虽然指定了目的地,asmcmd cp命令还是在 +DATA/ASM 下创建文件

虽然指定了目的地.asmcmd cp命令还是在  +DATA/ASM 下创建文件 參考原文: ASMCMD Cp Creates Files In +DATA/ASM Instead Of Destination Specified (Doc ID 1488934.1) 适用于: Oracle Database - Enterprise Edition - Version 11.2.0.3 and later Information in this document applies to any

oracle 控制文件多路复用

网上有很多关于控制文件的操作,我大概看了下.有很多都是炒来炒去转来转去.下面以自己理解和操作为例来对oracle的控制文件进行下介绍. 首先介绍下控制文件 在oralce数据库中,控制文件是一个很小的二进制文件,一般大小在10MB左右在数据库创建时被自动创建,并在数据库变化时更新.控制文件不断被更新,并且在任何时候都要保证控制文件可用.控制文件在oracle中扮演者很重要的角色,没有控制文件或者控制文件损坏数据库必然down掉.控制文件包含有数据库结构信息,数据文件和日志文件信息. 由于控制文件

Oracle控制文件多路复用

一.控制文件多路复用 1.show parameter control --查看控制文件信息 show parameter spfile --查看是否有spfile create pfile from spfile; --生成pfile shutdown immediate --关库 2.修改pfile文件,添加多个路径 vi $ORACLE_HOME/dbs/initORCL.ora 将原有controlfile拷贝到新添加路径目录: cp -- 3.create spfile from pf

ORACLE RAC 11G 更改 /etc/hosts文件

来自官方文档:(1)Can I change the public hostname in my Oracle Database 10g Cluster using Oracle Clusterware? Hostname changes are not supported in Oracle Clusterware (CRS), unless you want to perform a deletenode followed by a new addnode operation. The ho

RAC环境下控制文件损坏重建过程

处理过程参考了: https://blogs.oracle.com/Database4CN/entry/%E5%A6%82%E4%BD%95%E9%87%8D%E5%BB%BArac%E7%9A%84%E6%8E%A7%E5%88%B6%E6%96%87%E4%BB%B6 问题现象: 现场有学校提报 登录PL/SQL连接数据库是报错“ORA-12541: TNS:无监听程序 ”:排查日志,发现 Tue Nov 25 14:46:58 2014 Thread 2 advanced to log s

如何获得 oracle RAC 11g asm spfile S档

 方法一: [[email protected] ~]# su - grid [[email protected] ~]$ sqlplus / as sysasm SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 3 09:36:27 2014 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise