1、使用組合鍵“Win + R”打開運(yùn)行對(duì)話框,在輸入框中輸入?regedit 并回車打開“注冊(cè)表編輯器”。
創(chuàng)新互聯(lián)專注于三原網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠(chéng)為您提供三原營(yíng)銷型網(wǎng)站建設(shè),三原網(wǎng)站制作、三原網(wǎng)頁(yè)設(shè)計(jì)、三原網(wǎng)站官網(wǎng)定制、成都小程序開發(fā)服務(wù),打造三原網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供三原網(wǎng)站排名全網(wǎng)營(yíng)銷落地服務(wù)。
2、在“注冊(cè)表編輯器”對(duì)話框,依次展開 HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraDb10g_home1名稱為 ORACLE_SID 的數(shù)據(jù) orcl 即 Oracle數(shù)據(jù)庫(kù)的SID。
3、在遠(yuǎn)程連接工具 XShell使用 root 用戶或者 oracle 用戶連接 Linux/Unix Oracle數(shù)據(jù)庫(kù)服務(wù)器。
4、輸入命令 su - oracle 切換到 oracle 用戶即可。
oracle dg 三大模式切換
1、最大性能模式MAXIMUM PERFORMANCE --默認(rèn)模式,最大性能模式特點(diǎn)。
192.168.1.181
SQL?select?database_role,protection_mode,protection_level?from?v$database;
DATABASE_ROLE??PROTECTION_MODE???PROTECTION_LEVEL
----------------?--------------------?--------------------
PRIMARY?????MAXIMUM?PERFORMANCE?MAXIMUM?PERFORMANCE
SQL?col?dest_name?for?a25
SQL?select?dest_name,status?from?v$archive_dest_status;
DEST_NAME?????????STATUS
-------------------------?---------
LOG_ARCHIVE_DEST_1????VALID
LOG_ARCHIVE_DEST_2????VALID
SQL?show?parameter?log_archive
NAME?????????????????TYPE????VALUE
------------------------------------?-----------?---------------------------
log_archive_config??????????string???dg_config=(orcl,db01)
log_archive_dest_1??????????string???location=/home/oracle/arch_orc
l?valid_for=(all_logfiles,all_
roles)?db_unique_name=orcl
log_archive_dest_2??????????string???service=db_db01?LGWR?ASYNC?val
id_for=(online_logfiles,primar
y_roles)?db_unique_name=db01
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_orcl
Oldest?online?log?sequence???31
Next?log?sequence?to?archive??33
Current?log?sequence??????33
192.168.1.183
SQL?select?database_role,protection_mode,protection_level?from?v$database;
DATABASE_ROLE??PROTECTION_MODE???PROTECTION_LEVEL
----------------?--------------------?--------------------
PHYSICAL?STANDBY?MAXIMUM?PERFORMANCE?MAXIMUM?PERFORMANCE
SQL?col?dest_name?for?a25
SQL?select?dest_name,status?from?v$archive_dest_status;
DEST_NAME?????????STATUS
-------------------------?---------
LOG_ARCHIVE_DEST_1????VALID
LOG_ARCHIVE_DEST_2????VALID
SQL?show?parameter?log_archive
NAME?????????????????TYPE????VALUE
------------------------------------?-----------?---------------------------
log_archive_config??????????string???dg_config=(db01,orcl)
log_archive_dest_1??????????string???location=/home/oracle/arch_db0
1?valid_for=(all_logfiles,all_
roles)?db_unique_name=db01
log_archive_dest_2??????????string???service=db_orcl?LGWR?ASYNC?val
id_for=(online_logfiles,primar
y_roles)?db_unique_name=orcl
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_orcl
Oldest?online?log?sequence???31
Next?log?sequence?to?archive??33
Current?log?sequence??????33
192.168.1.181
SQL?alter?system?switch?logfile;
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_orcl
Oldest?online?log?sequence???32
Next?log?sequence?to?archive??34
Current?log?sequence??????34
192.168.1.183
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_db01
Oldest?online?log?sequence???32
Next?log?sequence?to?archive??0
Current?log?sequence??????34
2 、最大性能模式--切換到--最大高可用 ?(默認(rèn)是最大性能模式---MAXIMUM PERFORMANCE)。
192.168.1.181
SQL?select?DATABASE_ROLE,PROTECTION_MODE,PROTECTION_LEVEL?from?v$database;?
DATABASE_ROLE??PROTECTION_MODE???PROTECTION_LEVEL
----------------?--------------------?--------------------
PRIMARY?????MAXIMUM?PERFORMANCE?MAXIMUM?PERFORMANCE
SQL?show?parameter?log_archive_dest_2
NAME?????????????????TYPE????VALUE
------------------------------------?-----------?---------------------------
log_archive_dest_2??????????string???service=db_db01?LGWR?ASYNC?val
id_for=(online_logfiles,primar
y_roles)?db_unique_name=db01
192.168.1.181
SQL?shutdown?immediate
192.168.1.183
SQL?alter?database?recover?managed?standby?database?cancel;
SQL?shutdown?immediate
192.168.1.181
SQL?startup?mount;
SQL?alter?database?set?standby?database?to?maximize?availability;
SQL?alter?system?set?log_archive_dest_2='service=db_db01?LGWR?SYNC?valid_for=(online_logfiles,primary_roles)?db_unique_name=db01'?scope=spfile;
192.168.1.183
SQL?startup?nomount
SQL?alter?database?mount?standby?database;
SQL?alter?system?set?log_archive_dest_2='service=db_orcl?LGWR?SYNC?valid_for=(online_logfiles,primary_roles)?db_unique_name=orcl'?scope=spfile;
SQL?shutdown?immediate
SQL?startup?nomount
SQL?alter?database?mount?standby?database;
192.168.1.181
SQL?startup
SQL?col?dest_name?for?a25
SQL?select?dest_name,status?from?v$archive_dest_status;
DEST_NAME?????????STATUS
-------------------------?---------
LOG_ARCHIVE_DEST_1????VALID
LOG_ARCHIVE_DEST_2????VALID
SQL?show?parameter?log_archive_dest_2
NAME?????????????????TYPE????VALUE
------------------------------------?-----------?---------------------------
log_archive_dest_2??????????string???service=db_db01?LGWR?SYNC?vali
d_for=(online_logfiles,primary
_roles)?db_unique_name=db01
SQL?select?database_role,protection_level,protection_mode?from?v$database;
DATABASE_ROLE??PROTECTION_LEVEL???PROTECTION_MODE
----------------?--------------------?--------------------
PRIMARY?????MAXIMUM?AVAILABILITY?MAXIMUM?AVAILABILITY
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_orcl
Oldest?online?log?sequence???34
Next?log?sequence?to?archive??36
Current?log?sequence??????36
192.168.1.183
SQL?col?dest_name?for?a25
SQL?select?dest_name,status?from?v$archive_dest_status;
DEST_NAME?????????STATUS
-------------------------?---------
LOG_ARCHIVE_DEST_1????VALID
LOG_ARCHIVE_DEST_2????VALID
SQL?show?parameter?log_archive_dest_2
NAME?????????????????TYPE????VALUE
------------------------------------?-----------?---------------------------
log_archive_dest_2??????????string???service=db_orcl?LGWR?SYNC?vali
d_for=(online_logfiles,primary
_roles)?db_unique_name=orcl
SQL?select?database_role,protection_level,protection_mode?from?v$database;
DATABASE_ROLE??PROTECTION_LEVEL???PROTECTION_MODE
----------------?--------------------?--------------------
PHYSICAL?STANDBY?MAXIMUM?AVAILABILITY?MAXIMUM?AVAILABILITY
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_db01
Oldest?online?log?sequence???35
Next?log?sequence?to?archive??0
Current?log?sequence??????36
192.168.1.181
SQL?alter?system?switch?logfile;
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_orcl
Oldest?online?log?sequence???35
Next?log?sequence?to?archive??37
Current?log?sequence??????37
192.168.1.183
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_db01
Oldest?online?log?sequence???36
Next?log?sequence?to?archive??0
Current?log?sequence??????37
3、最大高可用--切換到--最保護(hù)能模式,DG最大保護(hù)模式Maximum protection。
192.168.1.181
SQL?shutdown?immediate
192.168.1.183
SQL?shutdown?immediate
192.168.1.181
SQL?alter?database?set?standby?database?to?maximize?protection;
SQL?shutdown?immediate
192.168.1.183
SQL?startup?nomount
SQL?alter?database?mount?standby?database;
192.168.1.181
SQL?startup
SQL?col?dest_name?for?a25
SQL?select?dest_name,status?from?v$archive_dest_status;
DEST_NAME?????????STATUS
-------------------------?---------
LOG_ARCHIVE_DEST_1????VALID
LOG_ARCHIVE_DEST_2????VALID
SQL?show?parameter?log_archive_dest_2
NAME?????????????????TYPE????VALUE
------------------------------------?-----------?---------------------------
log_archive_dest_2??????????string???service=db_db01?LGWR?SYNC?vali
d_for=(online_logfiles,primary
_roles)?db_unique_name=db01
SQL?select?database_role,protection_level,protection_mode?from?v$database;
DATABASE_ROLE??PROTECTION_LEVEL???PROTECTION_MODE
----------------?--------------------?--------------------
PRIMARY?????MAXIMUM?PROTECTION??MAXIMUM?PROTECTION
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_orcl
Oldest?online?log?sequence???37
Next?log?sequence?to?archive??39
Current?log?sequence??????39
192.168.1.183
SQL?col?dest_name?for?a25
SQL?select?dest_name,status?from?v$archive_dest_status;
DEST_NAME?????????STATUS
-------------------------?---------
LOG_ARCHIVE_DEST_1????VALID
LOG_ARCHIVE_DEST_2????VALID
SQL?show?parameter?log_archive_dest_2
NAME?????????????????TYPE????VALUE
------------------------------------?-----------?---------------------------
log_archive_dest_2??????????string???service=db_db01?LGWR?SYNC?vali
d_for=(online_logfiles,primary
_roles)?db_unique_name=db01
SQL?select?database_role,protection_level,protection_mode?from?v$database;
DATABASE_ROLE??PROTECTION_LEVEL???PROTECTION_MODE
----------------?--------------------?--------------------
PRIMARY?????MAXIMUM?PROTECTION??MAXIMUM?PROTECTION
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_db01
Oldest?online?log?sequence???37
Next?log?sequence?to?archive??0
Current?log?sequence??????39
192.168.1.181
SQL?alter?system?switch?logfile;
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_orcl
Oldest?online?log?sequence???38
Next?log?sequence?to?archive??40
Current?log?sequence??????40
192.168.1.183
SQL?archive?log?list
Database?log?mode???????Archive?Mode
Automatic?archival???????Enabled
Archive?destination??????/home/oracle/arch_db01
Oldest?online?log?sequence???37
Next?log?sequence?to?archive??0
Current?log?sequence??????40
有兩種模式:
一:日志模式,日志模式的設(shè)置分為Archive
Mode和No
Archive
Mode。
二:自動(dòng)歸檔模式:自動(dòng)歸檔模式的設(shè)置分為:Enabled和Disabled
可用可用archive
log
list命令來(lái)查看數(shù)據(jù)庫(kù)的現(xiàn)行日志和自動(dòng)歸檔模式的設(shè)置。
希望對(duì)你有幫助。