物理DG!Oracle 10G Data Guard Demo
Oracle 10G Data Guard Demo
===============================================
monitor
name:liuzk
ipv :192.168.44.102
ip :192.168.1.80
OS :XP
name:lzk101
ip :192.168.44.101
OS :Redhat 4
DB:oracle10g r2
name:lzk103
ip :192.168.44.103
OS :Redhat 4
DB:oracle10g r2
===============================================
-- Data Guard Concepts and Administration
1:Introduction to Oracle Data Guard
3:Creating a Physical Standby Database
--Data Guard Workshop Steps
1、Configure Oracle Net
2、Configure Primary Database
3、Confiture Physical Standby Database
4、Testing & Troubleshooting
-----------------------------------------------
#:lzk101
$env | grep ORA
ORACLE_SID=lzk101
ORACLE_BASE=/u01
ORACLE_HOME=/u01/home
TNSNAMES:
lzk101 ip:101
lzk103 ip:103
SQL>alter database force logging;
SQL>create pfile from spfile;
$ orapwd file=orapwdorcl password=oracle entries=5
$ cd /u01/oracle/dbs/
$ vi initlzk101.ora
...
...
log_archive_dest_1='location=/u01/oradata/arch'
log_archive_dest_state_1=enable
log_archive_dest_2='service=lzk103'
log_archive_dest_state_2=enable
log_archive_start=true :10G not
log_archive_format='%t_%s_%r.arc'
log_archive_max_processes=2
fal_server=lzk103
fal_client=lzk101
db_unique_name=lzk101
Esc :x
-----------------------------------------------
SQL>shutdown immediate
SQL>startup mount
SQL>alter database create standby controlfile as '/u01/oradata/lzk101/lzk101.ctl'
SQL>alter database open
SQL>shutdown immediate
-----------------------------------------------
vi /etc/hosts
192.168.1.101 lzk101
192.168.1.103 lzk103
copys files
/u01/oradata/
/u01/admin
/u01/oracle/dbs/
$cd /u01/oradata/
$scp -r lzk101 lzk103:/u01/oradata/
$cd ../admin
$scp -r lzk101 lzk103:/u01/admin
$cd /u01/oracle/dbs/
$scp initlzk101.ora orapwdlzk101 lzk103:/u01/oracle/dbs
-----------------------------------------------
===============================================
#:lzk103 只安裝軟體不安裝庫
$env | grep ORA
ORACLE_SID=lzk101 或者|export ORACLE_SID=lzk101
ORACLE_BASE=/u01
ORACLE_HOME=/u01/home
TNSNAMES:
lzk101 ip:101
lzk103 ip:103
檢測TNSNAMES配置正常狀態,可以互聯測試。
$cd /u01/oradata/lzk101
rm -rf control*
$mv lzk101.ctl control01.ctl
$cp control01.ctl control02.ctl
$cp control01.ctl control03.ctl
$cd /u01/oracle/dbs
vi initlzk101.ora
...
...
log_archive_dest_1='location=/u01/oradata/arch'
log_archive_dest_state_1=enable
log_archive_dest_2='service=lzk101'
log_archive_dest_state_2=enable
log_archive_start=true :10G not
log_archive_format='%t_%s_%r.arc'
log_archive_max_processes=2
fal_server=lzk101
fal_client=lzk103
db_unique_name=lzk103
Esc :x
-----------------------------------------------
===============================================
全部配置完成:
啟動主庫:
啟動主端的LSNRCTL Server
$sqlplus /nolog
SQL>conn /as sysdba
SQL>create spfile from pfile
SQL>startup
SQL>alter system set log_archive_dest_2='SERVICE=lzk203 LGWR ASYNC NOAFFIRM db_unique_name=orcl' scope=both;
啟動備庫:
啟動備端的LSNRCTL Server
$sqlplus /nolog
SQL>conn /as sysdba
SQL>create spfile from pfile
SQL>startup nomount;
SQL>alter database mount standby database;
SQL> alter system set log_archive_dest_2='SERVICE=lzk201 LGWR ASYNC NOAFFIRM db_unique_name=orcl' scope=both;
SQL>select name,database_role from v$database;
NAME DATABASE_ROLE
------------ ---------------
LZK101 PHYSICAL STANDBY
SQL>alter database recover managed standby database disconnect from session;
=============================================================
SQL>conn sys/sys@lzk101 as sysdba
SQL>select name,database_role from v$database;
NAME DATABASE_ROLE
------------ ---------------
LZK101 PRIMARY
SQL>create table dgtest(id int,name char(10));
SQL>insert into dgtest values(1,'lzk');
SQL>insert into dgtest values(2,'lzk');
SQL>commit;
SQL>alter system switch logfile;
SQL>alter system switch logfile;
SQL>alter system switch logfile;
SQL>alter system switch logfile;
=============================================================
lzk103
SQL>select sequence#,first_time,next_time from v$archived_log order by sequence#;
...
...
...
SQL>select sequence#,applied from v$archived_log order by sequence#;
NO
...
..
...
YES
SQL>alter database recover managed standby database cancel;
SQL>alter database open read only;
SQL>select * from dgtest;
...
...
SQL>alter database recover managed standby database disconnect from session;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7755871/viewspace-735239/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle 10g物理data guard 操作Oracle 10g
- 【DG】Oracle Data Guard官方直譯Oracle
- 【ASK_ORACLE】Oracle Data Guard(一)DG架構Oracle架構
- 【DG】Data Guard搭建(physical standby)
- ORACLE 10G Data Guard 模式切換Oracle 10g模式
- Oracle 11g RAC Data Guard 物理standby 建立Oracle
- 搭建Oracle Data Guard 11g(物理備用)Oracle
- 使用Data Guard Broker進行Data Guard物理備用庫配置(Oracle 19c)Oracle
- RedHat搭建物理Data GuardRedhat
- Oracle DG(Data Guard)支援異構平臺說明Oracle
- oracle10g data guard(dg)__flashback_physical databaseOracleDatabase
- ORACLE 10G data guard 升級步驟Oracle 10g
- oracle 10g data guard log apply servicesOracle 10gAPP
- 物理data guard原理的理解(zt)
- [轉]物理data guard原理的理解
- 【DG】同一臺主機實現物理Data Guard配置安裝(精簡版)
- Oracle 10g Data Guard的建立與維護Oracle 10g
- oracle data guard!!Oracle
- G008-ORACLE-DG ORACLE 19C Active Data Guard DML RedirectionOracle
- 總結11g 物理data guard
- DATA GUARD物理STANDBY的 SWITCHOVER切換
- 【DATAGUARD】物理dg配置客戶端無縫切換 (八.1)--Data Guard Broker 的配置客戶端
- 【DG】Data Guard主備庫Switchover切換
- oracle9i(9204)dg(data guard)_adding and dropping online redo logs_物理_physicalOracle
- Oracle 19C Data Guard基礎運維-02 Switchovers(物理)Oracle運維
- 【DataGuard】使用Grid Control快速部署Oracle物理Data GuardOracle
- 【ASK_ORACLE】Oracle Data Guard(二)物理備庫的概念和優勢Oracle
- 介紹ORACLE DATA GUARD——DATA GUARD概念和管理Oracle
- Oracle Data Guard配置Oracle
- CentOS 5.8上搭建10g物理DGCentOS
- Data guard 配置之搭建物理備庫
- 【DataGuard】物理Data Guard之Failover轉換AI
- DATA GUARD物理STANDBY的FAILOVER切換AI
- DATA GUARD物理備庫的SWITCHOVER切換
- DATA GUARD物理STANDBY的 SWITCHOVER切換[zt]
- Oracle Data Guard 10g R2概念和理論Oracle
- ZT:在 RHEL3 上配置 Oracle 10g Data GuardOracle 10g
- 在 RHEL3 上配置 Oracle 10g Data Guard(轉)Oracle 10g