程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> oracle之物理DG創建

oracle之物理DG創建

編輯:Oracle教程

今天是2014-04-16,繼續完成DG的整理內容。該篇日志,將記錄創建DG的所需參數簡要介紹,和創建物理DG的過程。

第一:參數介紹:

db_unique_name(db_name):該參數指定數據庫唯一名字,注意該參數將和log_archive_config存在關聯,對於物理dg必須存有相同的db_name,對於邏輯DG必須 存有不同的db_name
log_archive_config:配置有效的db_unique_name列表,且負責主備驗證內容。
control_files:控制文件所在位置,如果備用數據庫的控制文件和主庫的控制文件路徑不同那麼需要使用該參數進行修改
log_archive_max_processes:最大歸檔進程,最多為30個,默認為2個,建議將其設置為5-10之內,太多進程存在導致切換日志緩慢的情況,因為在切換的時候需要喚醒他們需要時間消耗,另外當存在傳輸滯後的時候,需要有專門的進程(可以多個進程並行)負責傳輸滯後歸檔。切記:不可只有一個arch進程,因為需要有專用進程負責歸檔online redo:
db_create_file_dest:創建數據文件指定位置(如:asm指定磁盤組名,OMF管理方式)
log_archive_dest_n:這是非常主要的參數,負責傳輸重做。有如下幾個值:
service:定義遠端服務器參數
sync:傳輸模式為同步傳輸
async:傳輸模式為異步傳輸
net_timeout:當lns收不到備庫rfs確認應用重做消息時,lgwr進程等待的時間,如果運行在高可用性模式下那麼將放棄等待,如果是最大保護模式且無其他備庫,那麼主庫將關閉。當再次和備庫取得聯系後,那麼主庫的舊lns進程關閉啟動新的lns進程,然後連接備庫,然後停舊的備庫rfs進程啟動新的rfs進程,獲得新的standby log並初始化,完後傳輸連接准備就緒了。
reopen:主數據庫連接失效備庫的時間建議將該值設置為(15-30秒)
valid_for:定義使用log_archive_dest_n參數歸檔,在什麼模式下使用,有如下子參數:
online_logfile:僅歸檔聯機日志文件
standby_logfile:歸檔備用日志文件
all_logfiles:歸檔所有日志文件
primary_role:在主角色起作用
standby_role:在備角色起作用
all_roles:在所有角色起作用
affirm:使用於最打保護模式和最高可用性模式,確認重做在備庫得到應用消息
noaffirm:默認類型,適用最高性能
compression:壓縮,注意是在傳送中進行壓縮,而不是壓縮到本地磁盤,且需要消耗cpu,但可緩解帶寬壓力。
max_connections(11G廢掉):發送間隔歸檔日志啟用的最大進程數。
delay:在備庫延遲應用redo的時間(秒/單位)
location(快速閃回恢復區dest_10):本地歸檔位置,但是當閃回區存在了那麼是log_archive_dest_10為:USE_DB_RECOVERY_FILE_DEST
log_archive_dest_state_n:啟動那個目錄位置
備用角色參數:
db_file_name_convert:當備庫和主庫文件不同,彼此切換主備的時候使用該參數轉換
log_file_name_convert:同上(只是log)
fal_server(物理備用):僅適用於物理dg,當主庫無法和備庫連接的時候,那麼該備庫可以從其他級聯數據備庫接受滯後日志所需名稱列表。
fal_client(物理備用):需要接受滯後日志的那方名稱
standby_file_management:主備操作同步參數,如auto,那麼在主庫創建一個聯機日志,備庫也同樣操作,在主庫刪除,那麼在備庫也是刪除。默認為manual:

好了,參數就說這些,具體可以參考聯機手冊呗。

第二:創建物理DG:

前提條件:

1、主庫需要按照完數據庫(包括建庫),備庫需要按照軟件即可

2、主庫和備庫需要配置好網絡,配置好監聽和net 服務。

3、切記:備庫的密碼文件在11G必須為主庫的密碼文件,且在之前手動創建相同sys密碼文件的方式行不通了,因為在11g有了新的加密驗證方式。

4、其他使用rman 復制即可完成。

下面開始操作:

1、配置網絡及備庫參數文件

主庫:

監聽配置如下:

[oracle@dg-one admin]$ more listener.ora 
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.219)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

#ADR_BASE_LISTENER = /u01/app/oracle
SID_LIST_LISTENER=
  (SID_LIST=
      (SID_DESC=
         (GLOBAL_DBNAME=dg1)
         (ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)
        (SID_NAME=dg1)
   )
  )

tnsname.ora配置如下:

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools.

DG1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.219)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = dg1) ) ) DG2 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.230)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = dg2) ) )

備庫監聽配置如下:

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.230)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle
SID_LIST_LISTENER=
  (SID_LIST=
      (SID_DESC=
         (GLOBAL_DBNAME=dg2)
         (ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)
        (SID_NAME=dg2)
   )
  )


tnsname,ora配置如下: 

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools.

DG1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.219)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = dg1) ) ) DG2 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.230)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = dg2) ) )

互相測試如下:

[oracle@dg-two ~]$ tnsping dg1

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 15-APR-2014 23:49:55

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.219)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = dg1)))
OK (30 msec)
[oracle@dg-two ~]$ 
[oracle@dg-one admin]$ tnsping dg2

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 15-APR-2014 23:50:00

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.230)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = dg2)))
OK (20 msec)
[oracle@dg-one admin]$ 

在備庫創建臨時參數文件:

[oracle@dg-two dbs]$ more initdg2.ora 
db_name=DG
[oracle@dg-two dbs]$ 

主庫查詢:

SQL> select dbid,name from v$database;

      DBID NAME
---------- ---------
1756848898 DG

2、copy主庫密碼文件到備庫目錄,且將備庫啟動到nomount狀態:

[oracle@dg-two ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Wed Apr 16 00:05:21 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  217157632 bytes
Fixed Size                  2251816 bytes
Variable Size             159384536 bytes
Database Buffers           50331648 bytes
Redo Buffers                5189632 bytes
SQL> 

3、在主庫創建standby log file,當使用rman創建備庫的時候,將在備庫同步。

SQL> alter database add standby logfile '/u01/app/oracle/oradata/dg/std01.log' size 50m;

Database altered.

SQL> alter database add standby logfile '/u01/app/oracle/oradata/dg/std02.log' size 50m;

Database altered.

SQL> alter database add standby logfile '/u01/app/oracle/oradata/dg/std03.log' size 50m;

Database altered.

SQL> alter database add standby logfile '/u01/app/oracle/oradata/dg/std04.log' size 50m;

Database altered.

SQL> select * from v$log;

    GROUP#    THREAD#  SEQUENCE#      BYTES  BLOCKSIZE    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ ---------
         1          1         10   52428800        512          1 NO  CURRENT                1079725 15-APR-14   2.8147E+14
         2          1          8   52428800        512          1 YES INACTIVE               1015435 15-APR-14      1045647 15-APR-14
         3          1          9   52428800        512          1 YES INACTIVE               1045647 15-APR-14      1079725 15-APR-14

SQL> select * from v$standby_log;

    GROUP# DBID                                        THREAD#  SEQUENCE#      BYTES  BLOCKSIZE       USED ARC STATUS     FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME LAST_CHANGE# LAST_TIME
---------- ---------------------------------------- ---------- ---------- ---------- ---------- ---------- --- ---------- ------------- --------- ------------ --------- ------------ ---------
         4 UNASSIGNED                                        0          0   52428800        512          0 YES UNASSIGNED
         5 UNASSIGNED                                        0          0   52428800        512          0 YES UNASSIGNED
         6 UNASSIGNED                                        0          0   52428800        512          0 YES UNASSIGNED
         7 UNASSIGNED                                        0          0   52428800        512          0 YES UNASSIGNED

SQL> 

注意:創建standby redo 建議多余一個redo個數。

4、使用rman創建備庫:

注:備庫要啟動到nomount,主備庫監聽需要全部啟動且 是靜態監聽。

使用的腳本可以到代碼片中查找

整個過程如下:

[oracle@dg-one ~]$ rman target sys/root@dg1 auxiliary sys/root@dg2

Recovery Manager: Release 11.2.0.4.0 - Production on Wed Apr 16 04:25:10 2014

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: DG (DBID=1756848898) connected to auxiliary database: DG (not mounted)

RMAN> run{ 2> allocate channel ch1 type disk; 3> allocate channel ch2 type disk; 4> allocate channel ch3 type disk; 5> allocate channel ch4 type disk; 6> allocate channel ch5 type disk; 7> allocate channel ch6 type disk; 8> allocate channel ch7 type disk; 9> allocate auxiliary channel ch8 type disk; 10> duplicate target database for standby from active database nofilenamecheck 11> spfile 12> parameter_value_convert 'dg1','dg2' 13> set db_unique_name='dg2' 14> set db_recovery_file_dest='/u01/app/oracle/fast_recovery_area' 15> set DB_RECOVERY_FILE_DEST_SIZE='4G' 16> set control_files='/u01/app/oracle/oradata/dg/control01.ctl' 17> set db_create_file_dest='/u01/app/oracle/oradata/dg' 18> set db_create_online_log_dest_1='/u01/app/oracle/oradata/dg' 19> set log_archive_max_processes='5' 20> set fal_client='dg2' 21> set fal_server='dg1' 22> set standby_file_management='AUTO' 23> set log_archive_config='dg_config=(dg1,dg2)' 24> set log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles)' 25> set log_archive_dest_2='service=dg1 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=dg1'; 26> sql channel ch6 "alter system set log_archive_max_processes=5"; 27> sql channel ch7 "alter system set fal_client=dg1"; 28> sql channel ch7 "alter system set fal_server=dg2"; 29> sql channel ch5 "alter system set standby_file_management=AUTO"; 30> sql channel ch6 "alter system set log_archive_config=''dg_config=(dg1,dg2)''"; 31> sql channel ch7 "alter system set log_archive_dest_2=''service=dg2 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=dg2''"; 32> sql channel ch6 "alter system set log_archive_dest_1=''location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles)''"; 33> sql channel ch1 "alter system archive log current"; 34> sql channel ch8 "alter database recover managed standby database using current logfile disconnect from session"; 35> release channel ch1; 36> release channel ch2; 37> release channel ch3; 38> release channel ch4; 39> release channel ch5; 40> release channel ch6; 41> release channel ch7; 42> release channel ch8; 43> }

using target database control file instead of recovery catalog allocated channel: ch1 channel ch1: SID=48 device type=DISK

allocated channel: ch2 channel ch2: SID=44 device type=DISK

allocated channel: ch3 channel ch3: SID=47 device type=DISK

allocated channel: ch4 channel ch4: SID=46 device type=DISK

allocated channel: ch5 channel ch5: SID=45 device type=DISK

allocated channel: ch6 channel ch6: SID=39 device type=DISK

allocated channel: ch7 channel ch7: SID=35 device type=DISK

allocated channel: ch8 channel ch8: SID=20 device type=DISK

Starting Duplicate Db at 16-APR-14

contents of Memory Script: { backup as copy reuse targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/orapwdg1' auxiliary format '/u01/app/oracle/product/11.2.0/db_1/dbs/orapwdg2' targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/spfiledg1.ora' auxiliary format '/u01/app/oracle/product/11.2.0/db_1/dbs/spfiledg2.ora' ; sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfiledg2.ora''"; } executing Memory Script

Starting backup at 16-APR-14 Finished backup at 16-APR-14

sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfiledg2.ora''

contents of Memory Script: { sql clone "alter system set core_dump_dest = ''/u01/app/oracle/diag/rdbms/dg/dg2/cdump'' comment= '''' scope=spfile"; sql clone "alter system set db_unique_name = ''dg2'' comment= '''' scope=spfile"; sql clone "alter system set db_recovery_file_dest = ''/u01/app/oracle/fast_recovery_area'' comment= '''' scope=spfile"; sql clone "alter system set DB_RECOVERY_FILE_DEST_SIZE = 4G comment= '''' scope=spfile"; sql clone "alter system set control_files = ''/u01/app/oracle/oradata/dg/control01.ctl'' comment= '''' scope=spfile"; sql clone "alter system set db_create_file_dest = ''/u01/app/oracle/oradata/dg'' comment= '''' scope=spfile"; sql clone "alter system set db_create_online_log_dest_1 = ''/u01/app/oracle/oradata/dg'' comment= '''' scope=spfile"; sql clone "alter system set log_archive_max_processes = 5 comment= '''' scope=spfile"; sql clone "alter system set fal_client = ''dg2'' comment= '''' scope=spfile"; sql clone "alter system set fal_server = ''dg1'' comment= '''' scope=spfile"; sql clone "alter system set standby_file_management = ''AUTO'' comment= '''' scope=spfile"; sql clone "alter system set log_archive_config = ''dg_config=(dg1,dg2)'' comment= '''' scope=spfile"; sql clone "alter system set log_archive_dest_1 = ''location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles)'' comment= '''' scope=spfile"; sql clone "alter system set log_archive_dest_2 = ''service=dg1 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=dg1'' comment= '''' scope=spfile"; shutdown clone immediate; startup clone nomount; } executing Memory Script

sql statement: alter system set core_dump_dest = ''/u01/app/oracle/diag/rdbms/dg/dg2/cdump'' comment= '''' scope=spfile

sql statement: alter system set db_unique_name = ''dg2'' comment= '''' scope=spfile

sql statement: alter system set db_recovery_file_dest = ''/u01/app/oracle/fast_recovery_area'' comment= '''' scope=spfile

sql statement: alter system set DB_RECOVERY_FILE_DEST_SIZE = 4G comment= '''' scope=spfile

sql statement: alter system set control_files = ''/u01/app/oracle/oradata/dg/control01.ctl'' comment= '''' scope=spfile

sql statement: alter system set db_create_file_dest = ''/u01/app/oracle/oradata/dg'' comment= '''' scope=spfile

sql statement: alter system set db_create_online_log_dest_1 = ''/u01/app/oracle/oradata/dg'' comment= '''' scope=spfile

sql statement: alter system set log_archive_max_processes = 5 comment= '''' scope=spfile

sql statement: alter system set fal_client = ''dg2'' comment= '''' scope=spfile

sql statement: alter system set fal_server = ''dg1'' comment= '''' scope=spfile

sql statement: alter system set standby_file_management = ''AUTO'' comment= '''' scope=spfile

sql statement: alter system set log_archive_config = ''dg_config=(dg1,dg2)'' comment= '''' scope=spfile

sql statement: alter system set log_archive_dest_1 = ''location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles)'' comment= '''' scope=spfile

sql statement: alter system set log_archive_dest_2 = ''service=dg1 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=dg1'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started) Oracle instance started

Total System Global Area 313159680 bytes

Fixed Size 2252824 bytes Variable Size 171970536 bytes Database Buffers 134217728 bytes Redo Buffers 4718592 bytes allocated channel: ch8 channel ch8: SID=19 device type=DISK

contents of Memory Script: { backup as copy current controlfile for standby auxiliary format '/u01/app/oracle/oradata/dg/control01.ctl'; } executing Memory Script

Starting backup at 16-APR-14 channel ch1: starting datafile copy copying standby control file output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_dg1.f tag=TAG20140416T042545 RECID=19 STAMP=845007946 channel ch1: datafile copy complete, elapsed time: 00:00:03 Finished backup at 16-APR-14

contents of Memory Script: { sql clone 'alter database mount standby database'; } executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script: { set newname for clone tempfile 1 to new; switch clone tempfile all; set newname for clone datafile 1 to new; set newname for clone datafile 2 to new; set newname for clone datafile 3 to new; set newname for clone datafile 4 to new; backup as copy reuse datafile 1 auxiliary format new datafile 2 auxiliary format new datafile 3 auxiliary format new datafile 4 auxiliary format new ; sql 'alter system archive log current'; } executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_temp_%u_.tmp in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 16-APR-14 channel ch1: starting datafile copy input datafile file number=00001 name=/u01/app/oracle/oradata/dg/system01.dbf channel ch2: starting datafile copy input datafile file number=00002 name=/u01/app/oracle/oradata/dg/sysaux01.dbf channel ch3: starting datafile copy input datafile file number=00003 name=/u01/app/oracle/oradata/dg/undotbs01.dbf channel ch4: starting datafile copy input datafile file number=00004 name=/u01/app/oracle/oradata/dg/users01.dbf output file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_users_2ap5rj2m_.dbf tag=TAG20140416T042557 channel ch4: datafile copy complete, elapsed time: 00:00:07 output file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_undotbs1_29p5rj2m_.dbf tag=TAG20140416T042557 channel ch3: datafile copy complete, elapsed time: 00:00:45 output file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_sysaux_28p5rj2m_.dbf tag=TAG20140416T042557 channel ch2: datafile copy complete, elapsed time: 00:02:36 output file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_system_27p5rj2m_.dbf tag=TAG20140416T042557 channel ch1: datafile copy complete, elapsed time: 00:03:16 Finished backup at 16-APR-14

sql statement: alter system archive log current

contents of Memory Script: { switch clone datafile all; } executing Memory Script

datafile 1 switched to datafile copy input datafile copy RECID=19 STAMP=845008154 file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_system_27p5rj2m_.dbf datafile 2 switched to datafile copy input datafile copy RECID=20 STAMP=845008154 file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_sysaux_28p5rj2m_.dbf datafile 3 switched to datafile copy input datafile copy RECID=21 STAMP=845008154 file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_undotbs1_29p5rj2m_.dbf datafile 4 switched to datafile copy input datafile copy RECID=22 STAMP=845008154 file name=/u01/app/oracle/oradata/dg/DG2/datafile/o1_mf_users_2ap5rj2m_.dbf Finished Duplicate Db at 16-APR-14

sql statement: alter system set log_archive_max_processes=5

sql statement: alter system set fal_client=dg1

sql statement: alter system set fal_server=dg2

sql statement: alter system set standby_file_management=AUTO

sql statement: alter system set log_archive_config=''dg_config=(dg1,dg2)''

sql statement: alter system set log_archive_dest_2=''service=dg2 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=dg2''

sql statement: alter system set log_archive_dest_1=''location=USE_DB_RECOVERY_FILE_DEST valid_for=(all_logfiles,all_roles)''

sql statement: alter system archive log current

sql statement: alter database recover managed standby database using current logfile disconnect from session

released channel: ch1

released channel: ch2

released channel: ch3

released channel: ch4

released channel: ch5

released channel: ch6

released channel: ch7

released channel: ch8

RMAN>


驗證如下:

在備庫可以查看如下信息:

SQL> select * from v$log;

GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME ---------- ---------- ---------- ---------- ---------- ---------- --- ---------------- ------------- --------- ------------ --------- 1 1 35 52428800 512 1 YES CLEARING 1106799 16-APR-14 1106799 16-APR-14 3 1 34 52428800 512 1 YES CLEARING 1106413 16-APR-14 1105288 16-APR-14 2 1 35 52428800 512 1 YES CURRENT 1106799 16-APR-14 1104233 16-APR-14

SQL> select * from v$standby_log;

GROUP# DBID THREAD# SEQUENCE# BYTES BLOCKSIZE USED ARC STATUS FIRST_CHANGE# FIRST_TIM NEXT_CHANGE# NEXT_TIME LAST_CHANGE# LAST_TIME ---------- ---------------------------------------- ---------- ---------- ---------- ---------- ---------- --- ---------- ------------- --------- ------------ --------- ------------ --------- 4 1756848898 1 35 52428800 512 108544 YES ACTIVE 1106799 16-APR-14 1106904 16-APR-14 5 UNASSIGNED 1 0 52428800 512 0 NO UNASSIGNED 6 UNASSIGNED 0 0 52428800 512 0 YES UNASSIGNED 7 UNASSIGNED 0 0 52428800 512 0 YES UNASSIGNED

SQL> select process,status from v$managed_standby;

PROCESS STATUS --------- ------------ ARCH CLOSING ARCH CLOSING ARCH CONNECTED ARCH CONNECTED ARCH CONNECTED RFS IDLE MRP0 APPLYING_LOG RFS IDLE RFS IDLE RFS IDLE RFS IDLE

11 rows selected.

SQL>

注:在使用rman腳本的時候,非常要細心,或是因為一個單引號或是因為一個雙引號缺失就會導致整個任務失敗,對腳本要求比較嚴格。另外如何使用10G之前的rman方式,那麼需要將全部備份集copy到備庫,進而使用duplicate target database for standby dorecover nofilenamecheck;完成搭建。

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved