部署STANDBY資料庫
這個例子是在不同主機伺服器部署
1.在備份主機建立相關目錄,保持與原資料庫相同的目錄結構。從原資料庫生成init檔案,修改例項名和服務名,但一定要保留資料庫名不變
1.在備份主機建立相關目錄,保持與原資料庫相同的目錄結構。從原資料庫生成init檔案,修改例項名和服務名,但一定要保留資料庫名不變
> cat initmydb1.ora
*.aq_tm_processes=1
*.background_dump_dest='/u01/ora9/admin/mydb1/bdump'
*.compatible='9.2.0.0.0'
#*.control_files='/u01/ora9/oradata/mydb1/control01.ctl','/u01/ora9/oradata/mydb1/control02.ctl','/u01/ora9/oradata/mydb1/control03.ctl'
*.control_files='/u01/ora9/oradata/mydb1/standby.ctl'
*.core_dump_dest='/u01/ora9/admin/mydb1/cdump'
*.db_block_size=8192
*.db_cache_size=33554432
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='mydb1'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=mydb1XDB)'
*.fast_start_mttr_target=300
*.global_names=FALSE
*.hash_join_enabled=TRUE
*.instance_name='standby'
*.java_pool_size=83886080
*.job_queue_processes=10
*.large_pool_size=16777216
*.log_archive_dest_1='LOCATION=/u01/ora9/oradata/mydb1/archive'
*.log_archive_start=TRUE
*.open_cursors=300
*.pga_aggregate_target=25165824
*.processes=150
*.query_rewrite_enabled='FALSE'
*.remote_login_passwordfile='EXCLUSIVE'
*.shared_pool_size=83886080
*.sort_area_size=524288
*.star_transformation_enabled='FALSE'
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.undo_retention=10800
*.undo_tablespace='UNDOTBS2'
*.service_names='standby'
*.standby_archive_dest='/u01/ora9/oradata/mydb1/archive'
*.user_dump_dest='/u01/ora9/admin/mydb1/udump'
>
*.aq_tm_processes=1
*.background_dump_dest='/u01/ora9/admin/mydb1/bdump'
*.compatible='9.2.0.0.0'
#*.control_files='/u01/ora9/oradata/mydb1/control01.ctl','/u01/ora9/oradata/mydb1/control02.ctl','/u01/ora9/oradata/mydb1/control03.ctl'
*.control_files='/u01/ora9/oradata/mydb1/standby.ctl'
*.core_dump_dest='/u01/ora9/admin/mydb1/cdump'
*.db_block_size=8192
*.db_cache_size=33554432
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='mydb1'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=mydb1XDB)'
*.fast_start_mttr_target=300
*.global_names=FALSE
*.hash_join_enabled=TRUE
*.instance_name='standby'
*.java_pool_size=83886080
*.job_queue_processes=10
*.large_pool_size=16777216
*.log_archive_dest_1='LOCATION=/u01/ora9/oradata/mydb1/archive'
*.log_archive_start=TRUE
*.open_cursors=300
*.pga_aggregate_target=25165824
*.processes=150
*.query_rewrite_enabled='FALSE'
*.remote_login_passwordfile='EXCLUSIVE'
*.shared_pool_size=83886080
*.sort_area_size=524288
*.star_transformation_enabled='FALSE'
*.timed_statistics=TRUE
*.undo_management='AUTO'
*.undo_retention=10800
*.undo_tablespace='UNDOTBS2'
*.service_names='standby'
*.standby_archive_dest='/u01/ora9/oradata/mydb1/archive'
*.user_dump_dest='/u01/ora9/admin/mydb1/udump'
>
2.建立口令檔案
> orapwd file=orapwSTANDBY password=sys entries=3
> orapwd file=orapwSTANDBY password=sys entries=3
3.配置服務
> cat listener.ora
# LISTENER.ORA Network Configuration File: /u01/ora9/product/network/admin/listener.ora
# Generated by Oracle configuration tools.
> cat listener.ora
# LISTENER.ORA Network Configuration File: /u01/ora9/product/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.2)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.2)(PORT = 1521))
)
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/ora9/product)
(SID_NAME = mydb1)
(service_name = STANDBY)
)
)
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/ora9/product)
(SID_NAME = mydb1)
(service_name = STANDBY)
)
)
>
PRIMARY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mydb1)
)
)
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mydb1)
)
)
STANDBY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.2)(PORT = 1521))
)
(CONNECT_DATA =
(service_name = STANDBY)
)
)
4.備份原資料庫,並將生成的檔案傳遞到備份主機,目錄與原資料庫的目錄必須一樣
run{
allocate channel d1 type disk;
backup incremental level = 0
database
format '/backup/db_%d_%s_%p_%t.dbf'
tag='whole_inco'
include current controlfile for standby;
sql "alter system archive log current";
sql "alter system archive log current";
backup archivelog all
format '/backup/ar_%d_%s_%p_%t.arc';
}
allocate channel d1 type disk;
backup incremental level = 0
database
format '/backup/db_%d_%s_%p_%t.dbf'
tag='whole_inco'
include current controlfile for standby;
sql "alter system archive log current";
sql "alter system archive log current";
backup archivelog all
format '/backup/ar_%d_%s_%p_%t.arc';
}
5.建立STANDBY資料庫,在備份主機執行
/nolog
SQL>connect / as sysdba
SQL>connect / as sysdba
SQL>startup nomount pfile='/u01/ora9/product/dbs/initmydb1.ora'
>
> ./rman
Recovery Manager: Release 9.2.0.6.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
RMAN> connect target
connected to target database: mydb1 (DBID=3061999746)
RMAN> connect auxiliary sys/sys
connected to auxiliary database: mydb1 (not mounted)
run{
set command id to 'Standby Creation';
allocate auxiliary channel d1 type disk;
duplicate target database for standby dorecover nofilenamecheck;
}
6.啟動管理恢復,原資料庫自動傳遞日誌,standby資料庫自動應用日誌
SQL>recover managed standby database;
SQL>recover managed standby database;
alter system set log_archive_dest_2="SERVICE=STANDBY optional";--在原資料庫執行
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26870952/viewspace-735680/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 物理Standby資料庫及邏輯Standby資料庫(Physical Standby & Logical Standby)資料庫
- Oracle Standby資料庫建立Oracle資料庫
- standby資料庫的研究!資料庫
- 利用RMAN建立STANDBY資料庫資料庫
- RAC資料庫建立STANDBY(六)資料庫
- RAC資料庫建立STANDBY(五)資料庫
- RAC資料庫建立STANDBY(四)資料庫
- RAC資料庫建立STANDBY(三)資料庫
- RAC資料庫建立STANDBY(二)資料庫
- RAC資料庫建立STANDBY(一)資料庫
- 使用rman建立standby資料庫資料庫
- ORACLE DUPLICATE建立物理standby資料庫Oracle資料庫
- 使用RMAN建立物理Standby資料庫資料庫
- RMAN duplicate 建立standby RAC資料庫資料庫
- standby 資料庫的建立過程資料庫
- Standby資料庫常用操作說明資料庫
- 關於建立DataGuard Physical Standby資料庫資料庫
- 【DATAGUARD 學習】如何停止standby資料庫資料庫
- Standby資料庫簡單建立過程資料庫
- 建立Local Physical Standby Oracle9i standby 資料庫筆記Oracle資料庫筆記
- 建立Oracle ADG standby資料庫若干方法Oracle資料庫
- 將Standby資料庫臨時轉換為主資料庫用於測試資料庫
- ORA-17629:rman建立 standby資料庫時報錯資料庫
- 【DATAGUARD 學習】使用duplicate 建立物理standby 資料庫資料庫
- 使用RMAN增量備份前滾STANDBY資料庫資料庫
- Data Guard之Snapshot Standby資料庫功能[轉]資料庫
- rac環境下standby資料庫的實現資料庫
- 管理物理STANDBY資料庫——DATA GUARD概念和管理資料庫
- 建立物理STANDBY資料庫——DATA GUARD概念和管理資料庫
- Oracle9i standby 資料庫筆記(zt)Oracle資料庫筆記
- dataguard standby資料庫的關閉和啟動資料庫
- Hbase資料庫安裝部署資料庫
- mysql 資料庫部署(google like?)MySql資料庫Go
- 使用RMAN duplicate 建立standby資料庫(RAC或單機)資料庫
- 管理邏輯STANDBY資料庫——DATA GUARD概念和管理資料庫
- 建立邏輯STANDBY資料庫——DATA GUARD概念和管理資料庫
- RAC環境的STANDBY資料庫備份報錯資料庫
- SQL Server 2008資料庫新增資料檔案後Standby庫的恢復SQLServer資料庫