当前位置:  数据库>oracle

Oracle Study之--Oracle RAC重建控制文件

    来源: 互联网  发布时间:2017-06-15

    本文导语: 系统环境:操作系统: AIX5.3 Cluster:  Oracle 10gR2 CRSOracle:  Oracle 10gR2 在RAC环境下重建控制文件和在单实例上类似,只是有些步骤需要注意:[oracle@aix211 ~]$cat mkln.sh  ln -s /dev/rsystem          /u01/app/oracle/oradata/prod/system01.dbf ln -s ...

系统环境:
操作系统: AIX5.3

Cluster:  Oracle 10gR2 CRS
Oracle:  Oracle 10gR2

在RAC环境下重建控制文件和在单实例上类似,只是有些步骤需要注意:
[oracle@aix211 ~]$cat mkln.sh 
ln -s /dev/rsystem          /u01/app/oracle/oradata/prod/system01.dbf
ln -s /dev/rsysaux          /u01/app/oracle/oradata/prod/sysaux01.dbf
ln -s /dev/rusers            /u01/app/oracle/oradata/prod/users01.dbf
ln -s /dev/rundotbs1        /u01/app/oracle/oradata/prod/undotbs01.dbf 
ln -s /dev/rundotbs2        /u01/app/oracle/oradata/prod/undotbs02.dbf
ln -s /dev/rtemp            /u01/app/oracle/oradata/prod/temp01.dbf
ln -s /dev/rcontrol1_1        /u01/app/oracle/oradata/prod/control01.ctl
ln -s /dev/rcontrol2_2        /u01/app/oracle/oradata/prod/control02.ctl
ln -s /dev/rcontrol3_3        /u01/app/oracle/oradata/prod/control03.ctl
ln -s /dev/rredo1_1          /u01/app/oracle/oradata/prod/log11.log
ln -s /dev/rredo1_2          /u01/app/oracle/oradata/prod/log12.log
ln -s /dev/rredo2_1          /u01/app/oracle/oradata/prod/log21.log
ln -s /dev/rredo2_2          /u01/app/oracle/oradata/prod/log22.log
ln -s /dev/rindex            /u01/app/oracle/oradata/prod/index01.dbf
ln -s /dev/rspfile          /u01/app/oracle/oradata/prod/spfile01
ln -s /dev/rexample          /u01/app/oracle/oradata/prod/example01.dbf

Database存储在在RAW上。

1、首先在一个节点备份controlfile

[oracle@aix201 ~]$sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 23 16:16:07 2015
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
 
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL> alter database backup controlfile to trace;
Database altered.

2、查看控制文件的trace备份(udump)
CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS  NOARCHIVELOG
    MAXLOGFILES 192
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 32
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/u01/app/oracle/oradata/prod/log11.log'  SIZE 50M,
  GROUP 2 '/u01/app/oracle/oradata/prod/log12.log'  SIZE 50M,
  GROUP 3 '/u01/app/oracle/oradata/prod/log21.log'  SIZE 50M,
  GROUP 4 '/u01/app/oracle/oradata/prod/log22.log'  SIZE 50M
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/prod/system01.dbf',
  '/u01/app/oracle/oradata/prod/undotbs01.dbf',
  '/u01/app/oracle/oradata/prod/sysaux01.dbf',
  '/u01/app/oracle/oradata/prod/users01.dbf',
  '/u01/app/oracle/oradata/prod/example01.dbf',
  '/u01/app/oracle/oradata/prod/undotbs02.dbf'
CHARACTER SET ZHS16GBK
;

3、关闭database,启动其中一个instance到弄mount
SQL> startup nomount;
ORACLE instance started.
Total System Global Area  612368384 bytes
Fixed Size                  2022832 bytes
Variable Size            184549968 bytes
Database Buffers          423624704 bytes
Redo Buffers                2170880 bytes
 
SQL> @/home/oracle/cr_ctr.sql
CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS  NOARCHIVELOG
*
ERROR at line 1:
ORA-01503: CREATE CONTROLFILE failed
ORA-12720: operation requires database is in EXCLUSIVE mode
SQL> show parameter cluster
NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
cluster_database                    boolean    TRUE
cluster_database_instances          integer    2
cluster_interconnects                string
 
---创建失败,原因是在RAC下控制文件时处于共享(share)模式,需启动到独立(exclusive)模式,才能重建;修改cluster_database 为false,然后重建


重新建立控制文件:
SQL> alter system set cluster_database =false scope=spfile;
System altered.
SQL> startup nomount
ORACLE instance started.
Total System Global Area  612368384 bytes
Fixed Size                  2022832 bytes
Variable Size            184549968 bytes
Database Buffers          423624704 bytes
Redo Buffers                2170880 bytes
 
SQL> show parameter cluster
NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
cluster_database                    boolean    FALSE
cluster_database_instances          integer    1
cluster_interconnects                string
 
SQL> @/home/oracle/cr_ctr.sql
Control file created.
 
告警日志:
alter.log:
Mon Mar 23 16:41:00 2015
CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS  NOARCHIVELOG
    MAXLOGFILES 192
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 32
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/u01/app/oracle/oradata/prod/log11.log'  SIZE 50M,
  GROUP 2 '/u01/app/oracle/oradata/prod/log12.log'  SIZE 50M,
  GROUP 3 '/u01/app/oracle/oradata/prod/log21.log'  SIZE 50M,
  GROUP 4 '/u01/app/oracle/oradata/prod/log22.log'  SIZE 50M
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/prod/system01.dbf',
  '/u01/app/oracle/oradata/prod/undotbs01.dbf',
  '/u01/app/oracle/oradata/prod/sysaux01.dbf',
  '/u01/app/oracle/oradata/prod/users01.dbf',
  '/u01/app/oracle/oradata/prod/example01.dbf',
  '/u01/app/oracle/oradata/prod/undotbs02.dbf'
CHARACTER SET ZHS16GBK
Mon Mar 23 16:41:00 2015
WARNING: Default Temporary Tablespace not specified in CREATE DATABASE command
Default Temporary Tablespace will be necessary for a locally managed database in future release
WARNING: You are creating/reusing datafile /u01/app/oracle/oradata/prod/control01.ctl.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. The command "/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs" can be used. Please contact Oracle customer support for more details.
WARNING: You are creating/reusing datafile /u01/app/oracle/oradata/prod/control01.ctl.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. The command "/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs" can be used. Please contact Oracle customer support for more details.
WARNING: You are creating/reusing datafile /u01/app/oracle/oradata/prod/control02.ctl.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. The command "/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs" can be used. Please contact Oracle customer support for more details.
WARNING: You are creating/reusing datafile /u01/app/oracle/oradata/prod/control02.ctl.
WARNING: Oracle recommends creating new datafiles on devices with zero offset. The command "/usr/sbin/mklv -y LVname -T O -w n -s n -r n VGname NumPPs" can be used. Please contact Oracle customer support for more details.
Setting recovery target incarnation to 1
Mon Mar 23 16:41:05 2015
Successful mount of redo thread 1, with mount id 286981148
Mon Mar 23 16:41:05 2015
Completed: CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS  NOARCHIVELOG
    MAXLOGFILES 192
    MAXLOGMEMBERS 3
    MAXDATAFILES 1024
    MAXINSTANCES 32
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/u01/app/oracle/oradata/prod/log11.log'  SIZE 50M,
  GROUP 2 '/u01/app/oracle/oradata/prod/log12.log'  SIZE 50M,
  GROUP 3 '/u01/app/oracle/oradata/prod/log21.log'  SIZE 50M,
  GROUP 4 '/u01/app/oracle/oradata/prod/log22.log'  SIZE 50M
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/prod/system01.dbf',
  '/u01/app/oracle/oradata/prod/undotbs01.dbf',
  '/u01/app/oracle/oradata/prod/sysaux01.dbf',
  '/u01/app/oracle/oradata/prod/users01.dbf',
  '/u01/app/oracle/oradata/prod/example01.dbf',
  '/u01/app/oracle/oradata/prod/undotbs02.dbf'
CHARACTER SET ZHS16GBK

4、重建成功,启动到open
SQL> select status from v$instance;
STATUS
------------
MOUNTED
 
SQL> alter database open;
Database altered.
 
添加临时表空间数据文件:
SQL> select name from v$tempfile;
no rows selected
 
SQL> select tablespace_name from dba_tablespaces;
TABLESPACE_NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
TEMP
USERS
UNDOTBS2
EXAMPLE
7 rows selected.
 
SQL> alter tablespace temp add 
  2  tempfile '/u01/app/oracle/oradata/prod/temp01.dbf' size 100m reuse;
Tablespace altered.
SQL>  select name from v$tempfile;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/prod/temp01.dbf

5、修改cluster_database参数,启动所有instance
SQL> alter system set cluster_database =true scope=spfile;
System altered.

启动所有Instance,如果所有instance启动成功,则controlfile重建成功。


    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • Oracle 12c发布简单介绍及官方下载地址
  • 在linux下安装oracle,如何设置让oracle自动启动!也就是让oracle那个服务自动启动,不是手动的
  • oracle 11g最新版官方下载地址
  • 请问su oracle 和su - oracle有什么不同?
  • Oracle 数据库(oracle Database)Select 多表关联查询方式
  • 虚拟机装Oracle R12与Oracle10g
  • Oracle数据库(Oracle Database)体系结构及基本组成介绍
  • Oracle 数据库开发工具 Oracle SQL Developer
  • 如何设置让Oracle SQL Developer显示的时间包含时分秒
  • Oracle EBS R12 支持 Oracle Database 11g
  • Oracle 10g和Oracle 11g网格技术介绍
  • WEB前端 iis7站长之家
  • oracle中如何把表中具有相同值列的多行数据合并成一行
  • 请问大家用oracle数据库, 用import oracle.*;下的东西么? 还是用标准库?
  • Oracle 数据库(oracle Database)性能调优技术详解
  • Linux /$ORACLE_HOME $ORACLE_HOME
  • ORACLE日期相关操作
  • Linux系统下Oracle的启动与Oracle监听的启动
  • ORACLE数据库常用字段数据类型介绍
  • 请问在solaris下安装ORACLE,用root用户和用oracle用户安装有什么区别么?
  • Oracle 12c的九大最新技术特性介绍
  • 网间Oracle的连接,远程连接Oracle服务器??


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,,E-mail:www_#163.com(请将#改为@)

    浙ICP备11055608号-3