Oracle之steam主從資料庫同步

來源:互聯網
上載者:User

1、 修改系統參數

alter system set aq_tm_processes=2 scope=both;
alter system set global_names=true scope=both;
alter system set job_queue_processes=20 scope=both;
alter system set parallel_max_servers=20 scope=both;
alter system set undo_retention=3600 scope=both;
alter system set nls_date_format=’YYYY-MM-DD HH24:MI:SS’ scope=spfile;
alter system set streams_pool_size=25M scope=spfile;
alter system set utl_file_dir=’*’ scope=spfile;
alter system set open_links=4 scope=spfile;
alter system set log_archive_dest=’/founder/Oracle/arch’ scope=spfile;
alter system set log_archive_start=TRUE scope=spfile;
alter system set log_archive_format=’arch%t_%s_%r.arc’ scope=spfile;

#啟用Database 追加日誌
SQL> alter database add supplemental log data ;
資料庫已更改。
#啟用Table追加日誌
SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY, UNIQUE, FOREIGN KEY) COLUMNS;

2、修改各自的global_name

– 檢查全域名
select * from global_name;
–如果不正確修改
alter database rename global_name to wap.com.cn
–修改完上述變數以後重啟 SHUTDOWN IMMEDIATE

3、在從資料上建立和主要資料庫一樣的資料表空間和使用者

詳細步驟就不寫了,地球人都知道

4、建立複製使用者

– 建立複製使用者
create user stradmin identified by password
default tablespace CMSTABLE quota unlimited on CMSTABLE;
grant connect, resource, dba to stradmin;

– 建立歸檔目錄
– primary
create directory dir_primary as ‘/xxxxxxxx/gmw_yunmei/’;
– standby
create directory dir_standby as ‘/xxxxxxxxxxxxx/gmw_yunmei/’;

6、啟動各自的EM

emctl status dbconsole

然後訪問http://xxx.xxx.xxx.xxx:1158/em/

然後使用SYSTEM登陸

7、在【維護】-【流】-【設定】

使用圖形化的介面進行新增工作,然後可以在圖形介面上進行管理和配置Stream的管理和監控

8、錯誤查詢

select CAPTURE_NAME,QUEUE_NAME,START_SCN,STATUS,CAPTURE_TYPE from dba_capture;

主要資料庫最好每個表都有主鍵

要保持主從資料庫的同步之前的唯一性

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.