Oracle 11GR2
Best Practices for Highly Available
Oracle Databases
By Carlos Pimentel
November, 2015
Goal
• Understand High Availability Concept
• Understand Active Data Guard Concept
• Required Software and License
• SCAN Listener
• Services
• Role-based database services
• TNS Configuration for HA
• How is CNAMES used for?
2 Dell - Restricted - Confidential
Understand High Availability Concept
3 Dell - Restricted - Confidential
Understand Active Data Guard Concept
4 Dell - Restricted - Confidential
Required Software and License
Enterprise Edition
+Options
5 Dell - Restricted - Confidential
The Database Pillars of High Availability
Client
Scan Listener Services
Configuration
• Load • Load • Connect
Balance - Balance Settings
DNS workload • Timeout
• Listener based config
Redundancy • Preferred • Services
Instances
• TAF
6 Dell - Restricted - Confidential
SCAN Listener
Single Client Access Name
Define a SCAN using the corporate DNS (Domain Name Service)
First Execution Second Execution
nslookup proddbscn.example.com nslookup proddbscn.example.com
Server: 143.166.220.125 Server: 143.166.220.125
Address: 143.166.220.125#53 Address: 143.166.220.125#53
Non-authoritative answer: Non-authoritative answer:
Name: proddbscn.example.com Name: proddbscn.example.com
Address: 10.178.116.225 Address: 10.178.116.224
Name: proddbscn.example.com Name: proddbscn.example.com
Address: 10.178.116.226 Address: 10.178.116.226
Name: proddbscn.example.com Name: proddbscn.example.com
Address: 10.178.116.224 Address: 10.178.116.225
7 Dell - Restricted - Confidential
SCAN Listener
Single Client Access Name
8 Dell - Restricted - Confidential
Why SCAN Listener?
PROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = prddb01-vip.us.dell.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = prddb02-vip.us.dell.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = prddb03-vip.us.dell.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = prddb04-vip.us.dell.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = prddb05-vip.us.dell.com)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA=(SERVER=DEDICATED)(service_name=prod)
)
)
PROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = prdbscn.us.dell.com)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA=(SERVER=DEDICATED)(service_name=prod)
)
)
9 Dell - Restricted - Confidential
Services
10 Dell - Restricted - Confidential
Services Benefits
Dynamic Resource Allocation
High Availability
TAF
Tuning and Monitoring
Role Based
Resource Management
Database Jobs
11 Dell - Restricted - Confidential
Role-based database services
We can control the startup of database services assigning a Database role.
-l PRIMARY, PHYSICAL_STANDBY, LOGICAL_STANDBY and
SNAPSHOT_STANDBY
A database service will automatically start based in its role if the service is
AUTOMATIC and the ROLE matchs with Database ROLE
srvctl add service -d prod -s prod_adg_sql -r prod1, prod2, prod3
-l physical_standby -y AUTO
12 Dell - Restricted - Confidential
Services Example
Using Services and Scan Listener with RMAN
prod_all_instances=
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=proddbscn.us.dell.com)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=prod_all_instances)
))
Service name: prod_all_instances
Cardinality: 6
Service role: PRIMARY
Preferred instances: prod1, prod2, prod3, prod4, prod5, prod6
Available instances:
13 Dell - Restricted - Confidential
Services Example
connect target /
CONFIGURE DEVICE TYPE disk PARALLELISM 24;
CONFIGURE CHANNEL DEVICE TYPE disk CONNECT sys/@prod_all_instances;
CONFIGURE DEFAULT DEVICE TYPE TO disk;
run {
set controlfile autobackup format for device type disk to '/bkp/%F.bck';
backup as compressed backupset incremental level 0 filesperset 1 format '/bkp/full_db_%d_t%t_s%s_p%p'
database include current controlfile;
backup as compressed backupset filesperset 10 format '/bkp/full_arch_%d_%s_%p' archivelog all;
}
Starting backup at 06-NOV-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=2529 instance=prod2 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=3518 instance=prod4 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=5539 instance=prod3 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=3524 instance=prod6 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=2767 instance=prod5 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=3534 instance=prod2 device type=DISK
allocated channel: ORA_DISK_7
channel ORA_DISK_7: SID=1019 instance=prod3 device type=DISK
allocated channel: ORA_DISK_8
channel ORA_DISK_8: SID=1273 instance=prod4 device type=DISK
14 Dell - Restricted - Confidential
TNS configuration for HA
PROD =
(DESCRIPTION_LIST=
(LOAD_BALANCE=OFF)
(FAILOVER=ON)
(DESCRIPTION=
(CONNECT_TIMEOUT=5)
(TRANSPORT_CONNECT_TIMEOUT=3)
(RETRY_COUNT=3)
(ADDRESS_LIST=
(LOAD_BALANCE=ON)
(ADDRESS=(PROTOCOL=TCP)(HOST=proddbscn.us.dell.com)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=PROD_FORMS_N_WEB))
)
(DESCRIPTION=
(CONNECT_TIMEOUT=5)
(TRANSPORT_CONNECT_TIMEOUT=3)
(RETRY_COUNT=3)
(ADDRESS_LIST=
(LOAD_BALANCE=ON)
(ADDRESS=(PROTOCOL=TCP)(HOST=proddrdbscn.us.dell.com)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=PROD_FORMS_N_WEB))
)
)
15 Dell - Restricted - Confidential
TNS configuration for HA
SCAN LISTENER
Service “prod_forms_n_web" has 5 instance(s).
Instance “prod1", status READY, has 1 handler(s) for this service...
Instance "prod3", status READY, has 1 handler(s) for this service...
Instance "prod4", status READY, has 1 handler(s) for this service...
Instance "prod5", status READY, has 1 handler(s) for this service...
Instance "prod6", status READY, has 1 handler(s) for this service...
LOCAL LISTENER NODE 1
Service “prod_forms_n_web" has 1 instance(s).
Instance “prod1", status READY, has 1 handler(s) for this service...
16 Dell - Restricted - Confidential
How is CNAMES used for?
CNAME Record
It is short abbreviation for Canonical Name
Provides an alias name for same hostname
Helps create subdomains
CNAMES is really useful for server replacement purpose. It avoids changes in
app network configuration.
We don’t need use CNAME in a database switchover.
17 Dell - Restricted - Confidential
Q&A
18 Dell - Restricted - Confidential