Documente Academic
Documente Profesional
Documente Cultură
The Enviroment
2 Linux servers, Oracle Distribution 2.6.9-55 EL i686 i386 GNU/Linux
Oracle Database 10g Enterprise Edition Release 10g R2
ssh is configured for user Oracle on both nodes
Oracle Home is on identical path on both nodes
Implementation notes:
Once you have your primary database up and running these are the steps to
follow:
1. Enable Forced Logging
2. Create a Password File
3. Configure a Standby Redo Log
4. Enable Archiving
5. Set Primary Database Initialization Parameters
Having followed these steps to implement the physical standby you need to
follow these steps:
1. Create a Control File for the Standby Database
2. Backup the Primary Database and transfer a copy to the Standby node.
3. Prepare an Initialization Parameter File for the Standby Database
4. Configure the listener and tnsnames to support the database on both nodes
5. Set Up the Environment to Support the Standby Database on the standby node.
6. Start the Physical Standby Database
7. Verify the Physical Standby Database Is Performing Properly
physical standby manually.implementconfiguration is necessary to
additionalsuccessfully and no is installed, Oracle database are met, that
accommodate an Oracle database. All prerequisites raclinux2and raclinux1Manually
setting up a Physical standby database is a simple task when all prerequisites and
setup steps are carefully planed and executed. In this example We use 2 hosts,
NAME
���
10GPRI
NAME
���������������������������
/u01/app/oracle/oradata/10gpri/system01.dbf
/u01/app/oracle/oradata/10gpri/undotbs01.dbf
/u01/app/oracle/oradata/10gpri/sysaux01.dbf
/u01/app/oracle/oradata/10gpri/users01.dbf
Database altered.
Database altered.
Database altered.
6 rows selected.
File created.
(or)
File created.
10gpri.__db_cache_size=184549376
10gpri.__java_pool_size=4194304
10gpri.__large_pool_size=4194304
10gpri.__shared_pool_size=88080384
10gpri.__streams_pool_size=0
*.audit_file_dest=�/u01/app/oracle/admin/10gpri/adump�
*.background_dump_dest=�/u01/app/oracle/admin/10gpri/bdump�
*.compatible=�10.2.0.1.0'
*.control_files=�/u01/app/oracle/oradata/10gpri/control01.ctl�,�/u01/app/oracle/ora
data/10gpri/control02.ctl�,�/u01/app/oracle/oradata/10gpri/control03.ctl�
*.core_dump_dest=�/u01/app/oracle/admin/10gpri/cdump�
*.db_block_size=8192
*.db_domain=�
*.db_file_multiblock_read_count=16
*.db_name=�10gpri�
*.db_recovery_file_dest=�/u01/app/oracle/flash_recovery_area�
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=10gpriXDB)�
*.job_queue_processes=10
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile=�EXCLUSIVE�
*.sga_target=285212672
*.undo_management=�AUTO�
*.undo_tablespace=�UNDOTBS1'
*.user_dump_dest=�/u01/app/oracle/admin/10gpri/udump�
db_unique_name=�10gpri�
LOG_ARCHIVE_CONFIG=�DG_CONFIG=(10gpri,10gsb)�
LOG_ARCHIVE_DEST_1=�LOCATION=/u01/app/oracle/oradata/10gpri/arch/
VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=10gpri�
LOG_ARCHIVE_DEST_2=�SERVICE=10gsb LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=10gsb�
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=30
#Standby role parameters��������������
fal_server=10gsb
fal_client=10gpri
standby_file_management=auto
db_file_name_convert=�/u01/app/oracle/oradata/10gsb/�,�/u01/app/oracle/oradata/10gp
ri/�
log_file_name_convert=�/u01/app/oracle/oradata/10gsb/�,�/u01/app/oracle/oradata/10g
pri/�
File created.
Enable Archiving
On 10g you can enable archive log mode by mounting the database and executing the
archivelog command:
SQL> startup mount
ORACLE instance started.
Database altered.
Database altered.
Create an RMAN backup which we will use later to create the standby:
NOTE:
The primary and standby database location for backup folder must be same.
On the standby node create the required directories to get the datafiles
mkdir -p /u01/app/oracle/oradata/10gsb
mkdir -p /u01/app/oracle/oradata/10gsb/arch
mkdir -p /u01/app/oracle/admin/10gsb
mkdir -p /u01/app/oracle/admin/10gsb/adump
mkdir -p /u01/app/oracle/admin/10gsb/bdump
mkdir -p /u01/app/oracle/admin/10gsb/udump
mkdir -p /u01/app/oracle/flash_recovery_area/10GPRI
mkdir -p /u01/app/oracle/flash_recovery_area/10GPRI/onlinelogPrepare an
Initialization Parameter File for the Standby Database
Copy and edit the primary init.ora to set it up for the standby role,as shown
highlighted below:
10gsb.__db_cache_size=188743680
10gsb.__java_pool_size=4194304
10gsb.__large_pool_size=4194304
10gsb.__shared_pool_size=83886080
10gsb.__streams_pool_size=0
*.audit_file_dest=�/u01/app/oracle/admin/10gsb/adump�
*.background_dump_dest=�/u01/app/oracle/admin/10gsb/bdump�
*.compatible=�10.2.0.1.0'
*.control_files=�/u01/app/oracle/oradata/10gsb/control01.ctl�,�/u01/app/oracle/orad
ata/10gsb/control02.ctl�,�/u01/app/oracle/oradata/10gsb/control03.ctl�
*.core_dump_dest=�/u01/app/oracle/admin/10gsb/cdump�
*.db_block_size=8192
*.db_domain=�
*.db_file_multiblock_read_count=16
*.db_file_name_convert=�/u01/app/oracle/oradata/10gpri/�,�/u01/app/oracle/oradata/1
0gsb/�
*.db_name=�10gpri�
*.db_recovery_file_dest=�/u01/app/oracle/flash_recovery_area�
*.db_recovery_file_dest_size=2147483648
*.db_unique_name=�10gsb�
*.dispatchers='(PROTOCOL=TCP) (SERVICE=10gsbXDB)�
*.fal_client=�10gsb�
*.fal_server=�10gpri�
*.job_queue_processes=10
*.LOG_ARCHIVE_CONFIG=�DG_CONFIG=(10gpri,10gsb)�
*.LOG_ARCHIVE_DEST_1=�LOCATION=/u01/app/oracle/oradata/10gsb/arch/
VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=10gsb�
*.LOG_ARCHIVE_DEST_2=�SERVICE=10gpri LGWR ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=10gpri�
*.LOG_ARCHIVE_DEST_STATE_1=�ENABLE�
*.LOG_ARCHIVE_DEST_STATE_2=�ENABLE�
*.LOG_ARCHIVE_FORMAT=�%t_%s_%r.arc�
*.LOG_ARCHIVE_MAX_PROCESSES=30
*.log_file_name_convert=�/u01/app/oracle/oradata/10gpri/�,�/u01/app/oracle/oradata/
10gsb/�
*.open_cursors=300
*.pga_aggregate_target=94371840
*.processes=150
*.remote_login_passwordfile=�EXCLUSIVE�
*.sga_target=285212672
*.standby_file_management=�auto�
*.undo_management=�AUTO�
*.undo_tablespace=�UNDOTBS1'
*.user_dump_dest=�/u01/app/oracle/admin/10gsb/udump�
Configure the listener and tnsnames to support the database on both nodes
SID_LIST_LISTENER_VMRACLINUXTEST =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = 10gpri)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(SID_NAME = 10gpri)
)
)
SID_LIST_LISTENER_VMRACLINUXTEST =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = 10gsb)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(SID_NAME = 10gsb)
)
)
LISTENER_VMRACLINUXTEST =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = raclinux2.gj.com)(PORT = 1521))
)
)
10GPRI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = raclinux2.gj.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = 10gpri)
)
)
10GSB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = raclinux1.gj.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = 10gsb)
)
)
#on raclinux1 machine
LISTENER_VMRACLINUXTEST =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = raclinux1.gj.com)(PORT = 1521))
)
)
10GPRI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = raclinux2.gj.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = 10gpri)
)
)
10GSB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = raclinux1.gj.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = 10gsb)
)
)
Start the listener and check tnsping on both nodes to both services
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=raclinux1.gj.com)
(PORT=1521)))
The command completed successfully
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=raclinux1.gj.com)
(PORT=1521)))
STATUS of the LISTENER
��������
Alias LISTENER_VMRACLINUXTEST
Version TNSLSNR for Linux: Version 10.2.0.1.0 � Production
Start Date 25-DEC-2009 00:00:00
Uptime 0 days 0 hr. 0 min. 0 sec
Traclinuxe Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File
/u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File
/u01/app/oracle/product/10.2.0/db_1/network/log/listener_vmraclinuxtest.log
Listening Endpoints Summary�
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=raclinux1.gj.com)(PORT=1521)))
Services Summary�
Service �10gsb� has 1 instance(s).
Instance �10gsb�, status UNKNOWN, has 1 handler(s) for this service�
Service �10gsb_DGMGRL� has 1 instance(s).
Instance �10gsb�, status UNKNOWN, has 1 handler(s) for this service�
The command completed successfully
TNS Ping Utility for Linux: Version 10.2.0.1.0 � Production on 25-DEC-2009 00:00:21
TNS Ping Utility for Linux: Version 10.2.0.1.0 � Production on 25-DEC-2009 00:00:29
#on raclinux2 machine
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=raclinux2.gj.com)(PORT=1
521)))
The command completed successfully
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=raclinux2.gj.com)(PORT=1
521)))
STATUS of the LISTENER
��������
Alias LISTENER_VMRACLINUXTEST
Version TNSLSNR for Linux: Version 10.2.0.1.0 � Production
Start Date 25-DEC-2009 00:23:08
Uptime 0 days 0 hr. 0 min. 0 sec
Traclinuxe Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/list
ener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listen
er_vmraclinuxtest.log
Listening Endpoints Summary�
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=raclinux2.gj.com)(PORT=1521)))
Services Summary�
Service �10gpri� has 1 instance(s).
Instance �10gpri�, status UNKNOWN, has 1 handler(s) for this service�
Service �10gpri_DGMGRL� has 1 instance(s).
Instance �10gpri�, status UNKNOWN, has 1 handler(s) for this service�
The command completed successfully
TNS Ping Utility for Linux: Version 10.2.0.1.0 � Production on 25-DEC-2009 00:23 :
14
TNS Ping Utility for Linux: Version 10.2.0.1.0 � Production on 25-DEC-2009 00:23 :
18
Set Up the Environment to Support the Standby Database on the standby node.
Append an entry to
File created.
SQL> alter database recover managed standby database disconnect from session;
Test the configuration by generating archive logs from the primary and then
querying the standby to see if the logs are being successfully applied.
On the Primary:
On the Standby: