熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

oracle 11gR2 邏輯備用數據庫搭建

2022-06-13   來源: Oracle 

  oracle 邏輯備用庫環境搭建

  首先創建物理備用庫創建物理備用庫後最好創建各自的spfile

  物理備庫上 停止redo應用

  alter database recover managed STANDBY database cancel;

  主庫上生成logminer 會發生幾次切換日志 報錯忽略

  execute dbms_logstdbybuild;

  物理備庫上 轉化為邏輯備用庫

  alter database recover to logical standby orcl; < db_name 參數

  shutdown immediate

  startup mount

  SELECT db_unique_nameopen_mode database_roleswitchover_statusguard_statusprotection_mode FROM V$DATABASE;

  備庫上 重建邏輯standby的密碼文件

  orapwd file=$ORACLE_HOME/dbs/orapwstby password=oracle entries= ignorecase=y force=y

  備庫上 修改參數

  alter system set log_archive_dest_=location=/u/oradata/arch/stby valid_for=(online_logfilesall_roles) db_unique_name=stby;

  alter system set log_archive_dest_=location=/u/oradata/arch valid_for=(standby_logfilesstandby_roles) db_unique_name=stby;

  備庫上 創建備用日志

  alter database add standby logfile group (/u/oradata/stby/standbyljlog) size M reuse;

  alter database add standby logfile group (/u/oradata/stby/standbyljlog) size M reuse;

  alter database add standby logfile group (/u/oradata/stby/standbyljlog) size M reuse;

  select member from v$logfile;

  備庫上 打開邏輯standby

  alter database open resetlogs;

  alter database start logical standby apply immediate;

  備庫上 檢查

  select instance_namestatus from v$instance;

  SELECT db_unique_nameopen_mode database_roleswitchover_statusguard_statusprotection_mode FROM V$DATABASE;

  select group#sequence#usedstatus from v$standby_log;

  測試

  在主庫上 創建

  create table scottt (id int);

  insert into scottt values();

  commit;

  alter system switch logfile;

  過一會兒 在邏輯備用庫上查詢

  select * from scottt;


From:http://tw.wingwit.com/Article/program/Oracle/201311/19028.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.