使用RMAN建立物理Standby資料庫
1. Make the necessary changes to the primary database.
a. Enable force logging.
b. Creating the password file if one does not exist.
c. Create standby redologs.
d. Modify the parameter file suitable for Dataguard.
2. Ensure that the sql*net connectivity is working fine.
3. Create the standby database over the network using the active(primary) database files.
a. Create the password file
b. Create the initialization parameter file for the standby database (auxiliary database)
c. Create the necessary mount points or the folders for the database files
d. Run the standby creation ON STANDBY by connecting to primary as target database.
FOR STANDBY
FROM ACTIVE DATABASE
SPFILE
PARAMETER_VALUE_CONVERT '', ''
SET DB_FILE_NAME_CONVERT '', ''
SET LOG_FILE_NAME_CONVERT '', ''
SET SGA_MAX_SIZE 200M
SET SGA_TARGET 125M;
4. Check the log shipping and apply.
While creating the standby database we use the active database files i.e., this command will be useful in creating the physical standby database using active database files over the network.
1. Prepare the production database to be the primary database
a. Ensure that the database is in archivelog mode .
SQL> select log_mode from v$database;
LOG_MODE
------------
ARCHIVELOG
b. Enable force logging
SQL> ALTER DATABASE FORCE LOGGING;
c. Create standby redologs
SQL> alter database add standby logfile '/data/oracle/oradata/phyprimary/standbyredo01.log' size 50M;
Database altered.
SQL> alter database add standby logfile '/data/oracle/oradata/phyprimary/standbyredo02.log' size 50M;
Database altered.
SQL> alter database add standby logfile '/data/oracle/oradata/phyprimary/standbyredo03.log' size 50M;
Database altered.
d. Modify the primary initialization parameter for dataguard on primary,
SQL> alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(phyprimary,phystandby)';
System altered.
SQL> alter system set LOG_ARCHIVE_DEST_1='LOCATION=/data/oracle/oradata/phyprimary/archivelog/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=phyprimary';
System altered.
SQL> alter system set LOG_ARCHIVE_DEST_2='SERVICE=phystandby LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=phystandby';System altered.
SQL> alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE;
System altered.
SQL> alter system set FAL_SERVER=phystandby;
System altered.
SQL> alter system set FAL_CLIENT=phyprimary;
System altered.
SQL> alter system set DB_FILE_NAME_CONVERT='/data/oracle/oradata/phystandby','/data/oracle/oradata/phyprimary' scope=spfile;System altered.
SQL> alter system set LOG_FILE_NAME_CONVERT='/data/oracle/oradata/phystandby/','/data/oracle/oradata/phyprimary/' scope=spfile;System altered.
2. Ensure that the sql*net connectivity is working fine.
Insert a static entry for Boston in the listener.ora file of the standby system.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = phystandby)
(ORACLE_HOME = /data/oracle/product/11.2.0/db_1)
(SID_NAME = phystandby)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.248.139)(PORT = 1521))
)
TNSNAMES.ORA for the Primary and Standby should have BOTH entries
phyprimary =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.248.140)(PORT = 1521))
)
(CONNECT_DATA = (SERVICE_NAME = phyprimary ))
)
phystandby =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.248.139)(PORT = 1521))
)
(CONNECT_DATA = (SERVICE_NAME = phystandby))
)
Check with the SQL*Net configuration using the following commands on the Primary AND Standby
% tnsping phyprimary
% tnsping phystandby
3. Create the standby database
a. Copy the password file from the primary $ORACLE_HOME/dbs and rename it to the standby database name.
The username is required to be SYS and the password needs to be the same on the Primary and Standby.
The best practice for this is to copy the passwordfile as suggested.
The password file name must match the instance name/SID used at the standby site, not the DB_NAME.
b. Create a initialization parameter with only one parameter DB_NAME.
DB_NAME=PHYPRIMA
DB_UNIQUE_NAME=phystandby
DB_BLOCK_SIZE=8192
c. Create the necessary directories in the standby location to place the datafiles and the trace files in the $ADR_HOME.
d. Set the environment variable ORACLE_SID to the standby service and start the standby-instance.
% export ORACLE_SID=phystandby
% sqlplus "/ as sysdba"
SQL> startup nomount pfile='/data/oracle/product/11.2.0/db_1/dbs/initphystandby.ora';
NOTE : Use either PFILE or SPFILE
# Addtl. comment
# If DUPLICATE without TARGET connection is used you cannot use SPFILE
# else getting
RMAN-05537: DUPLICATE without TARGET connection when auxiliary instance is started with spfile cannot use SPFILE clause
e. Verify if the connection 'AS SYSDBA' is working
f. On the primary system invoke the RMAN executable and connect to the primary and the auxiliary database ( i.e., the standby)% sqlplus /nolog
SQL> connect sys/SQL> connect sys/ @chicago AS SYSDBA
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Aug 6 02:59:28 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: PHYPRIMA (DBID=324097933)
connected to auxiliary database: PHYPRIMA (not mounted)
RMAN> run {
2> allocate channel prmy1 type disk;
3> allocate channel prmy2 type disk;
4> allocate channel prmy3 type disk;
5> allocate channel prmy4 type disk;
6> allocate auxiliary channel stby type disk;
7>
8> duplicate target database for standby from active database
9> spfile
10> parameter_value_convert 'phyprimary','phystandby'
11> set db_unique_name='phystandby'
12> set DB_FILE_NAME_CONVERT='/phyprimary/','/phystandby/'
13> set LOG_FILE_NAME_CONVERT='/phyprimary/','/phystandby/'
14> set control_files='/data/oracle/oradata/control01.ctl'
15> set log_archive_max_processes='5'
16> set fal_client='phystandby'
17> set fal_server='phyprimary'
18> set standby_file_management='AUTO'
19> set LOG_ARCHIVE_CONFIG='DG_CONFIG=(phyprimary,phystandby)'
20> set log_archive_dest_2='service=phyprimary ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=phystandby'
21> ;
22> }
5. If you are licensed to use Active Dataguard (ADG) than open the Standby Database in READ ONLY and start the recovery.
SQL> alter database open;
SQL> alter database recover managed standby database disconnect;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28719055/viewspace-1247063/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用rman建立standby資料庫資料庫
- 使用RMAN建立STANDBY資料庫——RMAN使用者手冊資料庫
- 利用RMAN建立STANDBY資料庫資料庫
- ORACLE DUPLICATE建立物理standby資料庫Oracle資料庫
- 【DATAGUARD 學習】使用duplicate 建立物理standby 資料庫資料庫
- RMAN duplicate 建立standby RAC資料庫資料庫
- 通過RMAN Duplicate建立Oracle物理standby備庫Oracle
- 使用RMAN duplicate 建立standby資料庫(RAC或單機)資料庫
- 建立物理STANDBY資料庫——DATA GUARD概念和管理資料庫
- 物理Standby資料庫及邏輯Standby資料庫(Physical Standby & Logical Standby)資料庫
- ORA-17629:rman建立 standby資料庫時報錯資料庫
- 使用RMAN建立Duplicate資料庫資料庫
- oracle10g data guard建立物理standby資料庫的例子Oracle資料庫
- 使用RMAN增量備份前滾STANDBY資料庫資料庫
- Oracle Standby資料庫建立Oracle資料庫
- RMAN DUPLICATE建立DataGuard物理備庫
- 使用 RMAN DUPLICATE...FROM ACTIVE DATABASE 建立物理備用資料庫的分步指南Database資料庫
- RAC資料庫建立STANDBY(六)資料庫
- RAC資料庫建立STANDBY(五)資料庫
- RAC資料庫建立STANDBY(四)資料庫
- RAC資料庫建立STANDBY(三)資料庫
- RAC資料庫建立STANDBY(二)資料庫
- RAC資料庫建立STANDBY(一)資料庫
- 在單機上建立物理的Oracle9i standby資料庫(轉)Oracle資料庫
- rman 建立ftp standbyFTP
- 使用RMAN建立資料庫備份庫(筆記)資料庫筆記
- dataguard回顧之安裝———使用rman建立物理備庫
- 使用rman建立standby database的過程Database
- 使用RMAN進行快速Dataguard資料庫建立資料庫
- standby 資料庫的建立過程資料庫
- 管理物理STANDBY資料庫——DATA GUARD概念和管理資料庫
- ORACLE DATAGUARD 資料庫---建立物理備用資料庫Oracle資料庫
- 【轉】RMAN建立duplicate資料庫資料庫
- 關於建立DataGuard Physical Standby資料庫資料庫
- Standby資料庫簡單建立過程資料庫
- 使用RMAN DUPLICATE...FROM ACTIVE DATABASE命令來建立DataGuard物理備庫Database
- 建立測試物理Standby日誌
- 利用RMAN建立備用資料庫資料庫