Oracle 11gR2 Active DataGuard配置Step By Step(二)
上篇我們進行了Oracle Dataguard基礎配置部分。同RAC相同,Oracle DG很大一部分工作都是真正執行前的準備過程。本篇繼續討論配置專案。
3、Oracle NET配置
Oracle DG是建立在兩個核心技術Redo Transfer和Redo Apply的基礎上。Redo Transfer是將日誌在Primary和Standby傳輸的技術,其基礎就是Oracle Net配置。
Oracle Net三大配置檔案:sqlnet.ora、listener.ora和tnsnames.ora分別起到不同的作用。Tnsnames.ora負責記錄本地連線名,從primary到standby,從standby到primary,連線都是從tnsnames.ora進行配置。
所以在Primary和Standby端,都要進行互聯配置。
[oracle@SimpleLinux admin]$ ls -l
total 24
-rw-r--r--. 1 oracle oinstall 345 Apr 13 12:59 listener14041312PM5921.bak
-rw-r--r--. 1 oracle oinstall 345 Apr 1 13:19 listener.ora
-rw-r--r--. 1 oracle oinstall 345 Apr 1 13:10 listener.ora.bk
drwxr-xr-x. 2 oracle oinstall 4096 Apr 1 12:27 samples
-rw-r--r--. 1 oracle oinstall 381 Dec 17 2012 shrept.lst
-rw-r--r--. 1 oracle oinstall 502 Apr 13 13:00 tnsnames.ora
[oracle@SimpleLinux admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORA11GSY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.88)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora11gsy)
)
)
ORA11G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.137.88)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora11g)
)
)
之後,listener.ora是負責監聽器行為的。監聽器動作分為動態註冊和靜態註冊兩種方式,理論上只要例項啟動(Pmon出現),動態註冊動作就會出現。我們就可以在監聽器狀態中檢視到註冊資訊。
但是,有一個問題需要注意,我們進行duplicate和Redo Transfer的時候,連線都是需要無條件的。當例項在nomount狀態時,動態監聽狀態是restricted限制態,連線是有限制的。所以,就存在一個矛盾。解決這個問題方法,就是放棄動態註冊,對Primary和Standby都採用靜態註冊。
[oracle@SimpleLinux admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = SimpleLinux)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = ora11g)
(ORACLE_HOME = /u01/app/oracle)
(PROGRAM = extproc)
(GLOBAL_DBNAME = ora11g)
)
(SID_DESC =
(SID_NAME = ora11gsy)
(ORACLE_HOME = /u01/app/oracle)
(GLOBAL_DBNAME = ora11gsy)
)
)
ADR_BASE_LISTENER = /u01/app
監聽器啟動之後,狀態unknown註冊資訊。
[oracle@SimpleLinux admin]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 13-APR-2014 13:03:52
Copyright (c) 1991, 2013, Oracle. All rights reserved.
(篇幅原因,有省略……)
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=SimpleLinux)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "ora11g" has 1 instance(s).
Instance "ora11g", status UNKNOWN, has 1 handler(s) for this service...
Service "ora11gsy" has 1 instance(s).
Instance "ora11gsy", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
4、密碼檔案設定
Oracle DG設定有一個要求,就是管理密碼(如sys)一致性。在Primary和Standby端,管理密碼一定要求是一樣的。這個密碼的作用在於傳遞Redo Log過程中進行驗證。
在安裝DG的時候,比較好一種方法是複製Primary庫到Standby。
[oracle@SimpleLinux dbs]$ ls -l
total 20
-rw-rw----. 1 oracle oinstall 1544 Apr 13 12:40 hc_ora11g.dat
-rw-r--r--. 1 oracle oinstall 2851 May 15 2009 init.ora
-rw-r-----. 1 oracle oinstall 24 Apr 1 12:39 lkORA11G
-rw-r-----. 1 oracle oinstall 1536 Apr 1 12:45 orapwora11g
-rw-r-----. 1 oracle oinstall 3584 Apr 13 13:00 spfileora11g.ora
[oracle@SimpleLinux dbs]$ cp orapwora11g orapwora11gsy
[oracle@SimpleLinux dbs]$ ls -l | grep orapw
-rw-r-----. 1 oracle oinstall 1536 Apr 1 12:45 orapwora11g
-rw-r-----. 1 oracle oinstall 1536 Apr 13 13:10 orapwora11gsy
5、目錄建立
在standby端,我們需要建立一些基本目錄。這個時候,可以參考Primary庫的引數檔案專案,略加修改就可以確定完整的目錄列表。
[oracle@SimpleLinux dbs]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Sun Apr 13 13:11:29 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> create pfile from spfile;
File created.
文字格式的引數檔案。
[oracle@SimpleLinux dbs]$ cat initora11g.ora
*.audit_file_dest='/u01/app/admin/ora11g/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/u01/app/oradata/ORA11G/controlfile/o1_mf_9mnjwpko_.ctl','/u01/app/fast_recovery_area/ORA11G/controlfile/o1_mf_9mnjwpw2_.ctl'
*.db_block_size=8192
*.db_create_file_dest='/u01/app/oradata'
*.db_domain=''
*.db_file_name_convert='ORA11G','ORA11GSY'
*.db_name='ora11g'
*.db_recovery_file_dest='/u01/app/fast_recovery_area'
*.db_recovery_file_dest_size=10485760000
*.diagnostic_dest='/u01/app'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora11gXDB)'
*.log_archive_config='DG_CONFIG=(ora11g,ora11gsy)'
*.log_archive_dest_2='SERVICE=ora11gsy valid_for=(online_logfiles,primary_role) db_unique_name=ora11gsy'
*.log_archive_dest_state_2='ENABLE'
*.log_file_name_convert='ORA11G','ORA11GSY'
*.memory_target=373293056
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.standby_file_management='AUTO'
*.undo_tablespace='UNDOTBS1'
建立目錄:
[oracle@SimpleLinux dbs]$ mkdir -p /u01/app/admin/ora11gsy/adump
[oracle@SimpleLinux dbs]$ mkdir -p /u01/app/oradata/ORA11GSY/controlfile/
[oracle@SimpleLinux dbs]$ mkdir -p /u01/app/fast_recovery_area/ORA11GSY/controlfile/
[oracle@SimpleLinux dbs]$ mkdir -p /u01/app/oradata/ORA11GSY/onlinelog/
[oracle@SimpleLinux dbs]$ mkdir -p /u01/app/fast_recovery_area/ORA11GSY/onlinelog/
[oracle@SimpleLinux dbs]$ mkdir -p /u01/app/oradata/ORA11GSY/datafile/
6、啟動standby例項
理論上,有引數檔案就可以將資料庫例項啟動到nomount上。我們建立一個簡單的引數檔案即可。
注意:啟動例項名稱是透過環境變數ORACLE_SID來定位。
[oracle@SimpleLinux dbs]$ cat initora11gsy.ora
db_name=ora11gsy
[oracle@SimpleLinux dbs]$ export ORACLE_SID=ora11gsy
指定pfile啟動standby例項到nomount。
[oracle@SimpleLinux dbs]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Sun Apr 13 13:22:33 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected to an idle instance.
SQL> startup nomount pfile=initora11gsy.ora
ORACLE instance started.
Total System Global Area 150654976 bytes
Fixed Size 1363216 bytes
Variable Size 96469744 bytes
Database Buffers 50331648 bytes
Redo Buffers 2490368 bytes
確定例項程式pmon啟動。
[oracle@SimpleLinux dbs]$ ps -ef | grep pmon
oracle 1692 1 0 12:38 ? 00:00:01 ora_pmon_ora11g
oracle 2567 1 0 13:26 ? 00:00:00 ora_pmon_ora11gsy
oracle 2614 2404 0 13:27 pts/0 00:00:00 grep pmon
下面,就可以透過RMAN開始duplicate standby過程了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29440247/viewspace-1700332/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 11gR2 Active DataGuard配置Step By Step(一)Oracle
- Oracle 11gR2 Active DataGuard配置Step By Step(三)Oracle
- 使用RMAN備份集搭建Oracle Dataguard Step by Step(二)Oracle
- Step By Step of Configuring Oracle 11gR2 (11.2.0.1) RAC to RAC DataguardOracle
- 使用RMAN備份集搭建Oracle Dataguard Step by Step(一)Oracle
- oracle10g simpe AQ step by step(二)Oracle
- Oracle高階複製Step by StepOracle
- Oracle 12c GI/RAC Step-by-Step安裝指南(二)Oracle
- linux中配置NFS服務step by stepLinuxNFS
- React Step by StepReact
- Step by Step TimesTen ----- 配置client-server連線clientServer
- oracle10g simpe AQ step by step(一)Oracle
- Step by Step Data Replication Using Oracle GoldenGateOracleGo
- Step by Step TimesTen --- DataStore的雙向複製( 二)AST
- Step by Step Guide on Creating Physical Standby Using RMAN DUPLICATE...FROM ACTIVE DATABASE WithoutGUIIDEDatabase
- step by step install oracle 10g rac asm on windowsOracle 10gASMWindows
- Command 模式 Step by Step模式
- BAPI Step by step GuidanceAPIGUI
- Step by Step TimesTen --- ttIsqlSQL
- Linkerd 2.10(Step by Step)—設定服務配置檔案
- 使用RMAN備份集搭建Oracle Datagard Step by Step(三)Oracle
- Step By Step Install Oracle10g RAC On Hp-uxOracleUX
- Promise的實現(step by step)Promise
- Learn c++ step by step (轉)C++
- [Oracle] Installing Oracle 10g on RHEL AS 3 Step-by-StepOracle 10g
- Oracle 12c GI/RAC Step-by-Step安裝指南(一)Oracle
- Oracle 12c GI/RAC Step-by-Step安裝指南(三)Oracle
- Oracle 12c GI/RAC Step-by-Step安裝指南(四)Oracle
- Oracle 12c GI/RAC Step-by-Step安裝指南(五)Oracle
- Oracle 12c GI/RAC Step-by-Step安裝指南(六)Oracle
- step by step install oracle 10g rac asm操作文件Oracle 10gASM
- Linux Software RAID step by stepLinuxAI
- Git Step by Step (3):Git物件模型Git物件模型
- 安裝linux(step by step)(轉)Linux
- Learn C++ step by step(2) (轉)C++
- 單步除錯 step into/step out/step over 區別詳解除錯
- Step By Step Configure DataGuard (10g) Physical Standby Database On Linux X86_64(2/2)DatabaseLinux
- Linkerd 2.10(Step by Step)—使用 Kustomize 自定義 Linkerd 的配置