oracle rac 归档设置需要不像单实例设置简单,开启过程需要注意一些细节
归档开启思路:
1:查看数据库是否开启归档
2:创建共享目录(归档一定要放在共享存储上)
3:将rac设置成单实例模式
4:分别关闭各个节点实例
5:将其中一个节点启动到mount状态,开启归档,设置归档路径,格式,并打开数据库还原rac模式
6: 打开所有节点数据库
7:查看数据库归档参数设置是否生效
8:切换归档,查看归档是否正常工作
1、查询归档当前信息
sql>showparameterrecovery NAMETYPEVALUE ----------------------------------------------------------------------------- db_recovery_file_deststring db_recovery_file_dest_sizebiginteger0 recovery_parallelisminteger0
2、查询是否开户归档日志
sql>archiveloglist DatabaselogmodeArchiveMode AutomaticarchivalEnabled Archivedestination/oracle/app/oracle/product/11.2.0/db_1/dbs/arch Oldestonlinelogsequence35 Nextlogsequencetoarchive36 Currentlogsequence36
说明:从当前查询是已开始归档模式了,但是规定路径不对要重新修改
3、查询集群参数
sql>showparametercluster NAMETYPEVALUE ----------------------------------------------------------------------------- cluster_databasebooleanTRUE cluster_database_instancesinteger2 cluster_interconnectsstring
sql>shutdownimmediate Databaseclosed. Databasedismounted. ORACLEinstanceshutdown.
5、在当前正常节点修改集群为单节点模式
sql>altersystemsetcluster_database=falsescope=spfile; Systemaltered.
6、配置闪回大小
sql>altersystemsetdb_recovery_file_dest_size=2Gscope=both; Systemaltered.
7、配置归档日志路径,配置在DG中
sql>altersystemsetdb_recovery_file_dest='+DGRECOVERY'scope=both; Systemaltered.
sql>shutdownimmediate Databaseclosed. Databasedismounted. ORACLEinstanceshutdown.
sql>startupmount ORACLEinstancestarted. TotalSystemGlobalArea784998400bytes FixedSize2257352bytes VariableSize331353656bytes DatabaseBuffers448790528bytes RedoBuffers2596864bytes Databasemounted.
sql>selectstatusfromv$instance 2; STATUS ------------ MOUNTED
sql>alterdatabasearchivelog; Databasealtered.
12.恢复数据库双节点实例
sql>altersystemsetcluster_database=truescope=spfile; Systemaltered.
13.打开数据库
sql>alterdatabaSEOpen; Databasealtered.
sql>selectstatusfromv$instance; STATUS ------------ OPEN
sql>showparametercluster NAMETYPEVALUE ----------------------------------------------------------------------------- cluster_databasebooleanTRUE cluster_database_instancesinteger2 cluster_interconnectsstring
16、再启动另外一个节点
startup
17、切换归档日志,判断是否切换成功
sql>altersystemswitchlogfile; Systemaltered.
18、查询归档中数据
ASMCMD>pwd +DGRECOVERY/RAC/ARCHIVELOG/2017_06_13 ASMCMD>ls thread_1_seq_37.256.946542069 thread_1_seq_38.257.946542129 thread_1_seq_39.258.946542133 thread_1_seq_40.260.946542135 thread_1_seq_41.261.946543367 thread_1_seq_42.262.946543369 thread_1_seq_43.264.946543373 thread_1_seq_44.265.946543375 thread_1_seq_45.266.946543377 thread_1_seq_46.267.946543377 thread_1_seq_47.269.946544929 thread_2_seq_4.259.946542029 thread_2_seq_5.263.946543265 thread_2_seq_6.268.946543277
通过以上则可以判断数据库可以正常归档
原文链接:https://www.f2er.com/oracle/208850.html