Oracle Data Guard Linux 平臺 Physical Standby 搭建例項
Data Guard 環境:
作業系統: 4.7
Primary資料庫:
IP地址:10.85.10.1。
資料庫SID:orcl
DB_UNIQUE_NAME:orcl_pd
Standby資料庫:
IP地址:10.85.10.2
資料庫SID:orcl。
DB_UNIQUE_NAME:orcl_st
一. Primary 端的配置
1. 主庫設定為force logging 模式
SQL> alter database force logging;
2. 主庫設為歸檔模式
SQL> archive log list;
SQL> shutdown immediate
SQL> startup mount
SQL> alter database archivelog;
SQL> archive log list;
3. 新增redo log file
新增一個新的Standby Redologs組(注意組號不要與當前存在的Online Redologs組重複),併為該組指定一個成員:
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 4 ('/u01/app/oracle/oradata/orcl/redo04.log') size 50M;
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 5 ('/u01/app/oracle/oradata/orcl/redo05.log') size 50M;
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 6 ('/u01/app/oracle/oradata/orcl/redo06.log') size 50M;
SQL> ALTER DATABASE ADD STANDBY LOGFILE GROUP 7 ('/u01/app/oracle/oradata/orcl/redo07.log') size 50M;
4. 建立備庫的密碼檔案和控制檔案
SQL> alter database create standby controlfile as '/u01/control01.ctl';
-- 說明: 判斷一個資料庫是Primary還是Standby,就是透過控制檔案來判斷的。
[oracle@localhost dbs]$ orapwd file=/u01/app/oracle/product/10.2.0/db_1/dbs/orapworcl password=admin
如果已經存在,就不用建立了。 預設情況下,win下口令檔案的格式是pwdsid.ora,unix下的格式是orapwSID(大小寫敏感)
5. 修改初始化引數檔案
SQL> create pfile='/u01/initorcl.ora' from spfile;
在initorcl.ora 新增如下內容:
*.DB_UNIQUE_NAME='orcl_pd'
*.log_archive_dest_1='location=/u01/archive'
*.log_archive_dest_2='SERVICE=orcl_st'
*.LOG_ARCHIVE_DEST_STATE_1=ENABLE
*.LOG_ARCHIVE_DEST_STATE_2=ENABLE
*.standby_file_management='AUTO'
*.standby_archive_dest='/u01/archive'
*.FAL_SERVER='orcl_st'
*.FAL_CLIENT='orcl_pd'
如果主庫和備庫的資料檔案位置不同,還需要加如下2個引數:
*.log_file_name_convert='/u02/oradata/orcl/','/u03/oradata/orcl/'
*.db_file_name_convert='/u02/oradata/orcl/','/u03/oradata/orcl/'
-- 注意:orcl_st,orcl_pd 是在tnsnames檔案中配置的
用'/u01/initorcl.ora' 這個pfile 啟動資料庫,並生成spfile。
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup pfile='/u01/initorcl.ora';
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 79694068 bytes
Database Buffers 83886080 bytes
Redo Buffers 2973696 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile='/u01/initorcl.ora';
File created.
6. 修改listener.ora 和tnsnames.ora 檔案
Listener.ora 檔案:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
注意:SID_LIST_LISTENER 配置的是靜態註冊,如果沒有該引數,而且Data Guard 啟動順序又不正確,那麼在主庫可能會報 PING[ARC1]: Heartbeat failed to connect to standby 'orcl_st'. Error is 12514. 錯誤,導致歸檔無法完成。
Oracle Listener 動態註冊 與 靜態註冊
Tnsnames.ora 檔案
ORCL_ST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.10.2)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
ORCL_PD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.85.10.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
come from:
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/90618/viewspace-692530/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle Data Guard Linux 平臺 Physical Standby 搭建例項-3OracleLinux
- Oracle Data Guard Linux 平臺 Physical Standby 搭建例項 -2OracleLinux
- Oracle Data Guard Linux 平臺 Physical Standby 搭建例項 -1OracleLinux
- 【DG】Data Guard搭建(physical standby)
- 單機Linux平臺Oracle 10g DataGuard Physical Standby 搭建例項(10)LinuxOracle 10g
- 單機Linux平臺Oracle 10g DataGuard Physical Standby 搭建例項(9)LinuxOracle 10g
- 單機Linux平臺Oracle 10g DataGuard Physical Standby 搭建例項(8)LinuxOracle 10g
- 單機Linux平臺Oracle 10g DataGuard Physical Standby 搭建例項(7)LinuxOracle 10g
- 單機Linux平臺Oracle 10g DataGuard Physical Standby 搭建例項(6)LinuxOracle 10g
- 單機Linux平臺Oracle 10g DataGuard Physical Standby 搭建例項(5)LinuxOracle 10g
- 單機Linux平臺Oracle 10g DataGuard Physical Standby 搭建例項(4)LinuxOracle 10g
- 單機Linux平臺Oracle 10g DataGuard Physical Standby 搭建例項(3)LinuxOracle 10g
- 單機Linux平臺Oracle 10g DataGuard Physical Standby 搭建例項(2)LinuxOracle 10g
- 單機Linux平臺Oracle 10g DataGuard Physical Standby 搭建例項(1)LinuxOracle 10g
- 單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(7)LinuxOracle
- 單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(6)LinuxOracle
- 單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(5)LinuxOracle
- 單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(4)LinuxOracle
- 單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(3)LinuxOracle
- 單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(2)LinuxOracle
- 單機Linux平臺Oracle 11g DataGuard Physical Standby 搭建例項(1)LinuxOracle
- Oracle 11g Data Guard (physical standby - active dataguard) [final]Oracle
- Script to Collect Data Guard Physical and Active Standby Diagnostic InformationORM
- 單機Linux平臺Oracle 10g DataGuard Logical Standby 搭建例項LinuxOracle 10g
- 單機Linux平臺Oracle10g DataGuard Logical Standby搭建例項(6)LinuxOracle
- 單機Linux平臺Oracle10g DataGuard Logical Standby搭建例項(5)LinuxOracle
- 單機Linux平臺Oracle10g DataGuard Logical Standby搭建例項(4)LinuxOracle
- 單機Linux平臺Oracle10g DataGuard Logical Standby搭建例項(3)LinuxOracle
- 單機Linux平臺Oracle10g DataGuard Logical Standby搭建例項(2)LinuxOracle
- physical data guard 的原理
- physical data guard 的原理 (zt)
- Oracle physical standbyOracle
- oracle10g data guard(dg)__flashback_physical databaseOracleDatabase
- Data Guard 之RMAN備份線上搭建物理standby
- Oracle DG(Data Guard)支援異構平臺說明Oracle
- Oracle Data Guard 支援的異構平臺 說明Oracle
- Oracle Data Gurad Physical Standby 相關說明Oracle
- Oracle 11g RAC Data Guard 物理standby 建立Oracle