cp資料檔案方式搭建 11g 物理standby
1.主庫設定強制歸檔
點選( 此處 )摺疊或開啟
-
SQL > alter database force logging ;
-
-
SQL > select force_logging from v$database ;
-
-
FOR
-
- - -
-
YES
點選(
此處
)摺疊或開啟
orapwd file
=
$
ORACLE_HOME/dbs/orapwbeijing password
=
oracle entries
=
3
scp orapwbeijing ...
備庫上重新命名一下
mv orapwbeijing orapwshanghai
點選(
此處
)摺疊或開啟
archive log list
;
shutdown immediate
;
startup mount
;
alter database archivelog
;
alter system set log_archvie_dest_1
='
location
=
/
arch/' scope
=
spfile;
點選(
此處
)摺疊或開啟
sh
=
(
DESCRIPTION
=
(
ADDRESS
=
(
PROTOCOL
=
TCP
)
(
HOST
=
192.168.6.31
)
(
PORT
=
9521
)
)
(
CONNECT_DATA
=
(
SERVER
=
DEDICATED
)
(
SERVICE_NAME
=
shanghai
)
)
)
點選(
此處
)摺疊或開啟
bj
=
(
DESCRIPTION
=
(
ADDRESS_LIST
=
(
ADDRESS
=
(
PROTOCOL
=
TCP
)
(
HOST
=
192
.
168
.
6
.
21
)
(
PORT
=
9521
)
)
)
(
CONNECT_DATA
=
(
SERVICE_NAME
=
beijing
)
)
)
sh
=
(
DESCRIPTION
=
(
ADDRESS_LIST
=
(
ADDRESS
=
(
PROTOCOL
=
TCP
)
(
HOST
=
192
.
168
.
6
.
31
)
(
PORT
=
9521
)
)
)
(
CONNECT_DATA
=
(
SERVICE_NAME
=
shanghai
)
)
)
點選(
此處
)摺疊或開啟
alter database create standby controlfile as
'/u01/control01.ctl'
;
Database altered
.
點選(
此處
)摺疊或開啟
beijing
.
__db_cache_size
=
314572800
beijing
.
__java_pool_size
=
4194304
beijing
.
__large_pool_size
=
4194304
beijing
.
__oracle_base
=
'/u01/app/oracle'
#
ORACLE_BASE set from environment
beijing
.
__pga_aggregate_target
=
339738624
beijing
.
__sga_target
=
503316480
beijing
.
__shared_io_pool_size
=
beijing
.
__shared_pool_size
=
167772160
beijing
.
__streams_pool_size
=
4194304
*
.
audit_file_dest
=
'/u01/app/oracle/admin/beijing/adump'
*
.
audit_trail
=
'db'
*
.
compatible
=
'11.2.0.0.0'
*
.
control_files
=
'/u01/app/oracle/oradata/beijing/control01.ctl'
,
'/u01/app/oracle/fast_recovery_area/beijing/control02.ctl'
*
.
db_block_size
=
8192
*
.
db_domain
=
''
*
.
db_name
=
'beijing'
*
.
db_recovery_file_dest
=
'/u01/app/oracle/fast_recovery_area'
*
.
db_recovery_file_dest_size
=
4294967296
*
.
diagnostic_dest
=
'/u01/app/oracle'
*
.
dispatchers
=
'(PROTOCOL=TCP) (SERVICE=beijingXDB)'
#
*
.
local_listener
=
'LISTENER_BEIJING'
*
.
memory_target
=
842006528
*
.
open_cursors
=
300
*
.
processes
=
200
*
.
remote_login_passwordfile
=
'EXCLUSIVE'
*
.
sessions
=
225
*
.
undo_tablespace
=
'UNDOTBS1'
#
add
for
primary_dg
*
.
db_unique_name
=
'beijing'
*
.
log_archive_config
=
'dg_config=(beijing,shanghai)'
*
.
log_archive_dest_1
=
'location=/arch valid_for=(all_logfiles,all_roles) db_unique_name=beijing'
*
.
log_archive_dest_2
=
'service=sh reopen=120 lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=shanghai'
*
.
log_archive_dest_state_1
=
enable
*
.
log_archive_dest_state_2
=
enable
*
.
standby_file_management
=
'auto'
*
.
fal_server
=
'shanghai'
*
.
db_file_name_convert
=
'/u01/app/oracle/oradata/shanghai'
,
'/u01/app/oracle/oradata/bejing'
*
.
log_file_name_convert
=
'/u01/app/oracle/oradata/shanghai'
,
'/u01/app/oracle/oradata/beijing'
點選(
此處
)摺疊或開啟
[
oracle@standby dbs
]
$
cat initshanghai
.
ora
shanghai
.
__db_cache_size
=
314572800
shanghai
.
__java_pool_size
=
4194304
shanghai
.
__large_pool_size
=
4194304
shanghai
.
__oracle_base
=
'/u01/app/oracle\'
#
ORACLE_BASE set from environment
shanghai
.
__pga_aggregate_target
=
339738624
shanghai
.
__sga_target
=
503316480
shanghai
.
__shared_io_pool_size
=
shanghai
.
__shared_pool_size
=
167772160
shanghai
.
__streams_pool_size
=
4194304
*
.
audit_file_dest
=
\
'/u01/app/oracle/admin/shanghai/adump\'
*
.
audit_trail
=
\
'db\'
*
.
compatible
=
\
'11.2.0.0.0\'
*
.
control_files
=
'/u01/app/oracle/oradata/shanghai/control01.ctl'
,
'/u01/app/oracle/fast_recovery_area/shanghai/control02.ctl\'
*
.
db_block_size
=
8192
*
.
db_domain
=
''
*
.
db_name
=
'beijing'
*
.
db_recovery_file_dest
=
'/u01/app/oracle/fast_recovery_area'
*
.
db_recovery_file_dest_size
=
4294967296
*
.
diagnostic_dest
=
'/u01/app/oracle\'
*
.
dispatchers
=
'(PROTOCOL=TCP) (SERVICE=shanghaiXDB)'
#
*
.
local_listener
=
'LISTENER_SHANGHAI'
*
.
memory_target
=
842006528
*
.
open_cursors
=
300
*
.
processes
=
200
*
.
remote_login_passwordfile
=
'EXCLUSIVE'
*
.
sessions
=
225
*
.
undo_tablespace
=
'UNDOTBS1'
#
add
for
primary_dg
*
.
db_unique_name
=
'shanghai'
*
.
log_archive_config
=
'dg_config=(shanghai,beijing)'
*
.
log_archive_dest_1
=
'location=/arch valid_for=(all_logfiles,all_roles) db_unique_name=shanghai'
*
.
log_archive_dest_2
=
'service=sh reopen=120 lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=shanghai'
*
.
log_archive_dest_state_1
=
enable
*
.
log_archive_dest_state_2
=
enable
*
.
fal_server
=
'beijing'
*
.
db_file_name_convert
=
'/u01/app/oracle/oradata/beijing'
,
'/u01/app/oracle/oradata/shanghai'
*
.
log_file_name_convert
=
'/u01/app/oracle/oradata/beijing'
,
'/u01/app/oracle/oradata/shanghai'
*
.
standby_file_management
=
'auto'
點選(
此處
)摺疊或開啟
SQL
>
startup pfile
=
'/u01/app/oracle/product/11.2.0/db_1/dbs/initshanghai.ora'
;
ORACLE instance started
.
Total System Global Area 839282688 bytes
Fixed
Size
2233000 bytes
Variable
Size
520097112 bytes
Database Buffers 314572800 bytes
Redo Buffers 2379776 bytes
Database mounted
.
Database opened
.
SQL
>
select open_mode from v$database
;
OPEN_MODE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
READ ONLY
點選(
此處
)摺疊或開啟
select dest_name
,
status
,
process
,
error
,
transmit_mode from v$archive_dest where target
=
'STANDBY'
DEST_NAME STATUS PROCESS ERROR TRANSMIT_MODE
-
-
-
-
-
-
-
-
-
-
-
--
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
---
LOG_ARCHIVE_DEST_2 VALID LGWR ASYNCHRONOUS
點選(
此處
)摺疊或開啟
alter database
add
standby logfile group 4
(
'/u01/app/oracle/oradata/beijing/redo04.log'
)
size
100M
;
alter database
add
standby logfile group 5
(
'/u01/app/oracle/oradata/beijing/redo05.log'
)
size
100M
;
alter database
add
standby logfile group 6
(
'/u01/app/oracle/oradata/beijing/redo06.log'
)
size
100M
;
alter database
add
standby logfile group 7
(
'/u01/app/oracle/oradata/beijing/redo07.log'
)
size
100M
;
SQL
>
col member
for
a60
SQL
>
select group#
,
type
,
member from v$logfile
;
GROUP#
TYPE
MEMBER
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
3 ONLINE /u01/app/oracle/oradata/beijing/redo03
.
log
2 ONLINE /u01/app/oracle/oradata/beijing/redo02
.
log
1 ONLINE /u01/app/oracle/oradata/beijing/redo01
.
log
4 STANDBY /u01/app/oracle/oradata/beijing/redo04
.
log
5 STANDBY /u01/app/oracle/oradata/beijing/redo05
.
log
6 STANDBY /u01/app/oracle/oradata/beijing/redo06
.
log
7 STANDBY /u01/app/oracle/oradata/beijing/redo07
.
log
7 rows selected
.
點選(
此處
)摺疊或開啟
alter database recover managed standby database disconnect from session;
點選(
此處
)摺疊或開啟
SQL
>
select open_mode from v$database
;
OPEN_MODE
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
READ ONLY WITH APPLY
點選(
此處
)摺疊或開啟
1
*
select
*
from v$managed_standby
PROCESS PID STATUS CLIENT_PROCESS CLIENT_PID CLIENT_DBID GROUP# RESETLOG_ID THREAD# SEQUENCE# BLOCK# BLOCKS DELAY_MINS KNOWN_AGENTS ACTIVE_AGENTS
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
ARCH 11245 CLOSING ARCH 11245 845781194 5 881314188 1 10 1 6 0 0 0
ARCH 11247 CLOSING ARCH 11247 845781194 5 881314188 1 8 1 926 0 0 0
ARCH 11249 CONNECTED ARCH 11249 845781194 N/A 0 0 0 0 0 0 0 0
ARCH 11251 CLOSING ARCH 11251 845781194 4 881314188 1 9 1 2 0 0 0
RFS 12009 IDLE ARCH 28837 845781194 N/A 0 0 0 0 0 0 0 0
RFS 12003 IDLE UNKNOWN 28835 845781194 N/A 0 0 0 0 0 0 0 0
RFS 12005 IDLE UNKNOWN 28839 845781194 N/A 0 0 0 0 0 0 0 0
RFS 12007 IDLE LGWR 28841 845781194 2 881314188 1 11 33 1 0 0 0
MRP0 12058 WAIT_FOR_LOG N/A N/A N/A N/A 881314188 1 11 0 0 0 0 0
2.建立口令檔案並複製到備庫
3.主庫確定為歸檔模式
4.主備庫上新增監聽和Oracle Net Service(tnsnames.ora)
主庫tnsnames.ora
備庫tnsnames.ora
5.主庫上建立standby Control file
6.修改主備庫引數檔案
主庫pfile
備庫pfile
7.將主備庫open並檢查DG是否有錯誤
檢查DG是否有錯誤
8.主備庫上新增standby redo log
備庫同上
9.備庫啟動MRP程式
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29990276/viewspace-1683772/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 物理Standby資料庫的檔案路徑轉換(1)資料庫
- 物理Standby資料庫的檔案路徑轉換(2)資料庫
- 物理Standby資料庫的檔案路徑轉換(3)資料庫
- cp方式恢復控制檔案
- DataGuard搭建物理StandBy
- 物理Standby資料庫及邏輯Standby資料庫(Physical Standby & Logical Standby)資料庫
- 【DataGuard】Oracle 11g物理Data Guard之Snapshot Standby資料庫功能Oracle資料庫
- ORACLE DUPLICATE建立物理standby資料庫Oracle資料庫
- 使用RMAN建立物理Standby資料庫資料庫
- 【轉】【DataGuard】Oracle 11g物理Data Guard之Snapshot Standby資料庫功能Oracle資料庫
- Oracle 11g RAC Data Guard 物理standby 建立Oracle
- Oracle 11g R2之物理Dataguard 重新命名資料檔案Oracle
- data gurad物理備份方式下重新命名資料檔案
- Oracle 11g Aix 雙機 物理Standby配置 01OracleAI
- Oracle 11g Aix 雙機 物理Standby配置 02OracleAI
- Oracle 11g Aix 雙機 物理Standby配置 03OracleAI
- Oracle 11g Aix 雙機 物理Standby配置 04OracleAI
- 【DATAGUARD 學習】使用duplicate 建立物理standby 資料庫資料庫
- 管理物理STANDBY資料庫——DATA GUARD概念和管理資料庫
- 建立物理STANDBY資料庫——DATA GUARD概念和管理資料庫
- 移動資料庫物理檔案 Move Physical Files資料庫
- 恢復rm -f物理刪除資料檔案
- dataguard之物理備庫丟失資料檔案
- Data Guard 之RMAN備份線上搭建物理standby
- 使用12c物理Standby跨網路還原丟失檔案
- 【DATAGUARD】 將11g物理備庫轉換為Snapshot Standby
- cp: 無法建立普通檔案 : 檔案已存在
- rm檔案後cp恢復回oracle檔案Oracle
- Database 物理檔案Database
- Oracle 11g單主搭建物理DGOracle
- 搭建Oracle Data Guard 11g(物理備用)Oracle
- vue專案及axios請求獲取資料(cp網站搭建制作)VueiOS網站
- Oracle11g R2之Dataguard搭建物理standbyOracle
- 物理standby和邏輯standby的區別
- data gurad物理備份方式下以READ ONLY/WRITE模式開啟物理STANDBY模式
- oracle10g data guard建立物理standby資料庫的例子Oracle資料庫
- mysql資料庫的檔案建立方式MySql資料庫
- 【DataGuard】10g物理standby主備switchover方式切換詳述