Linux 下 Oracle 11g DG搭建

來源:互聯網
上載者:User

標籤:ada   parameter   模式   space   min   ram   create   base   iar   

環境:類比主庫的建立 使用DBCA 啟動圖形介面 選項中的install option  --->選中create and configure a database  

          類比備庫的建立 使用DBCA 啟動圖形介面 選項中的install option  --->選中install database software only


準備工作  使用Oracle 11g的RMAN功能進行資料庫複製(資料庫複製 保證主庫與備庫在軟體上保持完全一致)

主庫(porcl 192.168.1.11)

修改參數db_unique_name

show parameter db_unique_name;alter system set db_unique_name='porcl' scope=spfile;shutdown immediate

開啟資料庫歸檔模式

startup mountalter database archivelog;alter database open;

配置靜態網路(這裡採用netmgr的圖形介面)

添加 database service

porcl                                sorcl                                porcl_DGMGRL

/u01/app/oracle/11g      /u01/app/oracle/11g      /u01/app/oracle/11g

orcl                                  orcl                                 orcl

重啟監聽

配置本地命名解析tnsnames.ora

orcl     ----->  192.168.1.11

porcl   ----->  192.168.1.11

sorcl    -----> 192.168.1.10

建立參數檔案

create pfile from spfile;

拷貝參數檔案、密碼檔案到備庫主機

scp initorcl.ora orapworcl  192.168.1.10:/u01/oracle/11g/dbs/

增加備庫日誌

alter database add standby logfile group 10;alter database add standby logfile group 11;alter database add standby logfile group 12;alter database add standby logfile group 13;

備庫(sorcl 192.168.1.10)

配置靜態網路

添加 database service

porcl                                sorcl                                sorcl_DGMGRL

/u01/app/oracle/11g      /u01/app/oracle/11g      /u01/app/oracle/11g

orcl                                  orcl                                 orcl

重啟監聽

配置本地命名解析tnsnames.ora

orcl     ----->  192.168.1.10

porcl   ----->  192.168.1.11

sorcl    -----> 192.168.1.10

修改參數檔案(遠程拷貝的initorcl.ora)

將 db_unique_name 置為 sorcl

(將參數檔案目錄下spfileorcl.ora刪除,如果有的話)

建立必要的檔案夾

grep "/u01" initupdb.oramkdir /u01/oracle/admin/updb/adump /u01/oracle/oradata/updb /u01/oracle/fast_recovery_area/updb -p

設定環境變數 ORACLE_SID

export ORACLE_SID=orcl

使用initorcl.ora啟動到nomount狀態

startup nomount

產生spfile

create spfile from pfile;

重新啟動到nomount狀態

startup force nomount

增加備庫日誌

alter database add standby logfile group 10;alter database add standby logfile group 11;alter database add standby logfile group 12;alter database add standby logfile group 13;


從主庫上複製備庫

rman target sys/[email protected] auxiliary sys/[email protected]duplicate target database for standby from active database nofilenamecheck;exit



實現DG

設定(主備庫都設定)參數dg_broker_Start=true

alter system set dg_broker_Start=true;


使用dgmgrl命令建立並生效設定檔

dgmgrl sys/[email protected]create configuration dgc as primary database is pupdb;add database  supdb as connect identifier is supdb maintained as physical;enable configuration;show configuration;



可能出現的問題

  1. 使用rman 串連主備庫時提示缺少許可權的報錯----->主庫與備庫的網路連接錯誤,請重新檢查網路設定和本地命名解析

  2. show configuration 備庫 提示出現警告備庫的某個屬性設定有問題,但是檢查沒有問題------->重啟備庫




Linux 下 Oracle 11g DG搭建

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.