這篇文章主要介紹oracle dg如何安裝,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
成都創(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)定制、小程序制作服務(wù),打造合肥網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供合肥網(wǎng)站排名全網(wǎng)營(yíng)銷落地服務(wù)。
主備庫(kù)均為歸檔模式,并且force logging
==開啟歸檔并設(shè)為強(qiáng)制日志模式==
select log_mode,force_logging from v$database;
alter database archivelog;
alter database force logging;
===修改主庫(kù)參數(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ù)文件,修改后用于備庫(kù)===
create pfile='/tmp/tt/initdg01.ora' from spfile;
===tnsnames.ora和監(jiān)聽(兩端均為靜態(tài)監(jiān)聽)===
===復(fù)制主庫(kù)準(zhǔn)備好的參數(shù)文件和密碼文件到備庫(kù)===
環(huán)境準(zhǔn)備好后:
===備庫(kù)利用修改好的參數(shù)文件,啟動(dòng)數(shù)據(jù)庫(kù)到nomount狀態(tài)===
===主庫(kù)操作===
rman target / auxiliary sys/oracle@dg01
duplicate target database for standby from active database;
或者
duplicate target database for standby nonamefilecheck from active database;(無(wú)需目錄轉(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驗(yàn)證===
驗(yàn)證物理備庫(kù)是否工作:
檢查是否存在報(bào)錯(cuò):
select error,destination from v$archive_dest;
(1)在備庫(kù)上檢查已經(jīng)存在的歸檔日志
select sequence# , first_time , next_time from v$archived_log order by sequence#;
(2)在主庫(kù)上強(qiáng)制進(jìn)行日志切換,手動(dòng)歸檔
alter system switch logfile;
(3)在備庫(kù)上檢查歸檔日志(是否出現(xiàn)新的歸檔日志)
select sequence# , first_time , next_time from v$archived_log order by sequence#;
(4)檢查歸檔日志是否被“應(yīng)用”
select sequence# , applied from v$archived_log order by sequence#;
===當(dāng)備庫(kù)正在應(yīng)用日志,把備庫(kù)啟動(dòng)到只讀模式
停掉日志應(yīng)用
alter database recover managed standby database cancel;
以只讀方式打開備庫(kù)
alter database open;
當(dāng)數(shù)據(jù)庫(kù)處于只讀模式,把備庫(kù)切換到Redo Apply
1. 讓所有活動(dòng)的會(huì)話退出備庫(kù)
2. 日志應(yīng)用
alter database recover managed standby database disconnect from session;
或者(啟動(dòng)real-time apply)
alter database recover managed standby database using current logfile disconnect from session;
====主備切換===
1、主庫(kù)切換到備庫(kù)
查看主庫(kù)狀態(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 表示還有活動(dòng)的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;
重啟主庫(kù)
shutdown immediate
startup mount
alter database recover managed standby database disconnect from session;
select database_role,switchover_status from v$database;
to primary
2、備庫(kù)切換到主庫(kù)
select database_role,switchover_status from v$database;
to primary
alter database commit to switchover to primary;
shutdown immediate;
startup
alter system switch logfile;
重復(fù)驗(yàn)證dg。
=================
注意:
一般switchover切換都是計(jì)劃中的切換,特點(diǎn)是切換后,不會(huì)丟失任何數(shù)據(jù),而且這個(gè)過(guò)程是
可逆的,整個(gè)data guard環(huán)境不會(huì)被破壞,原來(lái)的data guard環(huán)境中的所有standby
都可以繼續(xù)工作。
在進(jìn)行data guard的物理standby切換前:
1)確認(rèn)主從庫(kù)之間的網(wǎng)絡(luò)連接暢通;
2)確認(rèn)沒(méi)有活動(dòng)的會(huì)話連接在數(shù)據(jù)庫(kù)中;
3)primary數(shù)據(jù)庫(kù)處于打開狀態(tài),standby數(shù)據(jù)庫(kù)處于mount狀態(tài)。
以上是“oracle dg如何安裝”這篇文章的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
網(wǎng)站標(biāo)題:oracledg如何安裝
網(wǎng)站網(wǎng)址:http://chinadenli.net/article32/iegepc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供面包屑導(dǎo)航、網(wǎng)站策劃、靜態(tài)網(wǎng)站、網(wǎng)站設(shè)計(jì)公司、App設(shè)計(jì)、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
網(wǎng)頁(yè)設(shè)計(jì)公司知識(shí)