oracle rac启用归档模式

环境:

2个节点的RAC

数据库版本:12.1.0.2.0

目的:

启动归档日志,同时将归档日志存放到共享目录(我这里的是ASM磁盘组)

操作:

1、创建共享ASM磁盘组

C:\Users\Administrator>set ORACLE_HOME=E:\app\oraclehome\grid

C:\Users\Administrator>set ORACLE_SID=+ASM1

C:\Users\Administrator>asmcmd
ASMCMD> ls
DATA/
FRA/
OCR/
ASMCMD> cd fra
ASMCMD> pwd
+fra

ASMCMD> mkdir jiaxundb1
ASMCMD> mkdir jiaxundb2
ASMCMD> ls
jiaxundb1/
jiaxundb2/

2、查看目前数据库归档模式

C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on 星期三 8月 17 15:15:45 2016

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options

SQL> archive log list
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     89
Current log sequence           90
SQL>

3、设置归档格式以及归档目的地

SQL> alter system set log_archive_format='%t_%s_%r.arch' scope=spfile sid='*';

System altered.

SQL> alter system set log_archive_dest_1='location=+fra/arch/jiaxundb1' scope=spfile sid='jiaxundb1';

System altered.

SQL> alter system set log_archive_dest_1='location=+fra/arch/jiaxundb2' scope=spfile sid='jiaxundb2';

System altered.

4、关闭所有实例

C:\Users\Administrator>srvctl stop database -d jiaxundb

5、将实例1启动到Mount阶段,并设置数据库为归档模式

C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on 星期三 8月 17 15:27:20 2016

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

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 1677721600 bytes
Fixed Size                  3046368 bytes
Variable Size            1056965664 bytes
Database Buffers          603979776 bytes
Redo Buffers               13729792 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +FRA/arch/jiaxundb1
Oldest online log sequence     89
Next log sequence to archive   90
Current log sequence           90
SQL>

6、启动实例2,查看数据库归档模式是否正确

C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on 星期三 8月 17 15:35:30 2016

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options

SQL> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            +FRA/arch/jiaxundb2
Oldest online log sequence     76
Next log sequence to archive   77
Current log sequence           77
SQL>

7、切换日志组,验证日志是否被成功归档

SQL> alter system archive log current;

System altered.

ASMCMD> ls jiaxundb1
1_90_914678682.arch
1_91_914678682.arch
ASMCMD> ls jiaxundb2
2_77_914678682.arch
2_78_914678682.arch

 

OK,实例1和实例2已成功归档。

 

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

历史五千年

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值