RAC 10g Best Practices On Linux: Roland Knapp RAC Pack
RAC 10g Best Practices On Linux: Roland Knapp RAC Pack
Agenda
! Planning Best Practices ! Implementation Best Practices ! Operational Best Practices
VIP1
VIP2
VIP3
Node1
ASM instance 1 Database instance 1 CRS Operating System
cluster interconnect
Node 2
ASM instance 2 Database instance 2 CRS Operating System
shared storage cluster interconnect
Node3
ASM instance 3 Database instance 3 CRS Operating System
...
redo logs all instances database & control files OCR & voting disk (oracle_home)
HA by eliminating node & Oracle as Single Points of Failure, SPOF Scalability by making additional processing capacity available incrementally Private interconnect/network switch Shared storage/concurrent access/storage switch OS, Cluster Manager, DBMS/RAC, Application Differences between cluster managers
! Hardware components
! Software components
RH 3.0 NIC Bonding www.kernel.org/pub/linux/kernel/people/marc elo/linux2.4/Documentation/networking/bonding.txt OCFS V2 will support shared ORACLE_HOME
! Local ORACLE_HOME
Enterprise class OS distribution (e.g. RH AS 2.1 and 3.0, Suse SLES/8) Clusterware (Oracle OSD Clusterware) Network Attached Storage (e.g. NetApp filers) Most SCSI and SAN storage are compatible
Agenda
! Planning Best Practices ! Implementation Best Practices ! Operational Best Practices
Implementation Flowchart
Configure HW Install Oracle Software, including RAC and ASM Run VIPCA, automatically launched from RDBMS root.sh
Platform-specific install documentation Quick install guides (if available) from Metalink/OTN Release notes Configure ssh ! 10g OUI uses ssh/scp if configured otherwise rsh/rcp Configure Private Interconnect ! Use UDP and GigE ! Non-routable IP addresses (eg 10.0.0.x) ! Redundant switches as std configuration for ALL cluster sizes. ! NIC teaming configuration (platform dependant) Configure Public Network ! VIP and name must be DNS-registered in addition to the standard static IP information ! Will not be visible until VIPCA install is complete
Red Hat Enterprise Linux AS/ES 2.1 (Update 3 or higher) Red Hat Enterprise Linux AS/ES 3 (Update 2 or higher) SuSE Linux Enterprise Server (SLES) 8 (service pack 3 or higher) SuSE Linux Enterprise Server 9
For a detailed list of all required packages please see Installation Guide 10g Release 1 (10.1) for UNIX Systems: AIX-Based Systems,hp HP-UX, hp Tru64 UNIX, Linux, and Solaris Operating System Part No. B10811-03
SUSE SLES8 (x86) due to be certified with patch set 10.1.0.3, CD cut 24th. September
Linux Itanium
! Operating System Requirements
For a detailed list of all required packages please see Installation Guide 10g Release 1 (10.1) for UNIX Systems: AIX-Based Systems,hp HP-UX, hp Tru64 UNIX, Linux, and Solaris Operating System Part No. B10811-03
Set Kernel parameters in /etc/sysctl.conf Add hostnames / VIP to /etc/hosts file Establish file system or location for ORACLE_HOME (writable for oracle userid)
NIC Bonding
! Required for private interconnect resiliency. ! Various 3rd party vendor solutions available:
Linux ! NIC bonding in RHEL 3.0 ES http://www.kernel.org/pub/linux/kernel/people/marcelo/li nux-2.4/Documentation/networking/bonding.txt ! Intel Advanced Network Services (ANS) http://www.intel.com/support/network/adapter/1000/linu x/ans.htm ! HANIC http://oss.oracle.com/projects/hanic/
Voting Disk >= 20MB, OCR >= 100MB. Use storage mirroring to protect these devices Use large number of similarly sized disks Confirm shared access to storage disks from all nodes Include space for flash recovery area ASM must only see a single (virtual) path to the storage Multi-pathing configuration is platform specific (e.g. Powerpath, SecurePath, ) (And CRS & ASM HOME)
! Configure IO Multi-pathing
Use devlabel
! Use devlabel to create a unique binding to the OCR and Voting device.
To use the command, as root devlabel add -s /dev/raw/raw1 -d /dev/sda1 devlabel add -s /dev/raw/raw2 -d /dev/sdb1 This will add an entry into /etc/sysconfig/devlabel something like this: /dev/raw/raw1 /dev/sda1 S83.3:6006016024d20c003a3cb11d3484d811DGCRAID5sector1005268
The third column is the scsi unique id ( actually it is uuid) which is stored in disk for the life of the LUN and never changes.
Configure ASMLib with the script /etc/init.d/oracelasm configure option Make disks available for ASM with /etc/init.d/oracleasm createdisk VOL1 /dev/sdg
For a detailed installation Instruction please check http://otn.oracle.com/tech/linux/asmlib/install.html
Install CRS/CSS stack with Oracle Universal Installer Start the Oracle stack the first time with $CRS_HOME/root.sh
! CRS and RAC require that the private and public network interfaces be configured prior to installing CRS or RAC ! Specify interconnect for CRS communication
NETCA
Oracle Installation
! The Oracle 10g Installation can be performed after CRS is installed and running on all nodes. ! Start the runInstaller (do not cd in your /mnt/cdrom directory) ! Run root.sh on all nodes
Running root.sh on the first node will invoke VIPCA who will configure your Virtual IPs on all nodes After root.sh is finished on the first node start this sequencially on the remaining nodes.
VIP Installation
! The VIP Configuration Assistant (vipca) starts automatically from $ORACLE_HOME/root.sh ! After the welcome screen you have to choose only the public interfaces(s) ! The next screen will ask you for the Virtual IPs for cluster nodes, add your /etc/hosts defined name under IP Alias Name.
The VIP must be a DNS known IP address because we use the VIP for the tnsnames connect.
! After finishing this you will see a new VIP interface eg: eth0:1. Use ifconfig (on most platforms) to verify this.
! The listener.ora has the VIP IP address configured, this has to be changed as well.
HA Resource ora.RO.RO1.inst ora.RO.RO2.inst ora.RO.db ora.mars.LISTENER_MARS.lsnr ora.mars.gsd ora.mars.ons ora.mars.vip ora.venus.LISTENER_VENUS.lsnr ora.venus.gsd ora.venus.ons ora.venus.vip
RAC will use the same virtual interconnect selected during CRS install To check which interconnect and is used and where it came from use select * from x$ksxpia;
ADDR INDX INST_ID P PICK NAME_KSXPIA IP_KSXPIA ---------------- ---------- ---------- - ---- --------------- --------00000003936B8580 0 1 OCR eth1 10.0.0.1 Pick: OCR Oracle Clusterware OSD Operating System dependent CI indicates that the init.ora parameter cluster_interconnects is specified
SRVCTL
! SRVCTL is a very powerful tool ! SRVCTL uses information from the OCR file ! GSD in 10g is running just for compatibility to serve 9i clients if 9i and 10g is running on the same cluster. ! srvctl status nodeapps -n <nodename> will show all services running on a node
SRVCTL commands are documented in Appendix B of the RAC Admin Guide at: http://download-west.oracle.com/docs/cd/B14117_01/ rac.101/b10765/toc.htm
Post Installation
! Enable asynchronous I/O if available
! To enable asynchronous I/O must re-link Oracle to use skgaioi.o and install Patch Set Exception for bug 3208258, Basebug 3016968 for RH2.1 and RH3.0 ! Workaround until 10.1.0.3, is to use this command:
$ make PL_ORALIBS=-laio -f ins_rdbms.mk async_on
Post Installation
! Install @@@ARU: 10.1.0.2 ARU 6076422 to fix the use of the private interconnect. ! Adjust UDP send / receive buffer size to 256K
2.4.9-e.XX-Uniprocessor kernel 2.4.9-e.XX-smp-SMP kernel capable of handling up to 4GB of physical memory 2.4.9-e.XX-enterprise-SMP kernel capable of handling up to about 16GB of physical memory
2.4.21-XX.EL-Uniprocessor kernel 2.4.21-XX.Elsmp-SMP kernel capable of handling up to 16GB of physical memory 2.4.21-XX.Elhugemem-SMP kernel capable of handling beyond 16GB, up to 64GB (XX = number of the errata kernel)
NTP Protocol
! We recommend setting up the Network Time Protocol (NTP) on all cluster nodes. This will synchronize the clocks among all nodes, and facilitate analysis of tracing information based on timestamps. ! Note that adjusting clocks by more than 15 minutes can cause instance evictions. It is strongly advised to shutdown all instances before date/time adjustments.
Overall tools sar, vmstat CPU /proc/cpuinfo, mpstat, top Memory /proc/meminfo, /proc/slabinfo, free Disk I/O iostat Network /proc/net/dev, netstat, mii-tool Kernel Version and Rel.cat /proc/version Types of I/O Cards lspci -vv Kernel Modules Loaded lsmod, cat /proc/modules List all PCI devices lspci v Startup changes /etc/sysctl.conf, /etc/rc.local Kernel messages /var/log/messages, /var/log/dmesg OS error codes /usr/src/linux/include/asm/errno.h OS calls /usr/sbin/strace-p
Agenda
! Planning Best Practices ! Implementation Best Practices ! Operational Best Practices
ASSM
! Automatic Segment Space Management (ASSM)
Eliminates complex process of computing PCTUSED, FREELISTS and FREELIST GROUPS Allows dynamic affinity of space to instances and avoids hard partitioning of space inherent with free list groups.
! Contention during concurrent access is removed and space usage optimized.
Doesnt need any maintenance. Allows you to support any number of instances without any changes to the object. Use OnLine rebuild features to move objects from Free List Groups to ASSM. Configured automatically in DBCA
Application Deployment
! Same guidelines as single instance
SQL Tuning Sequence Caching Partition large objects Use different block sizes Avoid DDL Use LMTs and ASSM as noted earlier
Operations
! Same DBA procedures as single instance, with some minor, mostly mechanical differences. ! Managing the Oracle environment
Starting/stopping Oracle cluster stack with boot/reboot server Managing multiple redo log threads Use Grid Control
Enable real time priority for LMS Do not run system at 100% CPU over long period Ensure good I/O response times for control file and voting disk
http://biz.yahoo.com/prnews/040913/sfm121_1.html http://www.tpc.org/
QUESTIONS ANSWERS