© 2004 hewlett-packard development company, l.p
TRANSCRIPT
© 2004 Hewlett-Packard Development Company, L.P.The information contained herein is subject to change without notice
Sandy GruverSenior Technical ConsultantHP/Oracle Advanced Technology Center sandra.gruver@ hp.com
Best Practices for Oracle on HPUX
June 14, 2010 2
Topics• Installation setup for Oracle on HPUX
• Recommended Kernel parameter settings for Oracle
• Using WLM with Oracle and HPUX partitions
• File System recommendations
• Storage Layout Recommendations
• Backup and Recovery best practices
• Day to day Oracle DBA hints and best practices
• High Availability for Oracle on HPUX
• Monitoring your Oracle environment
• Support for Oracle on HPUX and Oracle information
June 14, 2010 3
Before Installing Oracle on HPUX
June 14, 2010 4
Brief reviewHPUX SysAdm tool - SAM
June 14, 2010 5
H/W and S/W requirementsOverall system requirements
• Operating System− HPUX 11.0 and HPUX 11i. − Oracle 9i onward is only available for 64 bit HPUX
• S/W requirements − Any X server supported by the UNIX system− Need to have ar, cc and ld under /usr/ccs/bin − Need to have Java make installed
• Physical Memory− Minimum 256 MB for 9i Server (as per release notes). Suggested
to have around 4 GB or more• Swap Space
− Twice the amount of physical Memory or Minimum 400 MB• Disk Space
− Approx 3 GB for Database S/W and additional space for seed database etc.
June 14, 2010 6
• Install the necessary HP-UX patches
− Listed in the Oracle Installation Guide
− For patch bundles:
• http://www.software.hp.com/SUPPORT_PLUS
− For individual patches:
• http://itresourcecenter.hp.com
− To check on patches:
− $ /usr/sbin/swlist -l patch
− $ /usr/sbin/swlist -l patch patch_number
− $ /usr/sbin/swlist -l bundle
• Increase /tmp space to at least 2GB
• Modify Kernel parameters for Oracle
H/W and S/W requirementsPatches are extremely important
June 14, 2010 7
Enhancing performance of Oracle enable Sched_Noage
As root, create the file /etc/privgroupdba MLOCK (for asynch IO)dba RTS CHED RTPRIO (for priority
s che duling)
Issue the commands: # /usr/sbin/setprivgrp -f /etc/privgroup# /usr/sbin/getprivgrp dba
Set the HPUX_SCHED_NOAGE Oracle initialization parameter
− On HP-UX 11.0, the range is 153 to 255− On HP-UX 11i, the range is 178 to 255
June 14, 2010 8
Oracle Users and Groups
• Create UNIX groups (oinstall, dba)# /usr/sbin/g roupadd oins tall# /us r/sbin/g roupadd dba
• Create a UNIX account (oracle) to own Oracle software# /usr/sbin/use radd -g oins tall -G dba oracle
• For Oracle10g: Create a Unix account (extjob) to own the executable extjob
# /us r/sbin/use radd e xtjob• After installing Oracle, make these changes to the extjob file
• # cd oracle _home /bin• # mv extjob.nobody extjob• # chown extjob extjob• # chmod 4711 extjob
June 14, 2010 9
A Few Important Environment variables
• ORACLE_HOME
e.g. export ORACLE_HOME=/oracle/9i_64b
• ORACLE_SID
e.g. export ORACLE_SID=oratest
• PATH
e.g. export PATH=$ORACLE_HOME/bin:$PATH
• SHLIB_PATH/LD_LIBRARY_PATH
e.g.
export LD_LIBRARY_PATH=$ LD_LIBRARY_PATH:$ORACLE_HOME/lib64
June 14, 2010 10
File and Directory Setup tasks• Set the home directory of user oracle to
− $ORACLE_OWNER $HOME directory*
• Set the default shell to /bin/sh for the Bourne shell
• In the .profile, set
− umask 022
− xhost +
• Check the Oracle Inventory information after installation
# more /var/opt/oracle/oraInst.loc
inv e ntory_loc=/u01/app/oracle /oraInv e ntory
ins t_group=oins tall
* S e e s implifie d OFA late r in pre se ntation
June 14, 2010 11
1. Enter the following command as the root user:# sam
2. Choose the Kernel Configuration area.3. Choose the Drivers area.4. Choose the asynchronous disk driver (asyncdsk).5. Select Actions>Add Driver to Kernel.6. Select List>Configurable Parameters.7. Choose the MAX_ASYNC_PORTS parameter.8. Select Action>Modify Configurable Parameter.9. Specify a new value for the parameter, then choose OKSet Oracle initialization parameter DISK_ASYNCH_IO to
TRUE.
Implementing Asynchronous I/O: ( ) NOTE Done ONLY if us ing RAW not fs s torage
June 14, 2010 12
Implementing Asynchronous I/O
June 14, 2010 13
Recommended Kernel parameter settings for Oracle
June 14, 2010 14
•Specified in the documentation for Oracle•See “Oracle Database Installation Guide”•To list all kernel parameters
$ /usr/sbin/kmtune –l |moreOr use SAM
•To check 32 or 64 bit HP-UX 11.x $ /bin/getconf KERNEL_BITS$ 64
•To check 32 or 64 bit Oracle software version$ cd $ORACLE_HOME/bin$ file oracle$ oracle : ELF-64 e xe cutable obje ct file - PA-RIS C 2.0 (LP64)
HP-UX Kernel Settings for Oracle DBs
June 14, 2010 15
File System buffer-Cache Parameters:
between 2 and 5% of memory
Min dynamic buffer cachedbc_min_pct
between 3 and 10 % of memory
Max dynamic buffer cachedbc_max_pct
0Pages of static buffer cache – older parm
bufpages
Open or Locked Files Parameters:
(15 * NPROC + 2048)Open files limitnfile
(NPROC) (at least 4096)File lock limitnflocks
(8 * NPROC + 2048)Max inodes in memoryninode
1024 (default)Hard limit for open filesmaxfiles_lim
1024Soft limit for open filesmaxfiles
Recommended MinimumHP-UX Kernel Settings for Oracle DBs
June 14, 2010 16
Parameters for Logical Volume Manager:
Increase to the number of volume groups you would like to have on the system (maximum 256)
Maximum volume groups on the system
maxvgs
Recommended MinimumHP-UX Kernel Settings for Oracle DBs
Parameters for Memory Paging and Variable Page Size:
4096 (up to 65536 for large RAM)
Swap chunk sizeswchunk
64Max page size in Kbytesvps_ceiling
16384Max swap space on the system
maxswapchunks
1 (on)Enable/disable pseudo-swapswapmem_on
June 14, 2010 17
Parameters for Process Management:
Recommended MinimumHP-UX Kernel Settings for Oracle DBs
1073741824 bytes or (0x40000000)
Max process storage seg size for 64bit procs
maxssiz_64bit
256Max threads/procmax_thread_proc
((NPROC*9)/10)Max # of procs/usermaxuprc
128MBMax process text seg sizemaxtsize
(((NPROC * 7) / 4) + 16)Max kernel threadsnkthread
4096Max procs/systemnproc
134217728 bytesMax process storage seg size for 32bit procs
maxssiz
2147483648 bytes or (0x80000000)
Max process data seg size for 64bit procs
maxdsiz_64bit
1073741824 bytes or (0x40000000)
Max process data seg size for 32bit procs
maxdsiz
June 14, 2010 18
InterProcessCommunication Message Parameters:
32767# segs in msg queuemsgseg
nprocMax msg queuesmsgmni
(2+msgmni)Message map sizemsgmap
nprocTotal msgs on systemmsgtql
Recommended MinimumHP-UX Kernel Settings for Oracle DBs
InterProcessCommunication Semaphore Parameters:
(nproc-4)Max undos/semsemmnu
(semmni*2)Max sems for users/syssemmns
(semmni+2)Free sem map sizesemmap
4096Max sems/systemsemmni
32767Max sem valuesemvmx
June 14, 2010 19
InterProcessCommunication Shared Memory Parameters:
120 per Oracle databaseMax segments/procshmseg
512Max segments/systemshmmni
Large enough to hold the entire SGA in one shared memory segment
Max shared memory segment
shmmax
Recommended MinimumHP-UX Kernel Settings for Oracle DBs
Miscellaneous Parameters:
max. no of shadow processes + no of parallel query slaves (could go up to nproc)
Max ports to asynch driver/system
max_async_ports
set to number of concurrent Oracle DB users + 64
Max simultaneous users/system
maxusers
June 14, 2010 20
Updating Kernel Parameters
Edit /stand/vmunix
− Backup /stand/system
− Edit/modify /stand/system
− config /s tand/sys te m
? Check that it created vmunix_test in local directory
− Backup /stand/vmunix
− mv /s tand/v munix_te s t
/s tand/v munix
− shutdown -r
OR Use SAM
June 14, 2010 21
Using WLM with Oracle and HPUX partitions
June 14, 2010 22
server resource pool
HP Virtual Server Environment: server resource flexing for applications
security
Policy engine provisions
resources based on SLOs and
business priorities for each
application.
ReportingOracleApps
June 14, 2010 23
HP Partitioning Continuum Clustered nodes
OS image with HWisolation
Virtual partitionsvPar
OS image
with SW isolation
OS image
with SW isolation
OS image
with SW isolation
hard partition
1 OS image
Application 1 with guaranteed
compute resources
Application 2 with guaranteed
compute resources
Application n with guaranteed
compute resources
Based
on
CP
Us o
r percen
tages
IsolationHighest degree of separation
FlexibilityHighest degree of dynamic capabilities
OS image with HWisolation
OS image with HWisolation
HP-UX Workload Manager
Hard partitionsnPar
Resources partitionsPRM/pSets
June 14, 2010 24
vPars logical overview
• creates illusion of separate hardware platforms
• manages shared physical resources
• monitors health of operating system instances
• multiple applications, instances or versions
• name space and resource isolation
• individual “servers”• different OS revs• each OS custom-tunable• dynamic resource allocations
Hardware Platform / Hard Partition
vPar Monitor
HP-UXRevision APatch Lvl 1
HP-UXRevision APatch Lvl 2
HP-UXRevision BPatch Lvl 1
Dept. AApp 1
Dept. AApp 1’
Dept. BApp 2
vPar1 vPar2 vPar3
June 14, 2010 25
HP-UX Virtual Partitions
• Why choos e vPars over?nPars
− vPars provides:•Dynamic processor movement
without rebooting the partition•Single cpu granularity•Can run within an nPar
• Why choos e vPars over ?res ource partitions
− vPars provides:
•Software fault isolation•Different versions of the OS•Application isolation
- HP UXRevis io
.1n A
- HP UXRevis io
.2n A
- HP UXRevis io
.3n B
- HP UXRevis io
.3n B
. Dept A 1App
. Dept A 1’App
. Dept B 2App
. Dept B 3App
Multiple HP-UX instances running on the same system
or in the same nPar
rp5470, rp7400, Superdome, rp8400, rp7410, Itanium2 server
June 14, 2010 26
➝System/data center consolidation
➝development/test environments
➝increased system utilization
➝varying workload requirements:–time of day: order entry during day, batch at night
–time of month (payroll, end-of-month/end-of-year financials
–as particular needs require
➝service provider (providing system resources to different users/applications)
➝unique application tuning of O/S
➝time zoning
Where vPars provide the most value
June 14, 2010 27
File System recommendations
June 14, 2010 28
File system Options
Using Online JFS improves performance•Set these mount options
− delaylog − nodatainlog − mincache=direct
− convosync=direct
•Enabling largefiles with Online JFS# fsadm -F vxfs -o largefiles /file s y s te m
June 14, 2010 29
•The default Oracle db_block_size on HP-UX is 2048.
•We recommend using: − db_block_size = 8192 for OLTP Applications− db_block_size = 8192 to 16384 for DSS/DW
Applications
•LVM designed for 8192 blocksize •Oracle RAC may benefit from a smaller db_block_size to reduce the amount of data to transfer between the nodes for cache fusion
•Must be set when creating database
Oracle db_block_size
June 14, 2010 30
Data Storage FormatRaw or File System?
• Oracle databases can be implemented either:
• in file systems, or
• in “raw” format
• File Systems:
• overhead (space, CPU, and locking)
• double-buffering & synchronous I/O
June 14, 2010 31
Oracle mapping to LVM
June 14, 2010 32
Space Layout
RawFile System
Logical Volume
Logical Volume
Logical Volume
Oracle Data
Oracle Data
Oracle Data
Oracle Data
FS overhead
empty space
FS file
FS file
June 14, 2010 33
PERCEPTION
“Raw” vs. File Systemsome common misconceptions
FACT
• Raw requires ugly low-level UNIX commands.
• Raw uses LVM just like file systems.
• Need rocket scientists to understand & manage.
• If you manage a FS you already manage raw.
June 14, 2010 34
FILE SYSTEM• create volume group• create logical volumes
• leave extra room• ‘newfs’ on logical vols• mount file systems• create Oracle files
• tie to fs files• /orafs/ora/file1.dbf
Database Administration Examplepreparing to create a database
RAW• create volume group• create logical volumes
• create extra LVs
• create Oracle files• tie to LVs• /dev/vgora/rorafile1.dbf
June 14, 2010 35
FILE SYSTEM
CREATEDB:STARTUP NOMOUNTCREATE CONTROLFILE …DATAFILE'/ora1/data01.dbf'
Database Administration Exampledefine oracle data commands
RAW
CREATEDB:STARTUP NOMOUNTCREATE CONTROLFILE …DATAFILE'/dev/vg9idata/rdata01_2000M.dbf'
June 14, 2010 36
FS: OEM + bdf
Database Administration Exampletypical database tasks
RAW: OEM
MONITOR S PACE
ADD MORE S PACE
FS: use extra space in FS or create new FS
RAW: use extra LVs or create new VGs
ACCIDENTALLY DES TROY DATABAS E
FS: ‘rm -R *’ or ‘newfs’ or ‘lvremove’
RAW: ‘lvremove’
June 14, 2010 37
Backup & Recover
FILE SYSTEM
• RMAN & (Storage Data Protector)
• fbackup
• tar or cpio or dd
• optionally pipe to compre ss
RAW
• RMAN & (Storage Data Protector)
• dd
• optionally pipe to compre ss
RMAN is the preferred method of backing up Oracle
RMAN does not distinguish between raw and FS
June 14, 2010 38
SummaryRaw-based Databases on HP-UX
• Better performance than HP-UX filesystems
• 33-100% better throughput
• No harder to manage than file systems
• same tools & techniques as file-system admin
June 14, 2010 39
Storage Layout Recommendations
June 14, 2010 40
Storage technologythen vs. now
then nowdisk size 100-500 MB 100-500 GBarchitecture JBOD RAID arrayson-board cache none/ tiny large‘a spindle’ one disk array group?
June 14, 2010 41
The usual database layout
•sort database objects by size and expected I/O volume
•implement high-volume objects in striped volumes with various stripe-widths
•squeeze other objects in where they fit
•monitor performance of individual disks and objects
•play ‘chess’ with file placement to find best performance
June 14, 2010 42
‘SAME’ technique(proposed by Oracle’s Juan Loaiza)
Stripe And Mirror Everything
• stripe all files across maximum # disks
• use 1MB stripe size
• use mirroring for high availability
• place “hot” files on outer edge of disks
• keep it simple
June 14, 2010 43
SAME advantages
• large I/Os minimize impact of disk head movement
• very wide stripe-set allows full I/O throughput capacity to help all transactions
• no need to consider characteristics of individual files/tables/transactions
June 14, 2010 44
SAME modified for large storage arrays
• increase stripe depth to 4-8MB
− implement small critical objects with small stripe
• ignore disk-geometry considerations
• create separate stripesets for different subsets of storage (different RAID levels or disk size/speeds)
• possibly move redo logs to separate device OR use cache LUN
June 14, 2010 45
Oracle data organization
•Objects & Tables − data, index, etc
•Tablespaces
•Files − map to space at
OS level
tablespace
tables/objects
file file file file ...
‘log ical’
‘phys ical’
June 14, 2010 46
Oracle mapping to LVM
June 14, 2010 47
PV mapping to the hp xp array
Array (RAID) group
Array (RAID) group
Array (RAID) group
tablespace tablespace tablespace
oracle
LV LV LV
PVPVPVPVPV
LVM
vol. grp.
LUN
LUN
LUN
LUN
LUN
LUN
LUN
LUN
LUN
array...
EXAMPLE: PV mapping to a disk array
June 14, 2010 48
Implementing SAME
• decide “stripeset width” (# disks or array groups)
− four to eight groups recommended
• create one volume group per stripeset
• create multiple logical volumes per VG
• (create filesystems on top of LVs)
• allocate Oracle objects among stripesets
• map Oracle files to LVs or to filesystem files
June 14, 2010 49
• create LVs using LVM ‘extent striping’−use 4MB or 8MB extents
• divide objects evenly among VGs−keep each object wholly contained in a VG
• for raw I/O−create standard-sized LVs−use symbolic links in Oracle to point to file locations
Implementing SAME
June 14, 2010 50
Special Considerations for Oracle Redo Logs
Online logs deserve very special attention• multiplex logs in addition to RAID• locate members so they share no common points of
failure at the disk, channel, or board level• where possible, locate on dedicated (or otherwise quiet)
disk spindles
Possible downside effects• excess of disk capacity to meet all these constraints • isolation to single disks or LUNs may not be possible• peak throughput is reduced
June 14, 2010 51
Monitor performance & balance I/O
• look for high I/O wait states on shadow processes
• monitor volume group I/O rates
• move Oracle files (if necessary) to balance I/O
June 14, 2010 52
EXAMPLE: Performance advisor/xp
monitors• LDEV I/O• port utilization• internal bus
utilization• cache usage
June 14, 2010 53
Optimal S implifie d Archite cturea variation on OFA*
* See Oracle® Databas e Ins tallation Guide for more information
The Optimal S implifie d Archite cture (OS A) recommends three main directories:
• $ORACLE_OWNER $HOME directory • environment files, configuration files, administrative scripts, etc.
This directory gets taken forward with Oracle version upgrades.• $ORACLE_HOME $ORACLE_BASE directories
• Oracle product bits. The $ORACLE_HOME directory changes with each release of Oracle.
• $ORACLE_DATA directory • hot database files, such as DBF files and archive log files
which should not be backed up with normal file system backups.
Also recommend that each $ORACLE_SID be under a unique $ORACLE_OWNER
June 14, 2010 54
$ORACLE_HOME and $ORACLE_S ID uniquely identify an Oracle server
•A user can change these operating system variables to work with a different version of the software or a different instance.
•Table space names should be descriptive and restricted to eight characters plus a two-digit identifier
•Table space names should be used in the name of the data file name.
Optimal S implifie d Archite cturea variation on OFA
June 14, 2010 55
Optimal S implifie d Archite cturePerformance Benchmark
File I/O Stats BEFORE AFTER GAINFilename mS/ mS/ mS/ mS/ %age %age
Read Write Read Write Read Write
/opt/oracle/u05/thadtbs1.dbf 0.09 16.58 0.09 12.45 24%/opt/oracle/u05/thadtbs2.dbf 0.21 15.42 0.19 13.68 9% 11%/opt/oracle/app/ti1tbs.dbf 0.09 12.08 0.09 9.16 24%/opt/oracle/u02/ti2tbs.dbf 0.09 16.34 0.09 11.16 32%/opt/oracle/u03/ti3tbs.dbf 0.12 12.69 0.12 10.54 17%/opt/oracle/u03/ti4tbs.dbf 2.75 20.39 1.61 15.30 41% 25%/opt/oracle/u01/tttdbs.dbf 6.80 9.61 4.86 6.98 29% 27%
June 14, 2010 56
Summary
• stripe everything equally& simply
• use broad stripe size to balance overall I/O
• add capacity in broad stripeset units
• implement using OSA
• monitor performance to ensure balance
June 14, 2010 57
Backup and Recovery best practices
June 14, 2010 58
HP Recommends
•Use standard tools utilizing HP’s Data Protector (DP) and Oracle’s Recovery Manager (RMAN)
•Define standard backup/recovery processes utilizing standard tools
•Clearly identify support organization’s roles and responsibilities for database backup and recoveries
•Simplify/standardize backup/recovery procedures
•The overall goal is to reduce support costs
June 14, 2010 59
HP OpenView Storage Data Protector 5.1 Features
• enterprise data protection that automates routine tasks and ensures recovery from any potential disruption
• distributed architecture with centralized control
• the first to integrate disk- and tape-based recovery in a single product
for maximum protection at the
lowest cost
June 14, 2010 60
Newest features in Data Protector 5.1
Enhanced functional capabilities for more control:•Easy to use Oracle restore GUI allowing administrators to
select all or individual RMAN restore options •Simplified SAN auto-configuration wizard automatically
detecting and configuring the backup drives in the SAN
Increased resilience with recovery from any disruption •Industry’s first fully-integrated Zero-Downtime backup solution
for HP StorageWorks EVA and XP arrays•Integrated Instant Recovery capability for HP StorageWorks
EVA and XP customers enabling the recovery of even terabytes of data in minutes
June 14, 2010 61
•simple GUI
•complete end-to-end management
•fewer staff managing more systems
•reporting on service levels
•portal for providing status info
•integration with Oracle Recovery Manager (RMAN) for zero-downtime backup
Data Protector (Omniback)service-driven management approach
enterprise-wide protection management
June 14, 2010 62
s
recovery imageon tape
automatic management &re-cycling of recovery
imagesrecovery
pointobjective
(how old is the data to which
I recover?)
within past hour
12 hours
2 hours
3 hours
midnight
11:55 a.m.incidenttime
recovery images on disk
Page 62
data protector automates scheduling & replication of images to optimize storage capacity
June 14, 2010 63
EXAMPLE: Oracle9i Backup using Data Protector with Business Copy on HP storage
1. Running Environment
2. Backup
• Freeze point in time on the disks and split the mirror• Unfreeze the disks and perform backup from the mirror
S
T
S
T
• Resynchronize the mirror
S
T
“Zero DowntimeBackup”
June 14, 2010 64
EXAMPLE: Oracle9i RAC Restore using Data Protector with Business Copy on HP storage
S
T
1. Database Crash
2. Split the pair
S
T
3. Restore from tape
S
T
4. Restore from T to S-Vol
S
T
June 14, 2010 65
Restoring the data takes time
minutesseveral hours how long does it take?
Recovery Time Objective
tape backup
InstantRecovery
June 14, 2010 66
Data Protector - Instant RecoveryA new approach
• Fast, automated restore directly from the T-Vol
• Data is instantly available without any data neccessary to be moved
• Neither host involved in data processing
• The backup version will be accessible instantaneously and production can start immediately
S
T
T
S
June 14, 2010 67
S
T
Data Protector - Instant RecoveryHow to use it
• Using Zero Downtime Backup (ZDB) as a basic concept
• The link stays split after the backup
• This provides a version for fast recovery from disk
• Restore is done automatically by Data Protector
• No manual mirror handling required
Running Split Backup Prepare
RecoverableVersion between Backup and Prepare
S
T
S
T
S
T
S
T
tape
1 pm 1:15 pm 3 pm 12:30 pm
June 14, 2010 68
Rotate the Mirrors
• Using up to 3 different mirrors of XP Business Copy
• Allow instant access to earlier version (t0) at a future time (t2)
• i.e. Restore on Wednesday a version of Monday within minutes
• Data Protector automatically manages the separate mirrors
• Define a policy on how the mirror for the next backup should be prepared
• After the backup finished• Before the next backup starts
S
t0
S
t0 t1
S
t0 t1 t2
S
t0 t1 t2
June 14, 2010 69
Maintain Version on Disk only
• The data movement to tape is optional• Only one version would go to tape (I.e. t1)
• In the time t1 is moved to tape other versions could be created (t2 & t0)
• Therefore the tape throughput no longer dictates the backup frequency
• More version could be created in a shorter time
• DB recovery is drastically improved
P
t0
P
t0 t1
P
t0 t1 t2
P
t0 t1 t2
tape
June 14, 2010 70
data protector breaks the link between
disk-based protection and tape
data protectorinstant recovery
administrators can choose - disk-only protection, - tape-only protection, or - scheduled combinations depending on the business needfor a particular application
once configured, Data Protector fully automates the continuous protection process, including rotation of mirrors
for recovery, administrator selects the specific recovery image from the GUI
production data
point-in-time copies(split mirrors or snapshots)
t
application server
backup device server
managementsystem
t0
t -2t -1
tape
June 14, 2010 71
Recovery Manager (RMAN) features
• Standard tool supplied and supported by Oracle Corporation• Backups are done at block level, meaning no need for tablespace
backup mode, less overhead• No extra redo generated during online backup• Ability to do incremental database backups• Database and archived log backups are both handled by RMAN• Corrupt block detection• Tablespace point in time recovery support• Ability to do block level recovery (this addresses recovering from
corrupt blocks)• Support for RAW devices• Support for Real Application Clusters (RAC)• Complete integration with HP OpenView Data Protector
June 14, 2010 72
RMAN vs. OS Backup
Feature RMAN
Op Sys
Offline Backups supported supported
Corrupt Block detection
supported requires Begin/End
Backup stmts.
Automatic backup
supported not supported
Backup catalogs
supported not supported
Online Backups
supported not supported
June 14, 2010 73
RMAN/Data Protector Database Backup and Recovery Test Results
Test setup•200GB test database
•backups and recoveries were done using different numbers of tape drives and RMAN channels
Results• best database restore performance
• one channel per tape drive during the backup
• double the number of channels during the restore
Recommendation• allocate 1 or 2 RMAN channels per tape drive to be used for the backup
• allocate twice as many RMAN channels for the recovery
June 14, 2010 74
Backup/Recovery Suggested Responsibilities
•DBA group responsible for RMAN catalog setup and maintenance
•DBA group responsible for contacting Backup team for backup configuration and scheduling
•RMAN/DP Backups handled by Backup team•Backup failures and monitoring handled by Backup team
•Recovery responsibility can be handled by DBA group (using RMAN scripts)
•Recovery responsibility will be migrated to Backup team (Data Protector V5.1 Oracle Restore GUI training needed in Backup team)
June 14, 2010 75
Other backup considerations
•RMAN Catalog management and backup strategy•RMAN/Data Protector training•Identification of roles/responsibilities of Database and Backup teams in overall backup/recovery process
•Identification of escalation process to Oracle of RMAN problems/bugs
•Identification of escalation process to HP of Data Protector problems/bugs
June 14, 2010 76
Another option for Data Replication Use of Quest SharePlex
•Activate the SharePlex configuration file on the current production database
•Create the interim database using a hot backup and SharePlex Overdrive
•Activate the config file on the backup database
•Begin posting
June 14, 2010 77
SharePlex
Step one is to establish the working database with minimal impact onUser activity.
•Activate SharePlex configuration file•Create interim database using a hot-backup and SharePlex Overdrive
HP-UX
HP-UX
Another option for Data Replication Use of Quest SharePlex
June 14, 2010 78
Day to day Oracle DBA hints and best practices
June 14, 2010 79
SQLPlus Tips simple formatting commands
SQLPlus - a command line reporting tool
$ sqlplus ‘/ as sysdba’
SQL> select table_name from dba_tables;
Report formatting commands
alter line lengths (in characters)
alter page lengths (in lines)
alter column widths and styles
suppress the display of duplicate column rows
June 14, 2010 80
SQLPlus Example example SQL query
Give me a list of all tables with their size and tell me if they’ve been backed up.
select owner, table_name, tablespace_name, num_rows, backed_up from dba_tablesorder by owner, tablespace_name
June 14, 2010 81
SQLPlus Example without formatting commands
June 14, 2010 82
SQLPlus Examples setting formatting commands
June 14, 2010 83
SQLPlus Example with column formatting
June 14, 2010 84
SQLPlus Examples of simple formatting commands
1. Alter line lengths SQL> SET LINESIZE 70
2. Alter page length SQL> SET PAGESIZE 65
3. Alter column widths and styles.SQL> COLUMN surname FORMAT A15 SQL> COLUMN surname FORMAT A15 TRUNC Display only the first 15 characters of the column. SQL> COLUMN surname FORMAT A15 WRAPDisplay multiple lines, splitting after the 15th character on each line
For a list of column commandsSQL> HELP COLUMN
June 14, 2010 85
Advice for the DBA
DAILY PROCEDURES
Verify all instances are up
Look for any new alert log entries
Verify success of database backup
Verify success of database archiving to tape
Verify enough resources for acceptable performance
Copy Archived Logs to Standby Database and Roll Forward
Read DBA manuals for one hour
June 14, 2010 86
Advice for the DBA
NIGHTLY PROCEDURES
Collect volumetric data
WEEKLY PROCEDURES
Look for objects that break rules
Look for security policy violations
Look in SQL*Net logs for errors, issues
Archive all Alert Logs to history
Visit home pages of key vendors
June 14, 2010 87
Advice for the DBA
MONTHLY PROCEDURES
Look for Harmful Growth Rates
Review Tuning Opportunities
Look for I/O Contention
Review Fragmentation
Project Performance into the Future
Perform Tuning and Maintenance
June 14, 2010 88
Example: Hardware for a Customer Oracle Installation
IntranetStorageDevelopment
3 Oracle Instance75 Developers
Test/Integration4 Oracle Instancesup to 200 Active users
Production1 Oracle Instance6000 logged-on users3000 active users70% CPU utilization
concurrentprocessingserver
fail-over fordatabase server+ application server
databaseserver
fail-over forconcurrentprocessingserver
applicationservers
database serverfail-over server
application serverfail-over server
redundant network
100/10BaseT Segment - Dedicated HeartbeatHeartbeat
HP9000 SD3200032 CPUs (550MHz)64 GB Memoryone partition
HP9000 SD3200032x 550 MHz CPUs64 GB Memoryone partition
application serverfail-over server
database serverfail-over server
Backup
PowerRun Att n. Fault Disk A Disk B Rem ot eC LA SS
PowerRun Att n. Fault Disk A Disk B Rem ot eC LA SS
PowerRun Att n. Fault Disk A Disk B Rem ot eC LA SS
PowerRun Att n. Fault Disk A Disk B Rem ot eC LA SS
4xHP9000 N40008x 550 MHZ CPUs16 GB Memory2 Giga Ethernet Card2x 36 GB Disk
P o we rR u n Attn . Fa u lt R em o te
HP9 0 0 0
C L A S S
2 0 0 0
HP9000 L30004x 550 MHz CPUs5 GB Memory2 Giga Ethernet2 Fibre Channel4x 36 GB Disks
P ow e rR u n Attn . F a ult Re m ote
HP9 0 00
C L A S S
2 0 0 0
HP9000 L30004x 550 MHz CPUs5 GB Memory2 Giga Ethernet2 Fibre Channel4x 36 GB Disk
P ow e rR un Attn . F a ult Re m ote
HP9 00 0
C L A S S
2 0 00
P ow e rR un A ttn . F au lt Re m ote
HP9 0 0 0
C L A S S
2 0 00
HP9000 L30003x 550 MHz CPUs4 GB Memory Giga Ethernet Fibre Channel4x 36 GB Disk
HP9000 L30002x 550 MHz CPUs4 GB Memory Giga Ethernet Fibre Channel4x 36 GB Disk
XP512
200 GB disk usable(development)1.5 TB disk usable(test/integration)1.5 TB disk usable(production)
100/10BaseT Segment - Dedicated HeartbeatHeartbeat
P o we rR u n A ttn. Fa u lt R e mo te
HP9 0 0 0
C L A S S
2 0 0 0
HP9000 L30002x 550 MHz CPUs2 GB Memory2 Giga Ethernet Cards6 Fibre Channel Cards2x 36 GB Disk
DMZ
Po w erRu n A ttn. F a ult Re m ote
HP9 0 00
CLAS S
20 0 0
Po w erRu n A ttn. F a ult Re m ote
HP9 0 00
CLAS S
20 0 0
2x (Windows)HP NetServer, LH3000r2x 800 MHZ CPUs2 GB Memory2 Giga Ethernet Cards2 Fibre Channel Cards2x 36 GB Disk
Internet & Extranet
HP e-Firewall
mobiledevicegateway
DLTLibraryHP VirtualVault
User Clients
June 14, 2010 89
High Availability for Oracle on HPUX
June 14, 2010 90
Software Malfunction14%
Viruses7%
Natural Disasters3%
Hardware or System Malfunction
44%
Human Error32%
Source: Understanding Data LossSource: Understanding Data Loss. CBL Data Recovery Technologies Inc. Industry Sources – Data Recovery Report
Leading Causes of Data Loss
June 14, 2010 91
HP & Oracle handle all causes of downtime
PlannedDowntime
UnplannedDowntime
DatabaseMaintenance
SystemMaintenance
HumanError
Data Failure& Disaster
SystemFailure
Online Redefinition,Partitioning, Parallel SQL
Dynamic reconfiguration (Patches/Drivers) + MC/SG or RAC
Flashback Query, LogMinerDataGuard, Split Mirror
9i RMAN & HP Data Protector integration / Data Guard / ...
MC/SG or RAC on HP, Fast Restart
June 14, 2010 92
HP ServiceGuard cluster
• Non-Shared Database
• Provides 16 node failover solution
Dis k A Dis k B
Oracle Orac le
Sys temA Sys temB
Virtual Server with virtual IP Address
Before Failover:
• Virtual IP Address and network name refers to System A
After Failover:
• Virtual IP address and network name refers to System B
June 14, 2010 93
• Balance workload after a node failure
• Minimize impact on remaining nodes
Node 4
Pkg C
Pkg H
Pkg I
Node 2
Pkg A
Pkg D
Pkg E
Node 3
Pkg B
Pkg F
Pkg G
If Node 1 fails...
Node 1
Pkg A
Pkg B
Pkg C
HP ServiceGuard cluster
June 14, 2010 94
HP ServiceGuard Software Stack
HP-UX 11.x
HP MC/ServiceGuard
HP MC/ServiceGuard
Application 2
Database forOracle
Instance 1
Active ActiveOracle
Instance 1
Application 2Storage
ExclusiveAccess
ExclusiveAccess
failover
HP-UX 11.x
June 14, 2010 95
Limits of Cold Failover Clusters
• Scalability of cluster is limited to scalability of one server
• Load cannot be distributed across all nodes in the cluster
• Cold failover is slow, as many time consuming tasks must be performed as part of failover
− moving and mounting logical volumes
− starting the oracle instance− opening the data files
• After failover, the instance caches are cold introducing a performance brownout
June 14, 2010 96
HP-UX 11.x
HP ServiceGuard Extension for RAC
HP-UX 11.x
HP ServiceGuard Extension for RAC
Shared Database for Oracle
Instances 1 & 2
Oracle9i EE + RAC Instance 1
Oracle9i EE + RAC Instance 2
SharedAccess
SharedAccess
Oracle9i RAC with SG Extension for RAC
Cluster Interconnect
RedoRedoRedo Thread1
RedoRedoRedo Thread2
June 14, 2010 97
Oracle9i RAC Architecture in Detail
Global Cache Service
USERUSER
SGA
Node 1, Instance A
USERUSERUSERUSER DBWRDBWR LGWRLGWR
DatabaseDatabaseBufferBufferCacheCache
Redo LogRedo LogBuffersBuffers
LCK0LCK0
DataDataDataData
USERUSER
SGA
Node 2, Instance B
USERUSERUSERUSER DBWRDBWR LGWRLGWR
DatabaseDatabaseBufferBufferCacheCache
Redo LogRedo LogBuffersBuffers
LCK0LCK0
RedoRedoRedo Redo
9i Cache Fusion9 i Cache Fus ion
ControlRedo
Thread2Redo
Thread1
June 14, 2010 98
Monitoring your Oracle environment
June 14, 2010 99
Monitoring with OpenView Operations
June 14, 2010 100
Monitoring with Oracle Enterprise Manager
June 14, 2010 101
Support for Oracle on HPUX and Oracle information
June 14, 2010 102
Simpler, faster problem resolutionkeeps your business on-line and your staff on-schedule
Together, we solve your problem.
Reactive
Call eitherHP or Oracle
for any interoperability
problem
Proactive
HP and Oracleprovide coordinated assessments and
optimization
Joint HP/Oracle Support
June 14, 2010 103
Getting Help – HP’s IT Resource Center (ITRC)
June 14, 2010 105
Where to go for more information:
:// . .http otn orac le com
:// . .http metalink orac le com
June 14, 2010 106
http://www.optimaldba.com/library.html
http://www.orapub.com/
http://searchoracle.techtarget.com/
Where to go for more information:
Oracle websites external to HP and Oracle
June 14, 2010 107
ACM Transactions on Database Systems (TODS)Canadian Information Processing Society
Computer Measurement GroupDAMA International
IEEE Computer Society International Oracle Users Group
NaSPA Home PageObject Database Management Group Home Page
Object Management Group (OMG)The OLAP CouncilSoftware Publishers AssociationSoftware Research
SQL Standards Home PageTDWI - The Data Warehouse InstituteTransaction Processing Performance Council (TPC) HomeXML.com
- Databas e Related Organizations with web s ites