Installation Oracle11gR2 RAC---归档模式开启与关闭

RAC环境下归档模式修改从10G R2以后,不再修改cluster_database参数,参考链接How To Enable/Disable Archive Logging In RAC Environment for 10.2 and higher version。步骤如下所示:

1. The following steps need to be taken to enable archive logging in a RAC database environment:
-- shutdown immediate all database instances
$ srvctl stop database -d <db_unique_name>
-- startup database in mount mode
$ srvctl start database -d <db_unique_name> -o mount
-- enable archive logging
$ sqlplus / as sysdba
sql> alter database archivelog;
sql> exit;
-- stop database
$ srvctl stop database -d <db_unique_name>
-- restart all database instances
$ srvctl start database -d <db_unique_name>
-- verify archiving is enabled/disabled by means of:
sql> archive log list;

以上是开启RAC环境下归档模式步骤,非归档模式亦然。下面是SuSE11SP3 11gR2RAC环境演示。

1、开启归档

(1)、关闭所有数据库实例

[email protected]:~> srvctl stop database -d ORACLE

[email protected]:~> crsctl status res -t

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

NAME           TARGET  STATE        SERVER                   STATE_DETAILS

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

Local Resources

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

ora.DATA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.FRA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.LISTENER.lsnr

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.OCR.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.asm

ONLINE  ONLINE       jason1                   Started

ONLINE  ONLINE       jason2                   Started

ora.gsd

OFFLINE OFFLINE      jason1

OFFLINE OFFLINE      jason2

ora.net1.network

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.ons

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.registry.acfs

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

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

Cluster Resources

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

ora.LISTENER_SCAN1.lsnr

1        ONLINE  ONLINE       jason2

ora.cvu

1        ONLINE  ONLINE       jason1

ora.jason1.vip

1        ONLINE  ONLINE       jason1

ora.jason2.vip

1        ONLINE  ONLINE       jason2

ora.oc4j

1        ONLINE  ONLINE       jason1

ora.oracle.db

      1        OFFLINE OFFLINE                               Instance Shutdown   

      2        OFFLINE OFFLINE                               Instance Shutdown

ora.scan1.vip

1        ONLINE  ONLINE       jason2

(2)、启动数据库实例到mount状态

[email protected]:~> srvctl start  database -d ORACLE -o mount

[email protected]:~> crsctl status res -t

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

NAME           TARGET  STATE        SERVER                   STATE_DETAILS

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

Local Resources

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

ora.DATA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.FRA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.LISTENER.lsnr

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.OCR.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.asm

ONLINE  ONLINE       jason1                   Started

ONLINE  ONLINE       jason2                   Started

ora.gsd

OFFLINE OFFLINE      jason1

OFFLINE OFFLINE      jason2

ora.net1.network

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.ons

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.registry.acfs

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

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

Cluster Resources

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

ora.LISTENER_SCAN1.lsnr

1        ONLINE  ONLINE       jason2

ora.cvu

1        ONLINE  ONLINE       jason1

ora.jason1.vip

1        ONLINE  ONLINE       jason1

ora.jason2.vip

1        ONLINE  ONLINE       jason2

ora.oc4j

1        ONLINE  ONLINE       jason1

ora.oracle.db

      1        ONLINE  INTERMEDIATE jason1                   Mounted (Closed)    

      2        ONLINE  INTERMEDIATE jason2                   Mounted (Closed)  

ora.scan1.vip

1        ONLINE  ONLINE       jason2

[email protected]:~>

(3)、开启归档模式

[email protected]:~> sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Fri Jan 8 19:29:47 2016

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

SQL> conn /as sysdba

Connected.

SQL> archive log list;

Database log mode           No Archive Mode

Automatic archival             Disabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     8

Current log sequence           9

SQL> alter database archivelog;

Database altered.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

[email protected]:~>

(4)、再次关闭数据库实例

切换至grid用户

[email protected]:~> srvctl stop database -d ORACLE

[email protected]:~> crsctl status res -t

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

NAME           TARGET  STATE        SERVER                   STATE_DETAILS

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

Local Resources

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

ora.DATA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.FRA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.LISTENER.lsnr

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.OCR.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.asm

ONLINE  ONLINE       jason1                   Started

ONLINE  ONLINE       jason2                   Started

ora.gsd

OFFLINE OFFLINE      jason1

OFFLINE OFFLINE      jason2

ora.net1.network

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.ons

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.registry.acfs

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

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

Cluster Resources

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

ora.LISTENER_SCAN1.lsnr

1        ONLINE  ONLINE       jason2

ora.cvu

1        ONLINE  ONLINE       jason1

ora.jason1.vip

1        ONLINE  ONLINE       jason1

ora.jason2.vip

1        ONLINE  ONLINE       jason2

ora.oc4j

1        ONLINE  ONLINE       jason1

ora.oracle.db

      1        OFFLINE OFFLINE                               Instance Shutdown   

      2        OFFLINE OFFLINE                               Instance Shutdown

ora.scan1.vip

1        ONLINE  ONLINE       jason2

(5)、启动数据库实例    

[email protected]:~> srvctl start  database -d ORACLE

[email protected]:~> crsctl status res -t

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

NAME           TARGET  STATE        SERVER                   STATE_DETAILS

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

Local Resources

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

ora.DATA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.FRA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.LISTENER.lsnr

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.OCR.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.asm

ONLINE  ONLINE       jason1                   Started

ONLINE  ONLINE       jason2                   Started

ora.gsd

OFFLINE OFFLINE      jason1

OFFLINE OFFLINE      jason2

ora.net1.network

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.ons

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.registry.acfs

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

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

Cluster Resources

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

ora.LISTENER_SCAN1.lsnr

1        ONLINE  ONLINE       jason2

ora.cvu

1        ONLINE  ONLINE       jason1

ora.jason1.vip

1        ONLINE  ONLINE       jason1

ora.jason2.vip

1        ONLINE  ONLINE       jason2

ora.oc4j

1        ONLINE  ONLINE       jason1

ora.oracle.db

      1        ONLINE  ONLINE       jason1                   Open                

      2        ONLINE  ONLINE       jason2                   Open

ora.scan1.vip

1        ONLINE  ONLINE       jason2

[email protected]:~>

(6)、效验数据库归档模式

[email protected]:~> sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Fri Jan 8 19:40:57 2016

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

SQL> conn /as sysdba

Connected.

SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     8

Next log sequence to archive   9

Current log sequence           9

SQL>

2、关闭归档

(1)、关闭所有数据库实例

[email protected]:~> srvctl stop database -d ORACLE

[email protected]:~> crsctl status res -t

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

NAME           TARGET  STATE        SERVER                   STATE_DETAILS

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

Local Resources

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

ora.DATA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.FRA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.LISTENER.lsnr

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.OCR.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.asm

ONLINE  ONLINE       jason1                   Started

ONLINE  ONLINE       jason2                   Started

ora.gsd

OFFLINE OFFLINE      jason1

OFFLINE OFFLINE      jason2

ora.net1.network

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.ons

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.registry.acfs

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

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

Cluster Resources

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

ora.LISTENER_SCAN1.lsnr

1        ONLINE  ONLINE       jason2

ora.cvu

1        ONLINE  ONLINE       jason1

ora.jason1.vip

1        ONLINE  ONLINE       jason1

ora.jason2.vip

1        ONLINE  ONLINE       jason2

ora.oc4j

1        ONLINE  ONLINE       jason1

ora.oracle.db

      1        OFFLINE OFFLINE                               Instance Shutdown   

      2        OFFLINE OFFLINE                               Instance Shutdown   

ora.scan1.vip

1        ONLINE  ONLINE       jason2

(2)、启动数据库到mount状态

[email protected]:~>  srvctl start database -d ORACLE -o mount

[email protected]:~> crsctl status res -t

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

NAME           TARGET  STATE        SERVER                   STATE_DETAILS

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

Local Resources

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

ora.DATA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.FRA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.LISTENER.lsnr

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.OCR.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.asm

ONLINE  ONLINE       jason1                   Started

ONLINE  ONLINE       jason2                   Started

ora.gsd

OFFLINE OFFLINE      jason1

OFFLINE OFFLINE      jason2

ora.net1.network

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.ons

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.registry.acfs

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

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

Cluster Resources

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

ora.LISTENER_SCAN1.lsnr

1        ONLINE  ONLINE       jason2

ora.cvu

1        ONLINE  ONLINE       jason1

ora.jason1.vip

1        ONLINE  ONLINE       jason1

ora.jason2.vip

1        ONLINE  ONLINE       jason2

ora.oc4j

1        ONLINE  ONLINE       jason1

ora.oracle.db

      1        ONLINE  INTERMEDIATE jason1                   Mounted (Closed)    

      2        ONLINE  INTERMEDIATE jason2                   Mounted (Closed)

ora.scan1.vip

1        ONLINE  ONLINE       jason2

[email protected]:~>

(3)、设置数据库为非归档模式

切换到oracle用户

[email protected]:~> sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Fri Jan 8 19:24:08 2016

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

SQL> conn /as sysdba

Connected.

SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     6

Next log sequence to archive   7

Current log sequence           7

SQL> alter database noarchivelog;

Database altered.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,

Data Mining and Real Application Testing options

[email protected]:~>

(4)、关闭所有数据库实例

切换到grid用户查看状态

[email protected]:~> srvctl stop database -d ORACLE

[email protected]:~> crsctl status res -t

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

NAME           TARGET  STATE        SERVER                   STATE_DETAILS

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

Local Resources

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

ora.DATA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.FRA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.LISTENER.lsnr

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.OCR.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.asm

ONLINE  ONLINE       jason1                   Started

ONLINE  ONLINE       jason2                   Started

ora.gsd

OFFLINE OFFLINE      jason1

OFFLINE OFFLINE      jason2

ora.net1.network

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.ons

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.registry.acfs

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

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

Cluster Resources

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

ora.LISTENER_SCAN1.lsnr

1        ONLINE  ONLINE       jason2

ora.cvu

1        ONLINE  ONLINE       jason1

ora.jason1.vip

1        ONLINE  ONLINE       jason1

ora.jason2.vip

1        ONLINE  ONLINE       jason2

ora.oc4j

1        ONLINE  ONLINE       jason1

ora.oracle.db

1        OFFLINE OFFLINE                               Instance Shutdown

2        OFFLINE OFFLINE                               Instance Shutdown

ora.scan1.vip

1        ONLINE  ONLINE       jason2

[email protected]:~>

(5)、再次打开数据库实例

[email protected]:~> srvctl start database -d ORACLE

[email protected]:~> crsctl status res -t

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

NAME           TARGET  STATE        SERVER                   STATE_DETAILS

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

Local Resources

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

ora.DATA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.FRA.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.LISTENER.lsnr

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.OCR.dg

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.asm

ONLINE  ONLINE       jason1                   Started

ONLINE  ONLINE       jason2                   Started

ora.gsd

OFFLINE OFFLINE      jason1

OFFLINE OFFLINE      jason2

ora.net1.network

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.ons

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

ora.registry.acfs

ONLINE  ONLINE       jason1

ONLINE  ONLINE       jason2

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

Cluster Resources

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

ora.LISTENER_SCAN1.lsnr

1        ONLINE  ONLINE       jason2

ora.cvu

1        ONLINE  ONLINE       jason1

ora.jason1.vip

1        ONLINE  ONLINE       jason1

ora.jason2.vip

1        ONLINE  ONLINE       jason2

ora.oc4j

1        ONLINE  ONLINE       jason1

ora.oracle.db

      1        ONLINE  ONLINE       jason1                   Open                

      2        ONLINE  ONLINE       jason2                   Open

ora.scan1.vip

1        ONLINE  ONLINE       jason2

[email protected]:~>

(6)、效验归档模式

[email protected]:~> sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Fri Jan 8 19:29:47 2016

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

SQL> conn /as sysdba

Connected.

SQL> archive log list;

Database log mode              No Archive Mode

Automatic archival             Disabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     8

Current log sequence           9

SQL>

备注:本实验中,数据库归档地址使用默认地址,如需要更换可以通过修改对应日志参数实现。

时间: 2024-12-24 14:23:34

Installation Oracle11gR2 RAC---归档模式开启与关闭的相关文章

oracle归档的开启及关闭

查看归档状态:archive log list; 1:开启 shutdown immediate; startup mount; alter database archivelog; alter database open; 2:关闭 shutdown immediate; startup mount; alter database noarchivelog; alter database open;

Windows vista/7休眠模式开启和关闭

Windows的休眠功能:将桌面以及所有打开的文件保存一份映像存在系统盘里(故开启此功能后系统盘的大小会大大增加,台式机不建议打开此功能!).开机后会原封不动的打开,这样开机的速度会大大提高. 1.打开命令提示符(CMD.exe) 2.开启休眠模式: powercfg.exe /hibernate on 关闭休眠模式,并删除映像: powercfg.exe /hibernate off !安装了还原精灵之类的保护软件是无法开启休眠模式的 复制去Google翻译翻译结果

Installation Oracle11gR2 RAC One Node on SuSE Linux Enterprise Server 11SP2 ( 一 )

1.部署环境 操作系统:SuSE Linux Enterprise Server 11SP2 数据库:Oracle 11gR2(112040) 共享存储: 设备名 大小 /dev/sdb 2g /dev/sdc 10g /dev/sdd 20g 2. 创建账户 groupadd -g 1000 oinstall    groupadd -g 1200 asmadmin   groupadd -g 1201 asmdba    groupadd -g 1202 asmoper    useradd

Oracle启动或关闭归档模式

在Oracle安装后,默认归档模式开启,大量的日志会瞬间填满磁盘,所以在开发环境,经常需要关闭归档模式. 1.管理员身份连接数据库 $sqlplus user/passwd@dbname as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Tue Jun 17 23:50:55 2014 Copyright (c) 1982, 2010, Oracle.  All rights reserved. Connected to: Oracle D

将Oracle数据库设置为归档模式及非归档模式

一.将Oracle数据库设置为归档模式 1)sql>shutdown normal/immediate;2)sql>startup mount;3)sql>alter database archivelog;4)sql>alter database open;5)archive log list; 注意:show parameter log_archive_dest查看归档日志的存放位置. 二.将Oracle数据库设置为非归档模式1).关闭数据库 shutdown immediat

Oracle归档模式和非归档模式

一 什么是Oracle归档模式? Oracle数据库有联机重做日志,这个日志是记录对数据库所做的修改,比如插入,删除,更新数据等,对这些操作都会记录在联机重做日志里.一般数据库至少要有2个联机重做日志组.当一个联机重做日志组被写满的时候,就会发生日志切换,这时联机重做日志组2成为当前使用的日志,当联机重做日志组2写满的时候,又会发生日志切换,去写联机重做日志组1,就这样反复进行. 如果数据库处于非归档模式,联机日志在切换时就会丢弃. 而在归档模式下,当发生日志切换的时候,被切换的日志会进行归档.

oracle开启/关闭归档模式

1.改变非归档模式到归档模式: 1)SQL> conn / as sysdba (以DBA身份连接数据库) 2)SQL> shutdown immediate;(立即关闭数据库) 3)SQL> startup mount (启动实例并加载数据库,但不打开) 4)SQL> alter database archivelog; (更改数据库为归档模式) 5)SQL> alter database open; (打开数据库) 6)SQL> alter system archi

如何在oracle rac环境中开启归档

oracle rac 归档设置需要不像单实例设置简单,开启过程需要注意一些细节 归档开启思路: 1:查看数据库是否开启归档 2:创建共享目录(归档一定要放在共享存储上) 3:将rac设置成单实例模式 4:分别关闭各个节点实例 5:将其中一个节点启动到mount状态,开启归档,设置归档路径,格式,并打开数据库还原rac模式 6: 打开所有节点数据库 7:查看数据库归档参数设置是否生效 8:切换归档,查看归档是否正常工作 1.查询归档当前信息 SQL> show parameter recovery

RAC 环境下修改归档模式

RAC环境下的归档模式切换与单实例稍有不同,主要是共享存储所产生的差异.在这种情况下,我们可以将RAC数据库切换到非集群状态下,仅仅在一个实例上来实施归档模式切换即可完成RAC数据库的归档模式转换问题.本文主要描述了由非归档模式切换到归档模式,而由非归档切换的归档步骤相同,不再赘述. [sql] view plain copy print? 1.主要步骤: 备份spfile,以防止参数修改失败导致数据库无法启动 修改集群参数cluster_database为false 启动单实例到mount状态