Oracle 更改归档文件到ASM磁盘

前端之家收集整理的这篇文章主要介绍了Oracle 更改归档文件到ASM磁盘前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

01,配置磁盘路径

  ??,nide1节点

[[email protected] ~]$ su - grid 
Password:
[[email protected] ~]$ sqlplus / as sysdba
sql*Plus: Release 11.2.0.4.0 Production on Mon Mar 11 11:10:38 2019
Copyright (c) 1982,2013,Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

sql> select name from v$asm_diskgroup; NAME ------------------------------ OCR_VOTE ORADATA01 ORADATA02 sql> alter diskgroup ORADATA01 add directory +ORADATA01/arch1; Diskgroup altered.

  ??,node2节点

[[email protected] ~]$ su - grid
Password:
[[email protected] ~]$ sqlplus / as sysdba

sql*Plus: Release 11.2.0.4.0 Production on Mon Mar 11 11:10:38 2019

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Real Application Clusters and Automatic Storage Management options

sql> select name from v$asm_diskgroup;

NAME
------------------------------
OCR_VOTE
ORADATA01
ORADATA02

sql> alter diskgroup ORADATA01 add directory +ORADATA01/arch2;

Diskgroup altered.

02,设置归档地址

  登入节点一:node1

[[email protected] ~]$ su - oracle
Password:
[[email protected] ~]$ sqlplus / as sysdba

sql*Plus: Release 11.2.0.4.0 Production on Mon Mar 11 11:09:48 2019

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


Connected to:
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

sql> select instance_name from v$instance;

INSTANCE_NAME
----------------
oracle1

sql> archive log list;
Database log mode           No Archive Mode
Automatic archival           Disabled
Archive destination           /oracle/app/oracle/product/11.2.0/db_1/dbs/arch
Oldest online log sequence     61
Current log sequence           62
sql> alter system set log_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
Database closed.
Database dismounted.
ORACLE instance shut down.
sql> startup mount
ORACLE instance started.

Total System Global Area 2505338880 bytes
Fixed Size            2255832 bytes
Variable Size          738198568 bytes
Database Buffers     1761607680 bytes
Redo Buffers            3276800 bytes
Database mounted.
sql> alter database archivelog;

Database altered.

sql> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
sql> startup   -- 启动
ORACLE instance started.

Total System Global Area 2505338880 bytes
Fixed Size            2255832 bytes
Variable Size          738198568 bytes
Database Buffers     1761607680 bytes
Redo Buffers            3276800 bytes
Database mounted.
Database opened.
sql> archive log list
Database log mode           Archive Mode
Automatic archival           Enabled
Archive destination           +ORADATA01/arch1
Oldest online log sequence     61
Next log sequence to archive   62
Current log sequence           62
sql> alter system switch logfile;  --- 刷写日志
 
System altered.

  node2:

sql> archive log list;
Database log mode           No Archive Mode
Automatic archival           Disabled
Archive destination           /oracle/app/oracle/product/11.2.0/db_1/dbs/arch
Oldest online log sequence     5
Current log sequence           6
sql> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
sql> startup mount
ORACLE instance started.

Total System Global Area 2505338880 bytes
Fixed Size            2255832 bytes
Variable Size          738198568 bytes
Database Buffers     1761607680 bytes
Redo Buffers            3276800 bytes
Database mounted.
sql> alter database archivelog;

Database altered.

sql> shutdown immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
sql> startup
ORACLE instance started.

Total System Global Area 2505338880 bytes
Fixed Size            2255832 bytes
Variable Size          738198568 bytes
Database Buffers     1761607680 bytes
Redo Buffers            3276800 bytes
Database mounted.
Database opened.
sql> archive log list
Database log mode           Archive Mode
Automatic archival           Enabled
Archive destination           +ORADATA01/arch2
Oldest online log sequence     6
Next log sequence to archive   7
Current log sequence           7
sql> alter system switch logfile;

System altered.

04,验证归档

[[email protected] ~]$ su - grid
Password:
[[email protected] ~]$ 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

发现已经有文档了

猜你在找的Oracle相关文章