物理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