阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Oracle 更改归档文件到ASM磁盘

195次阅读
没有评论

共计 4225 个字符,预计需要花费 11 分钟才能阅读完成。

01, 配置磁盘路径

? ,nide1 节点

[Oracle@node1 ~]$ su – grid
Password:
[grid@node1 ~]$ 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 节点

[oracle@node2 ~]$ su – grid
Password:
[grid@node2 ~]$ 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

[grid@node1 ~]$ su – oracle
Password:
[oracle@node1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Mon Mar 11 11:09:48 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 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, 验证归档

[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

发现已经有文档了

更多 Oracle 相关信息见 Oracle 专题页面 https://www.linuxidc.com/topicnews.aspx?tid=12

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-22发表,共计4225字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中