測試DG環境

來源:互聯網
上載者:User

測試DG環境


環境

名稱

主庫

備庫

主機名稱

bjsrv

shsrv

軟體版本

RedHat Enterprise5.5、Oracle 11g 11.2.0.1

RedHat Enterprise5.5、Oracle 11g 11.2.0.1



1、測試過程簡記【補充】:修改scott密碼

SQL>conn /as sysdba

SQL>alter user scott identified by tiger;

 

 

SQL>connscott/scott

SQL>select* from tab;




SQL>createtable emp1 as select * from emp;

SQL>select* from tab;




在備庫上:

登陸scott,提示密碼不對(剛剛在主庫已經修改完密碼,如果是即時同步的話,在備庫上也應該可以用其登陸,但不成功。因為這驗證了主庫備庫的預設設定不是即時同步的模式)




預設DG只對歸檔日誌做recover。

要想即時同步,這需要啟動“即時應用”(因為只有recover了才會同步),後續課程中會介紹。

 

SQL>altersystem switch logfile;.

//主庫再切換一次,為了提供給備庫用以recover的歸檔日誌(其中包含密碼修改資訊)

備庫再次嘗試用新密碼登陸scott

SQL>conn scott/tiger               //登陸成功




SQL>select * from tab;               //備庫上操作查詢表資訊,成功顯示




驗證DG搭建成功。


2、主備庫資訊查詢主庫

在主庫上查詢

SQL>select name,dbid,database_role,protection_mode fromv$database;




庫名:TESTDB12

資料庫ID號:2811829300

主庫角色:主庫

保護模式:最大效能


備庫

在備庫上查詢

SQL>select name,dbid,database_role,protection_mode fromv$database;




庫名:TESTDB12

資料庫ID號:2811829300

主庫角色:物理備庫

保護模式:最大效能

 

資料檔案資訊:

SQL>select name from v$datafile;




記錄檔資訊:

SQL>select member from v$logfile;




********************後續更新中**************************

聲明:
         原創作品,出自 “深藍的blog” 部落格,允許轉載,轉載時請務必註明出處(http://blog.csdn.net/huangyanlong)。

         關於涉及著作權事宜,作者有權追究法律責任。



相關文章

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.