欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

【Oracle】物理DataGuard最大性能模式部署

程序员文章站 2024-02-02 20:09:40
...

物理DATAGUARD最大性能模式配置过程 主库主机edbjr2p1 备库主机edbjr2p2 1.创建主库 [root@edbjr2p1 ~]# xhost + access control

物理DATAGUARD最大性能模式配置过程

主库主机edbjr2p1

备库主机edbjr2p2

1.创建主库

[root@edbjr2p1 ~]# xhost +

access control disabled, clients can connect from any host

[root@edbjr2p1 ~]# su - Oracle

[oracle@edbjr2p1 ~]$ dbca

建库过程略。。。ORACLE_SID=ORCL

2.主库参数

[oracle@edbjr2p1 ~]$ export ORACLE_SID=ORCL

[oracle@edbjr2p1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 31 09:20:03 2013

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

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SYS@ORCL>shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SYS@ORCL>startup mount

ORACLE instance started.

Total System Global Area 285212672 bytes

Fixed Size 1218968 bytes

Variable Size 88082024 bytes

Database Buffers 188743680 bytes

Redo Buffers 7168000 bytes

Database mounted.

SYS@ORCL>select status from v$instance;

STATUS

------------

MOUNTED

SYS@ORCL>alter database force logging;

Database altered.

SYS@ORCL>select log_mode from v$database;

LOG_MODE

------------

NOARCHIVELOG

SYS@ORCL>

SYS@ORCL>alter database archivelog;

Database altered.

SYS@ORCL>alter system set log_archive_config='dg_config=(orcl,aux1)';

System altered.

SYS@ORCL>alter system set log_archive_dest_10='location=/home/oracle/orcl_arclog valid_for=(online_logfiles,all_roles) db_unique_name=orcl';

System altered.

SYS@ORCL>

创建目录用于存放归档

[oracle@edbjr2p1 admin]$ mkdir /home/oracle/orcl_arclog

继续更改参数

SYS@ORCL>alter system set log_archive_dest_1='service=aux1 valid_for=(online_logfiles,primary_role) db_unique_name=aux1';

System altered.

SYS@ORCL>alter system set log_archive_max_processes=4;

System altered.

SYS@ORCL>create pfile from spfile;

File created.

传输pfile文件和密码文件

[oracle@edbjr2p1 admin]$ scp $ORACLE_HOME/dbs/initORCL.ora edbjr2p2:$ORACLE_HOME/dbs/initAUX1.ora

oracle@edbjr2p2's password:

initORCL.ora 100% 1178 1.2KB/s 00:00

[oracle@edbjr2p1 admin]$ scp $ORACLE_HOME/dbs/orapwORCL edbjr2p2:$ORACLE_HOME/dbs/orapwAUX1

oracle@edbjr2p2's password:

orapwORCL 100% 1536 1.5KB/s 00:00

[oracle@edbjr2p1 admin]$

3.在备库中修改传输过来的pfile文件

[root@edbjr2p2 ~]# su - oracle

[oracle@edbjr2p2 ~]$ cd $ORACLE_HOME/dbs

[oracle@edbjr2p2 dbs]$ ls

initAUX1.ora initdw.ora init.ora orapwAUX1

[oracle@edbjr2p2 dbs]$ vi initAUX1.ora

以下是在文件中修改的

*.audit_file_dest='/u01/app/oracle/admin/AUX1/adump'

*.background_dump_dest='/u01/app/oracle/admin/AUX1/bdump'

*.control_files='/u01/app/oracle/oradata/AUX1/control01.ctl','/u01/app/oracle/oradata/AUX1/control02.ctl','/u01/app/oracle/oradata/AUX1/control03.ctl'

*.core_dump_dest='/u01/app/oracle/admin/AUX1/cdump'

*.log_archive_dest_10='location=/home/oracle/aux1_arclog valid_for=(online_logfiles,all_roles) db_unique_name=aux1'

*.user_dump_dest='/u01/app/oracle/admin/AUX1/udump'

以下是在文件中添加的

*.db_unique_name='AUX1'

*.standby_archive_dest='/home/oracle/aux1_stdlog'

*.db_file_name_convert=('/u01/app/oracle/oradata/ORCL/','/u01/app/oracle/oradata/AUX1/')

*.log_file_name_convert=('/u01/app/oracle/oradata/ORCL/','/u01/app/oracle/oradata/AUX1/')

*.standby_file_management='auto'

在备库中创建目录

[oracle@edbjr2p2 dbs]$ mkdir -p $ORACLE_BASE/admin/AUX1/{a,b,c,u}dump

[oracle@edbjr2p2 dbs]$ mkdir /home/oracle/aux1_arclog

[oracle@edbjr2p2 dbs]$ mkdir /home/oracle/aux1_stdlog

[oracle@edbjr2p2 dbs]$ mkdir $ORACLE_BASE/oradata/AUX1

【Oracle】物理DataGuard最大性能模式部署