Oracle 更改归档文件到 ASM 磁盘
01, 配置磁盘路径
,nide1 节点[Oracle@node1~]$ su-grid
Password:
[grid@node1~]$ sqlplus/assysdba
SQL*Plus:Release11.2.0.4.0ProductiononMonMar1111:10:382019
Copyright (c) 1982, 2013, Oracle. All rights reserved.Connectedto:
OracleDatabase11gEnterpriseEditionRelease11.2.0.4.0-64bitProduction
WiththeRealApplicationClustersandAutomaticStorageManagementoptions
SQL>selectnamefromv$asm_diskgroup;
NAME
------------------------------
OCR_VOTE
ORADATA01
ORADATA02
SQL>alter diskgroup ORADATA01adddirectory'+ORADATA01/arch1';
Diskgroup altered.
,node2 节点[oracle@node2~]$ su-grid
Password:
[grid@node2~]$ sqlplus/assysdba
SQL*Plus:Release11.2.0.4.0ProductiononMonMar1111:10:382019
Copyright (c) 1982, 2013, Oracle. All rights reserved.Connectedto:
OracleDatabase11gEnterpriseEditionRelease11.2.0.4.0-64bitProduction
WiththeRealApplicationClustersandAutomaticStorageManagementoptions
SQL>selectnamefromv$asm_diskgroup;
NAME
------------------------------
OCR_VOTE
ORADATA01
ORADATA02
SQL>alter diskgroup ORADATA01adddirectory'+ORADATA01/arch2';
Diskgroup altered.
02, 设置归档地址
登入节点一: node1[grid@node1~]$ su-oracle
Password:
[oracle@node1~]$ sqlplus/assysdba
SQL*Plus:Release11.2.0.4.0ProductiononMonMar1111:09:482019
Copyright (c) 1982, 2013, Oracle. All rights reserved.Connectedto:
OracleDatabase11gEnterpriseEditionRelease11.2.0.4.0-64bitProduction
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,DataMiningandRealApplicationTestingoptions
SQL>selectinstance_namefromv$instance;
INSTANCE_NAME
----------------
oracle1
SQL>archive log list;
Databaselog modeNoArchiveMode
AutomaticarchivalDisabled
Archivedestination/oracle/App/oracle/product/11.2.0/db_1/dbs/arch
Oldestonline log sequence61
Currentlog sequence62
SQL>alter systemsetlog_archive_dest_1='LOCATION=+ORADATA01/arch1'scope=spfile sid='oracle1';
System altered.
SQL> alter system set log_archive_dest_1='LOCATION=+ORADATA01/arch2' scope=spfile sid='oracle2';
System altered.
03, 重启 node1,node2 节点并更改为归档模式node1:
SQL>shutdown immediate
Databaseclosed.
Databasedismounted.
ORACLE instance shut down.
SQL>startup mount
ORACLE instance started.
TotalSystemGlobalArea2505338880bytes
FixedSize2255832bytes
VariableSize738198568bytes
DatabaseBuffers1761607680bytes
RedoBuffers3276800bytes
Databasemounted.
SQL>alter database archivelog;
Databasealtered.
SQL>shutdown immediate;
ORA-01109:databasenotopen
Databasedismounted.
ORACLE instance shut down.
SQL> startup -- 启动ORACLE instance started.
TotalSystemGlobalArea2505338880bytes
FixedSize2255832bytes
VariableSize738198568bytes
DatabaseBuffers1761607680bytes
RedoBuffers3276800bytes
Databasemounted.
Databaseopened.
SQL>archive log list
Databaselog modeArchiveMode
AutomaticarchivalEnabled
Archivedestination+ORADATA01/arch1
Oldestonline log sequence61
Nextlog sequence to archive62
Currentlog sequence62
SQL> alter system switch logfile; --- 刷写日志
System altered.node2:
SQL>archive log list;
Databaselog modeNoArchiveMode
AutomaticarchivalDisabled
Archivedestination/oracle/App/oracle/product/11.2.0/db_1/dbs/arch
Oldestonline log sequence5
Currentlog sequence6
SQL>shutdown immediate
Databaseclosed.
Databasedismounted.
ORACLE instance shut down.
SQL>startup mount
ORACLE instance started.
TotalSystemGlobalArea2505338880bytes
FixedSize2255832bytes
VariableSize738198568bytes
DatabaseBuffers1761607680bytes
RedoBuffers3276800bytes
Databasemounted.
SQL>alter database archivelog;
Databasealtered.
SQL>shutdown immediate;
ORA-01109:databasenotopen
Databasedismounted.
ORACLE instance shut down.
SQL>startup
ORACLE instance started.
TotalSystemGlobalArea2505338880bytes
FixedSize2255832bytes
VariableSize738198568bytes
DatabaseBuffers1761607680bytes
RedoBuffers3276800bytes
Databasemounted.
Databaseopened.
SQL>archive log list
Databaselog modeArchiveMode
AutomaticarchivalEnabled
Archivedestination+ORADATA01/arch2
Oldestonline log sequence6
Nextlog sequence to archive7
Currentlog sequence7
SQL>alter systemswitchlogfile;
System altered.
04, 验证归档[oracle@node2~]$ su-grid
Password:
[grid@node2~]$ asmcmd
ASMCMD>ls
OCR_VOTE/
ORADATA01/
ORADATA02/
ASMCMD>cd ORADATA01
ASMCMD>ls
ORACLE/
arch1/
arch2/
ASMCMD>cd arch2
ASMCMD>ls
2_7_1002129034.dbf
ASMCMD>cd../
ASMCMD>cd arch1
ASMCMD>ls
1_62_1002129034.dbf
2_6_1002129034.dbf
ASMCMD>exit
发现已经有文档了
来源: http://www.linuxidc.com/Linux/2019-03/157581.htm