單節點主庫、邏輯備庫升級為RAC、物理備庫、邏輯備庫(4)
5 建立rac phy stdby:
A 引數
inittestrac1.ora:
(*.control_files='+DATA/testrac/controlfile/current.297.737327023'
要先寫成這樣,在restore時才會放入+DATA)
*.undo_management = AUTO
*.db_name = hellodb
*.db_block_size = 8192
*.processes=500
*.sessions=500
*.sga_max_size=4G
*.sga_target=4G
*.large_pool_size=1G
*.background_dump_dest=/data/oracle/oradata/hellodb/bdump
*.user_dump_dest=/data/oracle/oradata/hellodb/udump
*.core_dump_dest=/data/oracle/oradata/hellodb/cdump
*.DB_UNIQUE_NAME='testrac'
*.FAL_CLIENT='tns52'
*.fal_server='tnsrac'
*.log_archive_config='DG_CONFIG=(testrac,db52,db02)'
*.log_archive_dest_1='LOCATION=+ARCH'
*.log_archive_dest_2='SERVICE=tns52 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=db52'
*.log_archive_dest_3='SERVICE=tns02 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=db02'
*.log_archive_dest_state_1='enable'
*.log_archive_dest_state_2='enable'
*.log_archive_dest_state_3='enable'
*.standby_file_management='AUTO'
*.compatible=10.2.0.1.0
*.log_file_name_convert='/data/oracle/oradata/hellodb','+ARCH'
*.db_create_file_dest='+DATA'
*.db_file_name_convert='/data/oracle/oradata/hellodb','+DATA/testrac/datafile'
*.control_files='+DATA/pri/controlfile/current.309.737145001'
#*.cluster_database_instances=2
#*.cluster_database=true
testrac2.instance_number=2
testrac1.instance_number=1
testrac1.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.25) (PORT = 1521))'
testrac2.local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.26) (PORT = 1521))'
testrac2.thread=2
testrac1.thread=1
testrac1.undo_tablespace='UNDOTBS1'
testrac2.undo_tablespace='UNDOTBS2'
*.remote_listener='LISTENERS_testrac'
testrac1.job_queue_processes=0
testrac2.job_queue_processes=10
*._in_memory_undo=FALSE
B rman 在備庫恢復
cp orapwhellodb /data/oracle/product/10.2/db1/dbs/orapwtestrac1
export ORACLE_SID=testrac1
startup nomount;
export ORACLE_SID=testrac1
rman target /
startup nomount
restore controlfile from '/data/backup/stdctl_hellodb.ctl';
output filename=+DATA/testrac/controlfile/current.297.737327023
shutdown immediate
修改inittestrac1.ora
*.control_files='+DATA/testrac/controlfile/current.297.737327023'
startup mount
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
+DATA/testrac/datafile/system.dbf
+DATA/testrac/datafile/undotbs01.dbf
+DATA/testrac/datafile/sysaux.dbf
52 上查
SQL> col NAME format a60
SQL> select FILE# ,NAME from v$datafile;
FILE# NAME
---------- ------------------------------------------------------------
1 /data/oracle/oradata/hellodb/system.dbf
2 /data/oracle/oradata/hellodb/undotbs01.dbf
3 /data/oracle/oradata/hellodb/sysaux.dbf
SQL>
21上(如果目錄不同要註冊):
RUN
{
allocate channel d1 type disk;
allocate channel d2 type disk;
allocate channel d3 type disk;
allocate channel d4 type disk;
SET NEWNAME FOR DATAFILE 1 to '+DATA/testrac/datafile/system.dbf';
SET NEWNAME FOR DATAFILE 2 to '+DATA/testrac/datafile/undotbs01.dbf';
SET NEWNAME FOR DATAFILE 3 to '+DATA/testrac/datafile/sysaux.dbf';
RESTORE DATABASE;
SWITCH DATAFILE ALL;
release channel d1;
release channel d2;
release channel d3;
release channel d4;
}
下面的預設設定應該要調整
SQL> col MEMBER format a60;
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------------------------------------ ---
1 ONLINE +ARCH/redo1.log NO
2 ONLINE +ARCH/redo2.log NO
3 ONLINE +ARCH/redo3.log NO
21 增加STANDBY LOGFILE:
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 4 SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 5 SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE THREAD 1 GROUP 6 SIZE 50M;
SQL> select * from v$logfile;
GROUP# STATUS TYPE MEMBER IS_
---------- ------- ------- ------------------------------------------------------------ ---
1 ONLINE +ARCH/redo1.log NO
2 ONLINE +ARCH/redo2.log NO
3 ONLINE +ARCH/redo3.log NO
4 STANDBY +DATA/testrac/onlinelog/group_4.321.737328085 NO
5 STANDBY +DATA/testrac/onlinelog/group_5.320.737328085 NO
6 STANDBY +DATA/testrac/onlinelog/group_6.322.737328087 NO
shutdown immediate
startup mount
alter database recover managed standby database disconnect from session using current logfile;
主庫重啟:
shutdown immediate;
修改:
*.log_archive_dest_state_2='enable'
在主庫切換日誌
alter system switch logfile;
col member format a50;
set line 400;
select * from v$log;
看到備庫已經應用同步日誌:
SQL> select * from (
2 select thread#,sequence# ,APPLIED, row_number() over(partition by thread# order by sequence# desc ) rn from v$archived_log
) where rn <=8; 3
THREAD# SEQUENCE# APP RN
---------- ---------- --- ----------
1 29 YES 1
1 28 YES 2
1 27 YES 3
1 26 YES 4
1 25 YES 5
1 24 YES 6
1 23 YES 7
1 22 YES 8
LOGMINER: Begin mining logfile for session 1 thread 1 sequence 30, /data/oracle/oradata/hellodb/stdlog_5_1.log
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/758322/viewspace-681931/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 單節點主庫、邏輯備庫升級為RAC、物理備庫、邏輯備庫(1)
- 單節點主庫、邏輯備庫升級為RAC、物理備庫、邏輯備庫(2)
- 單節點主庫、邏輯備庫升級為RAC、物理備庫、邏輯備庫(3)
- 單節點主庫、邏輯備庫升級為RAC、物理備庫、邏輯備庫(5)
- 4節點RAC建立邏輯備庫
- 配置物理備庫+邏輯備庫
- 邏輯備庫Switchover
- rac與邏輯備庫不能自動建表空間,物理備庫正常
- 【DATAGUARD】 基於同一個主機建立物理備庫和邏輯備庫 (四)--新增一個物理dg節點
- 11 管理邏輯備庫
- 【DATAGUARD】 基於同一個主機建立物理備庫和邏輯備庫(二)
- 【DATAGUARD】 基於同一個主機建立物理備庫和邏輯備庫(一)
- 【DATAGUARD】 基於同一個主機建立物理備庫和邏輯備庫 (三)
- 邏輯Data Guard主備庫的轉換
- 資料庫邏輯備份(轉)資料庫
- 認識資料庫物理備份和邏輯備份區別資料庫
- 邏輯DG主備庫轉換的failoverAI
- 主庫RAC,備庫單節點ASM的dataguard搭建ASM
- oracle邏輯備用資料庫(一)Oracle資料庫
- 邏輯備份全庫或者邏輯備份多個使用者的資料
- 11g 邏輯備庫簡單故障處理
- 【DataGuarad】邏輯遷移與standby備庫
- dataguard之邏輯備庫表空間不足
- 邏輯備庫上有指定表不應用
- ORACLE資料庫的邏輯備份(轉)Oracle資料庫
- oracle 10g 物理備庫轉換邏輯備庫ORA-19953故障解決方法Oracle 10g
- 4 Creating a Logical Standby Database 建立邏輯備庫Database
- dataguard回顧之安裝——建立邏輯備庫
- 資料庫(表)的邏輯備份與恢復資料庫
- dataguard之邏輯備庫移動資料檔案
- 邏輯備用資料庫主要作用是什麼。資料庫
- DataGuard切換(主庫為Rac+備庫為Rac)
- DG為RAC的邏輯備庫?LOG_AUTO_DELETE(TRUE)引數不起作用delete
- 一主一物一邏備庫
- 物理備庫互轉快照備庫
- 【DATAGUARD】DG系列之11g邏輯備庫的搭建
- 利用邏輯備庫進行rolling upgrade
- Oracle資料庫的邏輯備份工具-expdp資料泵Oracle資料庫