這篇文章主要介紹oracle dg如何安裝,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
成都創(chuàng)新互聯(lián)專注于合肥網(wǎng)站建設(shè)服務及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗。 熱誠為您提供合肥營銷型網(wǎng)站建設(shè),合肥網(wǎng)站制作、合肥網(wǎng)頁設(shè)計、合肥網(wǎng)站官網(wǎng)定制、小程序制作服務,打造合肥網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供合肥網(wǎng)站排名全網(wǎng)營銷落地服務。
主備庫均為歸檔模式,并且force logging
==開啟歸檔并設(shè)為強制日志模式==
select log_mode,force_logging from v$database;
alter database archivelog;
alter database force logging;
===修改主庫參數(shù)===
alter system set log_archive_config="dg_config=(db01,dg01)" scope=both;
alter system set standby_file_management=auto scope=both;
alter system set log_archive_dest_1="location=/oracle/app/oracle/oradata/arch/ valid_for=(all_logfiles,all_roles) db_unique_name=db01" scope=both;
alter system set log_archive_dest_state_1="enable";
alter system set log_archive_dest_2="service=dg01 lgwr async valid_for=(online_logfile,primary_role) db_unique_name=dg01" scope=both;
alter system set log_archive_dest_state_2="enable";
alter system set fal_server=dg01 scope=both;
alter system set fal_client=db01 scope=both;
alter system set db_file_name_convert="/oracle/app/oracle/oradata/dg01/","/oracle/app/oracle/oradata/db01/" scope=spfile;
alter system set log_file_name_convert="/oracle/app/oracle/oradata/dg01/","/oracle/app/oracle/oradata/db01/" scope=spfile;
===創(chuàng)建參數(shù)文件,修改后用于備庫===
create pfile='/tmp/tt/initdg01.ora' from spfile;
===tnsnames.ora和監(jiān)聽(兩端均為靜態(tài)監(jiān)聽)===
===復制主庫準備好的參數(shù)文件和密碼文件到備庫===
環(huán)境準備好后:
===備庫利用修改好的參數(shù)文件,啟動數(shù)據(jù)庫到nomount狀態(tài)===
===主庫操作===
rman target / auxiliary sys/oracle@dg01
duplicate target database for standby from active database;
或者
duplicate target database for standby nonamefilecheck from active database;(無需目錄轉(zhuǎn)換)
===建立standy log(redolog+1)===
alter database add standby logfile thread 1 group 11 '/oracle/app/oracle/oradata/dg01/standby_group_11.log' size 52428800;
alter database add standby logfile thread 1 group 12 '/oracle/app/oracle/oradata/dg01/standby_group_12.log' size 52428800;
alter database add standby logfile thread 1 group 13 '/oracle/app/oracle/oradata/dg01/standby_group_13.log' size 52428800;
===dg驗證===
驗證物理備庫是否工作:
檢查是否存在報錯:
select error,destination from v$archive_dest;
(1)在備庫上檢查已經(jīng)存在的歸檔日志
select sequence# , first_time , next_time from v$archived_log order by sequence#;
(2)在主庫上強制進行日志切換,手動歸檔
alter system switch logfile;
(3)在備庫上檢查歸檔日志(是否出現(xiàn)新的歸檔日志)
select sequence# , first_time , next_time from v$archived_log order by sequence#;
(4)檢查歸檔日志是否被“應用”
select sequence# , applied from v$archived_log order by sequence#;
===當備庫正在應用日志,把備庫啟動到只讀模式
停掉日志應用
alter database recover managed standby database cancel;
以只讀方式打開備庫
alter database open;
當數(shù)據(jù)庫處于只讀模式,把備庫切換到Redo Apply
1. 讓所有活動的會話退出備庫
2. 日志應用
alter database recover managed standby database disconnect from session;
或者(啟動real-time apply)
alter database recover managed standby database using current logfile disconnect from session;
====主備切換===
1、主庫切換到備庫
查看主庫狀態(tài):
select database_role,switchover_status from v$database;
to standby
alter database commit to switchover to physical standby;
備注:
A:switchover_status出現(xiàn)session active/not allow
session active 表示還有活動的session
alter database commit to switchover to physical standby with session shut down;
B:not allow,ora-01153:an incompatible media recovery is active
alter database recover managed standby database finish;
或者
alter database recover managed standby database finish force;
重啟主庫
shutdown immediate
startup mount
alter database recover managed standby database disconnect from session;
select database_role,switchover_status from v$database;
to primary
2、備庫切換到主庫
select database_role,switchover_status from v$database;
to primary
alter database commit to switchover to primary;
shutdown immediate;
startup
alter system switch logfile;
重復驗證dg。
=================
注意:
一般switchover切換都是計劃中的切換,特點是切換后,不會丟失任何數(shù)據(jù),而且這個過程是
可逆的,整個data guard環(huán)境不會被破壞,原來的data guard環(huán)境中的所有standby
都可以繼續(xù)工作。
在進行data guard的物理standby切換前:
1)確認主從庫之間的網(wǎng)絡(luò)連接暢通;
2)確認沒有活動的會話連接在數(shù)據(jù)庫中;
3)primary數(shù)據(jù)庫處于打開狀態(tài),standby數(shù)據(jù)庫處于mount狀態(tài)。
以上是“oracle dg如何安裝”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
網(wǎng)站標題:oracledg如何安裝
網(wǎng)站網(wǎng)址:http://muchs.cn/article32/iegepc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供面包屑導航、網(wǎng)站策劃、靜態(tài)網(wǎng)站、網(wǎng)站設(shè)計公司、App設(shè)計、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)