iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >Oracle Study之--Oracle RAC重建控制文件
  • 878
分享到

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

2024-04-02 19:04:59 878人浏览 独家记忆
摘要

Oracle Study之--Oracle RAC重建控制文件系统环境:操作系统: aiX5.3Cluster:  Oracle 10gR2 CRSOracle:   Oracle 10

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

系统环境:

操作系统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重建成功。


您可能感兴趣的文档:

--结束END--

本文标题: Oracle Study之--Oracle RAC重建控制文件

本文链接: https://www.lsjlt.com/news/47491.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • sql怎么查看表的索引
    通过查询系统表,可以获取表的索引信息,包括索引名称、是否唯一、索引类型、索引列和行数。常用系统表有:mysql 的 information_schema.statistics、postg...
    99+
    2024-05-14
    mysql oracle
  • sql怎么查看索引
    您可以使用 sql 通过以下方法查看索引:show indexes 语句:显示表中定义的索引列表及其信息。explain 语句:显示查询计划,其中包含用于执行查询的索引。informat...
    99+
    2024-05-14
  • sql怎么查看存储过程
    如何查看 sql 存储过程的源代码:使用 show create procedure 语句直接获取创建脚本。查询 information_schema.routines 表的 routi...
    99+
    2024-05-14
  • sql怎么查看视图表
    要查看视图表,可以使用以下步骤:使用 select 语句获取视图中的数据。使用 desc 语句查看视图的架构。使用 explain 语句分析视图的执行计划。使用 dbms 提供...
    99+
    2024-05-14
    oracle python
  • sql怎么查看创建的视图
    可以通过sql查询查看已创建的视图,具体步骤包括:连接到数据库并执行查询select * from information_schema.views;查询结果将显示视图的名称、...
    99+
    2024-05-14
    mysql
  • sql怎么用循环语句实现查询
    可以通过 do 和 while 语句创建循环,并在循环内执行查询,详细步骤包括:定义循环变量设置循环初始值循环执行查询更新循环变量执行查询循环退出条件 SQL 中使用循环语句实现查询 ...
    99+
    2024-05-14
  • sql怎么用代码修改表中数据
    通过 sql 代码修改表中数据的方法包括:修改单个记录:使用 update 语句设置列值并指定条件。修改多条记录:在 update 语句中指定多个条件来修改满足条件的所有记录。增加新列:...
    99+
    2024-05-14
  • sql怎么用命令创建数据库
    在 sql 中使用 create database 命令创建新数据库,其语法包含以下步骤:指定数据库名称。指定数据库文件和日志文件的位置(可选)。指定数据库大小、最大大小和文件增长(可选...
    99+
    2024-05-14
  • sql怎么用身份证提取年龄
    sql 中提取身份证号码中的年龄的方法:提取出生日期部分(身份证号码中第 7-14 位);使用 to_date 函数转换为日期格式;使用 extract 函数计算与当前日期之间的年差。 ...
    99+
    2024-05-14
  • sql怎么看字段长度
    有两种方法可查看 sql 中的字段长度:使用 information_schema 架构,其中包含元数据信息,可用于查询字段长度。使用内建函数,如 length(),其适用于字符串数据类...
    99+
    2024-05-14
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作