【12c】DataGuard物理備用資料庫(DUPLICATE方式)搭建詳細教程

来源:https://www.cnblogs.com/alen-liu-sz/archive/2020/05/27/12975557.html
-Advertisement-
Play Games

1 軟體環境 Oracle Linux 6.9 Oracle 12.1.0.2 主庫:sz.oracle.com,IP:192.168.1.102 備庫:sh.oracle.com,IP:192.168.1.103 2 主資料庫配置 2.1 檢查並設置資料庫 1)首先,主資料庫必須處於強制日誌(Fo ...


1 軟體環境

  • Oracle Linux 6.9
  • Oracle 12.1.0.2
  • 主庫:sz.oracle.com,IP:192.168.1.102
  • 備庫:sh.oracle.com,IP:192.168.1.103

2 主資料庫配置

2.1 檢查並設置資料庫

1)首先,主資料庫必須處於強制日誌(Force Logging)模式下運行,這是要防止主資料庫中存在直接的數據修改而不記錄日誌的行為。

檢查強制日誌模式如下:

SQL> select dbid,name,force_logging from v$database;

DBID NAME FORCE_LOGGING

---------- --------- ---------------------------------------

1565839253 ORCL NO

啟動強制日誌模式如下:

SQL> alter database force logging;



Database altered.

取消強制日誌模式如下:

SQL> alter database no force logging;



Database altered.

2)其次,檢查主資料庫的日誌運行模式,Data Guard要求主資料庫必須在歸檔模式下運行,此模式下資料庫可以連續完整的保存事務日誌。

SQL> archive log list

Database log mode No Archive Mode

Automatic archival Disabled

Archive destination USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence 11

Current log sequence 13

如果資料庫處在非歸檔模式,則需要做如下調整:

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.



Total System Global Area 1241513984 bytes

Fixed Size 2923872 bytes

Variable Size 452985504 bytes

Database Buffers 771751936 bytes

Redo Buffers 13852672 bytes

Database mounted.

SQL> alter database archivelog;



Database altered.



SQL> alter database open;



Database altered.



SQL> archive log list

Database log mode Archive Mode

Automatic archival Enabled

Archive destination USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence 11

Next log sequence to archive 13

Current log sequence 13

3)最後,要檢查資料庫實例的口令文件,Data Guard環境下的每個資料庫必須強制使用口令文件,並且備用資料庫口令文件中SYS用戶的口令必須和主資料庫SYS用戶的口令完全一致。若沒有,使用orapwd命令創建口令文件。

[oracle@sz ~]$ ll /u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapworcl

-rw-r----- 1 oracle oinstall 7680 Apr 18 13:41 /u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapworcl

2.2 設置必要的主資料庫參數

1)主備庫架構

按照如下所示的內容構建Data Guard環境,假設一個主庫在深圳,備庫在上海。

DG ROLE

DB_NAME

INSTANCE_NAME

DB_UNIQUE_NAME

TNS_NAME

主庫

orcl

orcl

orcl

shzhen

備庫

orcl

orcldg

orcldg

shhai

2)主庫配置參數

orcl.__data_transfer_cache_size=0

orcl.__db_cache_size=687865856

orcl.__java_pool_size=16777216

orcl.__large_pool_size=33554432

orcl.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment

orcl.__pga_aggregate_target=671088640

orcl.__sga_target=973078528

orcl.__shared_io_pool_size=0

orcl.__shared_pool_size=218103808

orcl.__streams_pool_size=0

*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'

*.audit_trail='db'

*.compatible='12.1.0.2.0'

*.control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/fast_recovery_area/orcl/control02.ctl'

*.db_block_size=8192

*.db_domain=''

*.db_name='orcl'

*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'

*.db_recovery_file_dest_size=4560m

*.diagnostic_dest='/u01/app/oracle'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'

*.local_listener='LISTENER_ORCL'

*.log_archive_format='%t_%s_%r.dbf'

*.memory_target=1560m

*.open_cursors=300

*.processes=300

*.remote_login_passwordfile='EXCLUSIVE'

*.undo_tablespace='UNDOTBS1'



#############################The following is adding for DG by Alen Liu 2020-04-19####################################

DB_UNIQUE_NAME=orcl

LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,orcldg)'

LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST

VALID_FOR=(ALL_LOGFILES,ALL_ROLES)

DB_UNIQUE_NAME=orcl'

LOG_ARCHIVE_DEST_2=

'SERVICE=shhai LGWR ASYNC

VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)

DB_UNIQUE_NAME=orcldg'

LOG_ARCHIVE_DEST_STATE_1=ENABLE

LOG_ARCHIVE_DEST_STATE_2=ENABLE

REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE

STANDBY_FILE_MANAGEMENT=AUTO

FAL_SERVER=orcldg

FAL_CLIENT=orcl



DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcldg','/u01/app/oracle/oradata/orcl'

LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcldg','/u01/app/oracle/oradata/orcl'

#############################The following is adding for DG by Alen Liu 2020-04-19####################################

3)設置網路配置

[oracle@sz admin]$ cat tnsnames.ora

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.



SHHAI =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.103)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcldg)

)

)



LISTENER_ORCL =

(ADDRESS = (PROTOCOL = TCP)(HOST = sz.oracle.com)(PORT = 1521))





SHZHEN =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.102)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcl)

)

)



ORCL =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = sz.oracle.com)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

3 備用資料庫配置

3.1 配置密碼文件

將主庫的密碼文件拷貝至備庫,並修改名稱。

1)主庫傳送文件

[oracle@sz dbs]$ scp orapworcl [email protected]:$ORACLE_HOME/dbs/orapworcldg

[email protected]'s password:

orapworcl 100% 7680 7.5KB/s 00:00

2)備庫檢查文件

[oracle@sh ~]$ ll /u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapworcldg

-rw-r----- 1 oracle oinstall 7680 Apr 19 17:28 /u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapworcldg

3.2 設置網路配置

將主庫的設置好的網路文件拷貝至備庫。

1)主庫傳送文件

[oracle@sz admin]$ scp tnsnames.ora [email protected]:/u01/app/oracle/product/12.1.0/dbhome_1/network/admin/

[email protected]'s password:

tnsnames.ora 100% 809 0.8KB/s 00:00

2)備庫檢查文件

[oracle@sh ~]$ cat /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora

# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.1.0/dbhome_1/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.



SHHAI =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.103)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcldg)

)

)



LISTENER_ORCL =

(ADDRESS = (PROTOCOL = TCP)(HOST = sh.oracle.com)(PORT = 1521))





SHZHEN =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.102)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcl)

)

)



ORCL =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = sz.oracle.com)(PORT = 1521))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl)

)

)

3.3 設置初始化參數文件

1)將主庫的pfile傳送至備庫,並做適當調整。

[oracle@sz dbs]$ scp initorcl.ora [email protected]:$ORACLE_HOME/dbs/initorcldg.ora

The authenticity of host '192.168.56.103 (192.168.56.103)' can't be established.

RSA key fingerprint is bd:22:31:30:20:8f:b1:12:3a:0c:dd:db:5b:f0:8f:12.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.56.103' (RSA) to the list of known hosts.

[email protected]'s password:

initorcl.ora 100% 1869 1.8KB/s 00:00

2)檢查備庫文件

[oracle@sh dbs]$ cat initorcldg.ora

orcl.__data_transfer_cache_size=0

orcl.__db_cache_size=687865856

orcl.__java_pool_size=16777216

orcl.__large_pool_size=33554432

orcl.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment

orcl.__pga_aggregate_target=671088640

orcl.__sga_target=973078528

orcl.__shared_io_pool_size=0

orcl.__shared_pool_size=218103808

orcl.__streams_pool_size=0

*.audit_file_dest='/u01/app/oracle/admin/orcldg/adump'

*.audit_trail='db'

*.compatible='12.1.0.2.0'

#*.control_files='/u01/app/oracle/oradata/orcl/control01.ctl','/u01/app/oracle/fast_recovery_area/orcl/control02.ctl'

*.db_block_size=8192

*.db_domain=''

*.db_name='orcl'

*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'

*.db_recovery_file_dest_size=4560m

*.diagnostic_dest='/u01/app/oracle'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'

*.local_listener='LISTENER_ORCL'

*.log_archive_format='%t_%s_%r.dbf'

*.memory_target=1560m

*.open_cursors=300

*.processes=300

*.remote_login_passwordfile='EXCLUSIVE'

*.undo_tablespace='UNDOTBS1'



#############################The following is adding for DG by Alen Liu 2017-09-11####################################

DB_UNIQUE_NAME=orcldg

LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,orcldg)'

LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST

VALID_FOR=(ALL_LOGFILES,ALL_ROLES)

DB_UNIQUE_NAME=orcldg'

LOG_ARCHIVE_DEST_2=

'SERVICE=shzhen LGWR ASYNC

VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)

DB_UNIQUE_NAME=orcl'

LOG_ARCHIVE_DEST_STATE_1=ENABLE

LOG_ARCHIVE_DEST_STATE_2=ENABLE

REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE

STANDBY_FILE_MANAGEMENT=AUTO

FAL_SERVER=orcl

FAL_CLIENT=orcldg



DB_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl','/u01/app/oracle/oradata/orcldg'

LOG_FILE_NAME_CONVERT='/u01/app/oracle/oradata/orcl','/u01/app/oracle/oradata/orcldg'

#############################The following is adding for DG by Alen Liu 2017-09-11####################################

4 Data Guard搭建

4.1 主庫使用新創建的配置文件

SQL> startup

ORACLE instance started.



Total System Global Area 1644167168 bytes

Fixed Size 2925024 bytes

Variable Size 1056968224 bytes

Database Buffers 570425344 bytes

Redo Buffers 13848576 bytes

Database mounted.

Database opened.

SQL> create spfile from pfile;



File created.

4.2 備庫啟動至NOMOUNT狀態

SQL> startup nomount

ORACLE instance started.



Total System Global Area 1644167168 bytes

Fixed Size 2925024 bytes

Variable Size 1056968224 bytes

Database Buffers 570425344 bytes

Redo Buffers 13848576 bytes

SQL> create spfile from pfile;



File created.

4.3 啟動DUPLICATE資料庫複製

[oracle@sh ~]$ rman target sys/system@shzhen auxiliary sys/system@shhai



Recovery Manager: Release 12.1.0.2.0 - Production on Sun Apr 19 17:58:55 2020



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



connected to target database: ORCL (DBID=1565938253)

connected to auxiliary database: ORCL (not mounted)



RMAN> duplicate target database for standby from active database dorecover nofilenamecheck;



Starting Duplicate Db at 19-APR-20

using target database control file instead of recovery catalog

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=23 device type=DISK

current log archived



contents of Memory Script:

{

backup as copy reuse

targetfile '/u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapworcl' auxiliary format

'/u01/app/oracle/product/12.1.0/dbhome_1/dbs/orapworcldg' ;

}

executing Memory Script



Starting backup at 19-APR-20

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=46 device type=DISK

Finished backup at 19-APR-20



contents of Memory Script:

{

sql clone "create spfile from memory";

shutdown clone immediate;

startup clone nomount;

restore clone from service 'shzhen' standby controlfile;

}

executing Memory Script



sql statement: create spfile from memory



Oracle instance shut down



connected to auxiliary database (not started)

Oracle instance started



Total System Global Area 1644167168 bytes



Fixed Size 2925024 bytes

Variable Size 1073745440 bytes

Database Buffers 553648128 bytes

Redo Buffers 13848576 bytes



Starting restore at 19-APR-20

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=22 device type=DISK



channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: using network backup set from service shzhen

channel ORA_AUX_DISK_1: restoring control file

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:02

output file name=/u01/app/oracle/fast_recovery_area/ORCLDG/controlfile/o1_mf_h9r8963y_.ctl

Finished restore at 19-APR-20



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 tempfile 1 to

"/u01/app/oracle/oradata/orcldg/temp01.dbf";

switch clone tempfile all;

set newname for datafile 1 to

"/u01/app/oracle/oradata/orcldg/system01.dbf";

set newname for datafile 3 to

"/u01/app/oracle/oradata/orcldg/sysaux01.dbf";

set newname for datafile 4 to

"/u01/app/oracle/oradata/orcldg/undotbs01.dbf";

set newname for datafile 5 to

"/u01/app/oracle/oradata/orcldg/example01.dbf";

set newname for datafile 6 to

"/u01/app/oracle/oradata/orcldg/users01.dbf";

restore

from service 'shzhen' clone database

;

sql 'alter system archive log current';

}

executing Memory Script



executing command: SET NEWNAME



renamed tempfile 1 to /u01/app/oracle/oradata/orcldg/temp01.dbf in control file



executing command: SET NEWNAME



executing command: SET NEWNAME



executing command: SET NEWNAME



executing command: SET NEWNAME



executing command: SET NEWNAME



Starting restore at 19-APR-20

using channel ORA_AUX_DISK_1



channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: using network backup set from service shzhen

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/orcldg/system01.dbf

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25

channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: using network backup set from service shzhen

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/orcldg/sysaux01.dbf

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25

channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: using network backup set from service shzhen

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/orcldg/undotbs01.dbf

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07

channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: using network backup set from service shzhen

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/orcldg/example01.dbf

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:16

channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: using network backup set from service shzhen

channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/orcldg/users01.dbf

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01

Finished restore at 19-APR-20



sql statement: alter system archive log current

current log archived



contents of Memory Script:

{

restore clone force from service 'shzhen'

archivelog from scn 1792397;

switch clone datafile all;

}

executing Memory Script



Starting restore at 19-APR-20

using channel ORA_AUX_DISK_1



channel ORA_AUX_DISK_1: starting archived log restore to default destination

channel ORA_AUX_DISK_1: using network backup set from service shzhen

channel ORA_AUX_DISK_1: restoring archived log

archived log thread=1 sequence=12

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01

channel ORA_AUX_DISK_1: starting archived log restore to default destination

channel ORA_AUX_DISK_1: using network backup set from service shzhen

channel ORA_AUX_DISK_1: restoring archived log

archived log thread=1 sequence=13

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01

Finished restore at 19-APR-20



datafile 1 switched to datafile copy

input datafile copy RECID=1 STAMP=1038160949 file name=/u01/app/oracle/oradata/orcldg/system01.dbf

datafile 3 switched to datafile copy

input datafile copy RECID=2 STAMP=1038160949 file name=/u01/app/oracle/oradata/orcldg/sysaux01.dbf

datafile 4 switched to datafile copy

input datafile copy RECID=3 STAMP=1038160949 file name=/u01/app/oracle/oradata/orcldg/undotbs01.dbf

datafile 5 switched to datafile copy

input datafile copy RECID=4 STAMP=1038160949 file name=/u01/app/oracle/oradata/orcldg/example01.dbf

datafile 6 switched to datafile copy

input datafile copy RECID=5 STAMP=1038160949 file name=/u01/app/oracle/oradata/orcldg/users01.dbf



contents of Memory Script:

{

set until scn 1793777;

recover

standby

clone database

delete archivelog

;

}

executing Memory Script



executing command: SET until clause



Starting recover at 19-APR-20

using channel ORA_AUX_DISK_1



starting media recovery



archived log for thread 1 with sequence 12 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2020_04_19/o1_mf_1_12_h9r8fm03_.arc

archived log for thread 1 with sequence 13 is already on disk as file /u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2020_04_19/o1_mf_1_13_h9r8fn6x_.arc

archived log file name=/u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2020_04_19/o1_mf_1_12_h9r8fm03_.arc thread=1 sequence=12

archived log file name=/u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2020_04_19/o1_mf_1_13_h9r8fn6x_.arc thread=1 sequence=13

media recovery complete, elapsed time: 00:00:01

Finished recover at 19-APR-20

Finished Duplicate Db at 19-APR-20

4.4 啟動備庫,並查看其狀態

SQL> alter database open;



Database altered.



SQL> select name,open_mode,protection_mode,database_role from v$database;



NAME OPEN_MODE PROTECTION_MODE DATABASE_ROLE

--------- -------------------- -------------------- ----------------

ORCL READ ONLY MAXIMUM PERFORMANCE PHYSICAL STANDBY

4.5 備庫啟動Redo應用

SQL> alter database recover managed standby database disconnect from session;



Database altered.

4.6 主庫創建測試數據

SQL> create table scott.test(id number,name varchar2(100));



Table created.



SQL> insert into scott.test values(1,'Alen');



1 row created.



SQL> commit;



Commit complete.



SQL> alter system switch logfile;



System altered.

4.7 備庫驗證

SQL> select * from scott.test;



ID NAME

---------- ----------------------------------------------------------------------------------------------------

1 Alen

告警日誌:

alter database recover managed standby database disconnect from session

Sun Apr 19 18:15:44 2020

WARNING: There are no standby redo logs.

Standby redo logs should be configured for real time apply. Real time apply will be ignored.

Sun Apr 19 18:15:44 2020

Attempt to start background Managed Standby Recovery process (orcldg)

Starting background process MRP0

Sun Apr 19 18:15:44 2020

MRP0 started with pid=36, OS id=812

Sun Apr 19 18:15:44 2020

MRP0: Background Managed Standby Recovery process started (orcldg)

Sun Apr 19 18:15:49 2020

Serial Media Recovery started

Managed Standby Recovery not using Real Time Apply

Sun Apr 19 18:15:49 2020

Waiting for all non-current ORLs to be archived...

Sun Apr 19 18:15:49 2020

All non-current ORLs have been archived.

Sun Apr 19 18:15:49 2020

Media Recovery Log /u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2020_04_19/o1_mf_1_14_h9r8pmo1_.arc

Media Recovery Waiting for thread 1 sequence 15 (in transit)

Completed: alter database recover managed standby database disconnect from session

Sun Apr 19 18:16:33 2020

Archived Log entry 4 added for thread 1 sequence 15 rlc 1038157520 ID 0x5d570e4d dest 2:

RFS[1]: No standby redo logfiles created

RFS[1]: Opened log for thread 1 sequence 16 dbid 1565938253 branch 1038157520

Sun Apr 19 18:16:34 2020

Media Recovery Log /u01/app/oracle/fast_recovery_area/ORCLDG/archivelog/2020_04_19/o1_mf_1_15_h9r8rz29_.arc

Resize operation completed for file# 3, old size 675840K, new size 706560K

Media Recovery Waiting for thread 1 sequence 16 (in transit)

顯示沒有備庫standby redolog,創建即可。

WARNING: There are no standby redo logs.

SQL> alter database add standby logfile group 4 ('/u01/app/oracle/oradata/orcl/redo04.log') size 50M;



Database altered.



SQL> alter database add standby logfile group 5 ('/u01/app/oracle/oradata/orcl/redo05.log') size 50M;



Database altered.



SQL> alter database add standby logfile group 6 ('/u01/app/oracle/oradata/orcl/redo06.log') size 50M;



Database altered.



SQL> alter database add standby logfile group 7 ('/u01/app/oracle/oradata/orcl/redo07.log') size 50M;



Database altered.

至此,基於DUPLICATE構建物理備用資料庫完成。


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 下麵我們就來安裝Linux操作系統吧~ 首先你得確認自己有沒有下好ISO鏡像文件,就是下圖這個東西 然後打開虛擬機,找到虛擬機設置, 啟動虛擬機,選擇install Centos7 一直按回車鍵,進入光碟檢測界面,按ESC跳過檢測 來到選擇語言界面,這裡選擇English 下一步後,來到 instl ...
  • 可以使用Oracle內置的程式包DBMS_STATS來查看或修改搜集的資料庫統計信息,本篇主要介紹GATHER_TABLE_STATS過程,通過該過程,可以搜集表和列(或索引)的統計信息。 1 語法 dbms_stats.gather_table_stats(ownname varchar2, ta ...
  • 在Oracle資料庫中,優化器欲產生最優的執行計劃,需要依賴於相關對象的統計信息的搜集。資料庫可以自動的搜集執行計劃,也可以使用程式包DBMS_STATS進行手動搜集,本篇對常規統計信息的搜集不做說明,重點演示下關於擴展的統計信息(Extended Statistics)的的搜集。 1 擴展的統計信 ...
  • 直方圖,一種特殊類型的列的統計信息,它能提供表中列的更詳細的數據分佈信息,直方圖將值存放於桶(buckets)中。基於不同值的數目和數據的分佈,資料庫選擇要創建的直方圖類型,直方圖的類型有如下幾種: 頻率直方圖和頂頻直方圖:Frequency histograms and to frequency ...
  • 問題描述: 在Grid環境中,如果修改了主機名,啟動Grid時會出現如下錯誤: [grid@sztest ~]$ sqlplus / as sysasm SQL*Plus: Release 12.1.0.2.0 Production on Wed Apr 15 20:42:27 2020 Copyr ...
  • SRVCTL,服務控制實用工具(Service Control Utility),可用於對Oracle Restart和Oracle RAC的配置和管理,本篇主要介紹SRVCTL命令在Oracle Restart中的應用,其中,詳細介紹config、status命令,併列出其它命令的用法。 1 sr ...
  • Data Guard環境中資料庫的角色轉換有兩種,分別為Switchover和Failover,通過名稱可知,前者是正常的主備庫之間的角色切換,該切換方式不會丟失數據;後者是故障切換,即主庫不能繼續提供服務的切換,可能發生數據丟失。從12.1版本開始,切換到物理備庫的操作得以簡化,本篇分別對這兩種切 ...
  • 由於主庫和備庫的db_name相同的,只是db_unique_name不同,可以使用備庫進行資料庫的備份,從而減輕主庫備份的負擔。本篇演示DataGuard環境下RMAN工具的使用。 1 查看主庫RMAN配置 [oracle@sz ~]$ rman target / catalog rman/rma ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...