Veritas Cluster Server 6.
0 for UNIX:
Example Application Configurations
Example 2: Clustering Databases
Lesson objectives
Topic
Objectives
VCS database agents
Describe VCS agents for managing
databases.
Database
preparation
Prepare a database for use in a VCS
environment.
The database agent
for Oracle
Install and configure the VCS Oracle agent.
Database failover
behavior
Configure database failover behavior.
Additional Oracle
agent functions
Implement additional functionality provided
by the Oracle agent.
VCS database agents
After completing this topic, you
will be able to describe VCS
agents for managing databases.
Agents for managing databases
Database agents
Not all agents are supported on all
platforms.
You can also manage some databases using the
Application agent or customized agents.
Database agent functions
Start a specified database
instance.
Stop the specified instance.
Monitor the instance.
Clean up after a fault to enable
failover and prevent possible
concurrency violations.
Most database agents have multilevel monitoring.
Basic-level monitoring may check the process table for
applicable database processes.
Detail or second-level monitoring may write to a test
table in the specified database.
Second-level monitoring
Information required to access and write to a table
A database user account with update
privileges.
The password for the database user account.
The name of the database table.
The name of the SQL script used to write to
the table
Monitoring listener processes
Some databases have listeners built-in and do not
require additional VCS agents for monitoring.
The Netlsnr agent has two-level monitoring for the
Oracle listener:
Basic: Scans the process table for the tnslsnr process
Detail: Uses lsnrctl to test the listener
Oracle
server
Listener
Net8
User
ONS
Protocol
Server
Data
Database preparation
After completing this topic, you
will be able to prepare a database
for the VCS environment.
Verifying software compatibility
Use the latest database agent available for the VCS version in use.
Check agent guides to verify that the database version is supported.
Examples:
sort.symantec.com
Oracle on
Solaris
Oracle agent 6.0:
VCS 6.0
DB2 on AIX and
Linux
DB2 agent 6.0
VCS 6.0
Solaris SPARC 10 (32-,
64-bit)
AIX 6.1, 7.1
Solaris x64 10 (64-bit)
Oracle 10g R2, 11g R1
and R2
RHEL 5 & 6, SLES 10 &
11, OEL5
DB2 ESE 9.1, 9.5, and 9.7
Database program (binary) files
Comparing binary file locations
Local disk
Provides redundancy
Requires the database
to be installed and
configured identically on
each system
Shared storage
Simplifies configuration
when there are many
systems that can run
the database
Requires all systems to
have the same mount
point directory for the
database home
directory
Data files
Comparing shared storage objects
File system
File systems must be located on shared disks.
Create the same file system mount point on each system
in the cluster.
Raw volume
Set the permissions for the volumes to be owned permanently by
the database:
vxedit g diskgroup set group=dba user=oracle \
mode=660 volume
You cannot change permission only in UNIX. VxVM sets volume
permissions upon import.
Database-related system files
Database-related system files must be consistent on all
systems that can run the database:
Database user accounts
Passwords for database user accounts
Database group entries
Listener entries
Database shared memory settings
The database service group (virtual) IP address
NOTE: Refer to Database vendor documentation for details
Network configuration
For listener service failover:
Include at least one IP resource in the service group for the
database.
Set the host name for this virtual IP address for the host field in
the listener configuration file.
LISTENER=
listener.ora
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=hr_ora)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))
. . .
IP
. . .
10.10.21.54 hr_ora
. . .
/etc/hosts
10.10.21.54
The database agent
for Oracle
After completing this topic, you
will be able to install and
configure the Oracle agent.
Installing database agents
Database agents:
Are automatically installed on all cluster systems
if you select recommended or all package sets
Are included in the VRTSvcsea package
Must be installed on all database failover target
systems.
Can be installed manually from the software
distribution manually using operating system
utilities
Note: Agent-specific types file must be added to
main.cf if you install agents manually
High availability database configuration
overview
Binaries on local storage
Prepare OS
Install database sw
Configure database
More
systems?
N
Add service group
Test database
Add/test resources
Stop resources
Test service group
Oracle service group configuration
example
hr_oralistener
hr_oraip
hr_orasg
hr_oracle
hr_oraarchivemnt
hr_oraredomnt
hr_oraarchivevol
hr_oraredovol
hr_oradg
hr_oranic
hr_oradatamnt
hr_oradatavol
Configuring an Oracle resource
Resource definition
value
Service group name
hr_orasg
Resource name
hr_oracle
Resource type
Oracle
Starts and stops an
Oracle instance
Monitors the process
table
Required attributes
Sid
HR
Owner
oracle
Home
/hrdata
main.cf
Oracle hr_ora(
Sid = HR
Owner = oracle
Home = "/hrdata"
)
Optional Oracle attributes: The
StartUpOpt attribute
Value
Action
STARTUP
Runs startup
STARTUP_FORCE
(default)
Runs startup force
RESTRICTED
Starts the database in restricted mode
RECOVERDB
Performs a recovery of database files upon instance
startup
Runs a custom SQL command file;
CUSTOM
an example is to start up in standby mode and
apply logs
The ShutDownOpt attribute
Value
Action
IMMEDIATE (default)
Runs shutdown immediate
TRANSACTIONAL
Performs a transactional stop
SRVCTLSTOP
Uses srvctl to stop the database
CUSTOM
Runs a custom SQL command file
Other optional Oracle attributes
Attribute
Function
MonitorOption
Enables the use the Oracle 10g Health Check APIs to
monitor the SGA and retrieve information
AutoEndBkup
Takes the tablespaces out of backup mode when
coming online
Is set to 1 by default
EnvFile
Specifies the location of a file containing environment
variables
Defines how VCS responds when Oracle stopped outside
IntentionalOffli of VCS
ne
Requires MonitorOption set to 1
Encoding
AgentDebug
Specifies encoding for other language sets
Causes additional debug messages to be logged
Is set to 0 by default
IMF monitoring for Oracle resources
Type Attributes Defaults:
IMF
Mode
MonitorFreq
default)
RegisterRetryLimit
online and offline monitoring
runs monitor entry point every 5 minutes
(MonitorInterval = 60 seconds by
3
IMFRegList
Home, Owner, Sid, MonitorOption
LevelTwoMonitorFreq
Configuring Oracle second-level
monitoring
Oracle hr_oracle(
main.cf
Sid = HR
Owner = oracle
Home = "/hr_ora
EnvFile = "/hr_ora/.ora_envfile"
Enable
LevelTwoMonitorFreq = 1
User = "scott"
Pword = "lgLimHmmKum"
Table = "testtable"
User defined in HR
database with update
privileges for testtable
MonScript = "/opt/VRTSagents/ha/bin/Oracle/SqlTest.pl"
)
The table created in
HR database before
enabling the VCS resource
The executable script
containing SQL
statements
Error handling for detail monitoring
Customized error handling configured in:
/opt/VRTSagents/ha/bin/Oracle/oraerror.dat.
Example entry for invalid user name or password error:
ORA-01017 invalid username/password; logon denied
Action
Description
IGNORE
Takes no action; error is not critical
UNKNOWN
Marks the resource state as UNKNOWN
WARN
FAILOVER
Marks the resource state as ONLINE
Generates Warning level message in engine_A.log
Marks the resource offline when a serious error
occurs
Faults resource and fails over service group
NOFAILOVER
Freezes the service group temporarily
Marks the resource OFFLINE
Configuring a Netlsnr resource
Resource
definition
Value
Service Group
Name
hr_orasg
Resource Name
hr_oranetlsnr
Resource Type
Netlsnr
Required attributes
Owner
oracle
Home
/hr_ora
Starts and stops a
listener process using
lsnrctl
Monitors the process
table
Example optional attributes
TnsAdmin
/hr_ora/net/admin
Listener
LISTENER
LsnrPwd
S2cEjcD5s3Cbc
EnvFile
/oracle/dbs/envfile
Monscript
/opt/VRTSagents/
ha/bin/Netlsnr/
LsnrTest.pl
Level-two
monitoring
Other common Oracle configurations
Netlsnr
Oracle
Mount
IP
NIC
Oracle
BinVol
DataVol
Mount
Mount
Netlsnr
DBDG
LogVol
DataVo
l
DBDG
IP
NIC
Database failover
behavior
After completing this topic, you
will be able to configure database
service group failover behavior.
Database failover scenarios
To restart the listener and never fail over if it faults:
Set the listener resource to non-critical.
Do not make the listener a child of a critical resource.
Set RestartLimit = x.
To prevent VCS from cleaning or failing over:
Set ManageFaults=NONE for the service group.
Send notification on fault only; no clean, no
failover
Even if a database resource is non-critical:
The clean entry point runs if the resource faults.
The database is shutdown and left offline.
Additional Oracle
agent functions
After completing this topic, you
will be able to implement
additional functions provided by
the Oracle agent.
Other Oracle agent functions
Action
Run virtual fire drills.
Perform predefined
actions on a resource.
Script common DBA
tasks.
Info
Obtain static and
dynamic information
about the state of an
online resource (such
as a database).
See the VCS Agent for Oracle Installation and
Configuration Guide for details about using the
action and info entry points.
Running a virtual fire drill
hr_orasg
s1
Oracle actions:
getid
hr_orasg
pfile.vfd
home.vfd
owner.vfd
tnsadmin.vfd
havfd hr_orasg sys s1 -v
Lesson summary
Key points
VCS provides a variety of agents to manage databases.
The Oracle agent has specialized functions for managing
Oracle databases.
Reference materials
Veritas Cluster Server Bundled Agents Reference Guide
Veritas Cluster Server Agent for Oracle, Installation and
Configuration Guide
Veritas Cluster Server Agent Developers Guide
High Availability Design Using Veritas Cluster Server Course
End of Presentation