jeudi 31 mai 2012

Asmlib et les disques ASM


Comment fait ASM pour détecter ses disques quant-il utilise l’asmlib. 

En fait, l’asmlib scan les headers des disques pour identifier si le disque est un disque ASM ou pas. Mais pas seulement, il est capable d’identifier son nom, disque groupe et le failure groupe auquel il appartient.

vendredi 18 mai 2012

Linux clusterware en mode actif/passif



Cet article décrit les étapes de mise en place d'une solution de cluster à moindre coût. Pour ce faire je vais utiliser le clusterware linux (aka pacemaker), puis déclarer une ressouce Apache pour effectuer les tests fonctionnel de mon cluster.

lundi 7 mai 2012

RACCHECK pour vérifier votre cluster


RACCHECK est un outil développé par Oracle ayant pour but de vérifier votre configurations Clusterware.

Il formule des suggestions et des conseils pour modifier la configuration RAC afin de répondre aux best practice Oracle.

Cet outil vérifie les paramètres suivantes;

- Les paramètres du noyau OS, les packages et les paramètres du système d'exploitation
- CRS / Grid Infrastructure
- SGBDR; paramètres de la mémoire et de base de données
- Les paramètres et les statistiques de l'ASM.

J'ai eu l'occasion de testé l'outil sur un RAC 11.2.0.1, 2 nœuds sous une distrib. Oracle Enterprise Linux. Ah, avant d'oublié c'est RAC installé sur VirtualBox c'est juste un bac à sable.

Pour information cet outil est supporté à partir de la version RAC 10.2.0.1.

Avant de commencer il faut télécharger l'outil sur la note MOS ID: 1268927.1

Décompressez le fichier puis positionner les droits comme suit;

[oracle@rac1 raccheck]$ ls 
RACcheck.zip 
[oracle@orac1 raccheck]$ unzip RACcheck.zip 
Archive:  RACcheck.zip 
inflating: raccheck 
inflating: readme.txt  inflating: UserGuide.txt 
inflating: collections.dat 
inflating: rules.dat 
creating: .cgrep/ 
inflating: .cgrep/lcgrep5 
inflating: .cgrep/lcgrep4 
inflating: .cgrep/lcgrep6 
inflating: .cgrep/lcgreps9 
inflating: .cgrep/lcgreps10 
inflating: .cgrep/acgrep 
inflating: .cgrep/scgrep 
inflating: .cgrep/scgrepx86 
[oracle@rac1 raccheck]$  

[oracle@rac1 raccheck]$ chmod 755 raccheck 
[oracle@rac1 raccheck]$

On y est, lancé l'outil comme;
[oracle@rac1 raccheck]$ ./raccheck -a 
CRS stack is running and CRS_HOME is not set. Do you want to set CRS_HOME to /u01/app/11.2.0/grid?[y/n][y]y 
Node rac2 is configured for ssh user equivalency for oracle user 
Searching for running databases . . . . . 
. . .  
raccheck found database RAC registered in OCR. Is this the database to check best practices for?[y/n][y]y 
Checking Status of Oracle Software Stack - Clusterware, ASM, RDBMS 
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
------------------------------------------------------------------------------------------------------- 
                                                 Oracle Stack Status 
------------------------------------------------------------------------------------------------------- 
Host Name  CRS Installed  ASM HOME       RDBMS Installed  CRS UP    ASM UP    RDBMS UP  DB Instance Name 
------------------------------------------------------------------------------------------------------- 
rac1       Yes             Yes             Yes             Yes        Yes      Yes      RAC1 
rac2       Yes             Yes             Yes             Yes        Yes      Yes      RAC2 
------------------------------------------------------------------------------------------------------- 
140 of the included audit checks require root privileged data collection . If sudo is not configured or the root password is not available, audit checks which  require root privileged data collection can be skipped. 
1. Enter 1 if you will enter root password for each  host when prompted 
2. Enter 2 if you have sudo configured for oracle user to execute root_raccheck.sh script  
3. Enter 3 to skip the root privileged collections  
4. Enter 4 to exit and work with the SA to configure sudo  or to arrange for root access and run the tool later. 
Please indicate your selection from one of the above options[1-4][1]:- 1 
*** Checking RAC Best Practice Recommendations (PASS/WARNING/FAIL) *** 
Performing SQL collections for use with audit checks on RAC...please stand by. 
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  
Log file for collections and audit checks are at 
/home/oracle/raccheck/raccheck_080311_124252/raccheck.log 
=============================================================  
                    Node name - rac1 
============================================================= 
Collecting - ASM DIsk I/O stats 
Collecting - ASM Disk Groups 
Collecting - ASM disk partnership imbalance 
Collecting - ASM diskgroup attributes 
Collecting - ASM initialization parameters 
Collecting - Active sessions load balance for RAC database 
Collecting - Archived Destination Status for RAC database 
Collecting - CONNECT Role Grantees for RAC database 
Collecting - Cluster Interconnect Config for RAC database 
Collecting - Data Files In Backup Mode for RAC database 
Collecting - Database Archive Destinations for RAC database 
Collecting - Database Component Status for RAC database 
Collecting - Database Files for RAC database 
Collecting - Database Instance Settings for RAC database 
Collecting - Database Parameters for RAC database 
Collecting - Database Properties for RAC database 
Collecting - Database Registry for RAC database 
Collecting - Database Sequences for RAC database 
Collecting - Database Undocumented Parameters for RAC database 
Collecting - Database Workload Services for RAC database 
Collecting - Dataguard Status for RAC database 
Collecting - Files Needing Media Recovery for RAC database 
Collecting - Files not opened by ASM 
Collecting - INVALID SYS and SYSTEM objects for RAC database 
Collecting - INVALID application objects for RAC database 
Collecting - Invalid Java Objects for RAC database 
Collecting - Invalid Registry Components for RAC database 
Collecting - JVM Roles for RAC database 
Collecting - Log Sequence Numbers for RAC database 
Collecting - Objects Duplicated in SYS and SYSTEM Schema for RAC database 
Collecting - Percentage of asm disk  Imbalance 
Collecting - Process for shipping Redo to standby for RAC database 
Collecting - Redo Log information for RAC database 
Collecting - Standby redo log creation status before switchover for RAC database 
Collecting - CPU Information 
Collecting - CRS active version 
Collecting - CRS oifcfg 
Collecting - CRS software version 
Collecting - CSS Reboot time 
Collecting - CSS diagwait 
Collecting - CSS disktimout 
Collecting - CSS miscount 
Collecting - Cluster interconnect (clusterware) 
Collecting - Clusterware OCR healthcheck 
Collecting - Clusterware Resource Status 
Collecting - Huge pages configuration 
Collecting - Kernel parameters 
Collecting - Linux module config. 
Collecting - Maximum number of semaphore sets on system 
Collecting - Maximum number of semaphores on system 
Collecting - Maximum number of semaphores per semaphore set 
Collecting - Memory Information 
Collecting - OS Packages 
Collecting - Oracle Executable Attributes 
Collecting - Shared memory segments 
Collecting - Table of file system defaults  
Collecting - Voting disks (clusterware) 
Collecting - number of semaphore operations per semop system call 
Preparing to run root privileged commands  rac1.  Please enter root password when prompted. 
root@rac1's password: 
Collecting - CRS user limits configuration 
Collecting - CRS user time zone check 
Collecting - Custom rc init scripts (rc.local) 
Collecting - Interconnect interface config 
Collecting - Network interface stats 
Collecting - OCFS2 disks 
/tmp/root_raccheck.sh: line 30: /sbin/mounted.ocfs2: No such file or directory 
Collecting - Root Open File Limit 
Collecting - ocsf status 
/tmp/root_raccheck.sh: line 39: /etc/init.d/o2cb: No such file or directory 
Collecting - root time zone check  
Data collections completed. Checking best practices on rac1. 
-------------------------------------------------------------------------------------- 
 INFO =>    $CRS_HOME/log/hostname/client directory has too many older log files. 
 INFO =>    user_dump_dest has trace files older than 30 days for RAC 
 INFO =>    ORA-00600 errors found in alert log for RAC 
 INFO =>    background_dump_dest has files older than 30 days for RAC 
 WARNING => fast_start_mttr_target has NOT been changed from default on RAC1 instance 
 INFO =>    audit_file_dest has audit files older than 30 days for RAC 
 WARNING => Controlfile is NOT multiplexed for RAC 
 WARNING => One or more redo log groups are NOT multiplexed for RAC 
 INFO =>    oracleasm (asmlib) module is NOT loaded 
 WARNING => kernel.shmmax parameter is NOT configured according to recommendation 
 WARNING => Open file limit for root user (ulimit -n) is NOT >= 65536 or unlimited 
 INFO =>    Number of SCAN listeners is NOT equal to the recommended number of 3. 
 WARNING => NIC bonding is  not configured for interconnect 
 WARNING => NIC bonding is NOT configured for public network (VIP) 
 WARNING => crsd Log Ownership is NOT Correct (should be root root) 
 WARNING => crsd/orarootagent_root Log Ownership is NOT Correct (should be root root) 
 WARNING => ohasd/orarootagent_root Log Ownership is NOT Correct (should be root root) 
 WARNING => ohasd Log Ownership is NOT Correct (should be root root) 
 WARNING => OSWatcher is not running as is recommended. 
 INFO =>    Jumbo frames (MTU 9000) are not configured for interconnect 
 WARNING => kernel parameter rp_filter is set to 1. 
Best Practice checking completed.Checking recommended patches on rac1. 
--------------------------------------------------------------------------------- 
Collecting patch inventory on  CRS HOME /u01/app/11.2.0/grid 
Collecting patch inventory on ORACLE_HOME /u01/app/oracle/product/11.2.0/dbhome_1 
--------------------------------------------------------------------------------- 
1 Recommended CRS patches for 112010 from /u01/app/11.2.0/grid on rac1 
--------------------------------------------------------------------------------- 
Patch#   CRS  ASM    RDBMS RDBMS_HOME                              Patch-Description 
--------------------------------------------------------------------------------- 
9655006   no          no  /u01/app/oracle/product/11.2.0/dbhome_1GI PSU 11.2.0.1.2 (INCLUDES DATABASE PS 
--------------------------------------------------------------------------------- 
--------------------------------------------------------------------------------- 
1 Recommended RDBMS patches for 112010 from /u01/app/oracle/product/11.2.0/dbhome_1 on rac1 
--------------------------------------------------------------------------------- 
Patch#   RDBMS    ASM     type                Patch-Description 
--------------------------------------------------------------------------------- 
11724930  no             merge               DATABASE PSU 11.2.0.1.5 (INCLUDES CPUAPR 
--------------------------------------------------------------------------------- 
--------------------------------------------------------------------------------- 
--------------------------------------------------------------------------------- 
              Clusterware patches summmary report 
--------------------------------------------------------------------------------- 
Total patches  Applied on CRS Applied on RDBMS Applied on ASM 
--------------------------------------------------------------------------------- 
1              0              0                0 
--------------------------------------------------------------------------------- 
--------------------------------------------------------------------------------- 
              RDBMS homes patches summmary report 
--------------------------------------------------------------------------------- 
Total patches  Applied on RDBMS Applied on ASM ORACLE_HOME 
--------------------------------------------------------------------------------- 
 1              0              0                /u01/app/oracle/product/11.2.0/dbhome_1 
--------------------------------------------------------------------------------- 
============================================================= 
                    Node name - rac2 
============================================================= 
Collecting - CPU Information 
Collecting - CRS active version 
Collecting - CRS oifcfg 
Collecting - CRS software version 
Collecting - Cluster interconnect (clusterware) 
Collecting - Huge pages configuration 
Collecting - Kernel parameters 
Collecting - Linux module config. 
Collecting - Maximum number of semaphore sets on system 
Collecting - Maximum number of semaphores on system 
Collecting - Maximum number of semaphores per semaphore set 
Collecting - Memory Information 
Collecting - OS Packages 
Collecting - Oracle Executable Attributes 
Collecting - Shared memory segments 
Collecting - Table of file system defaults 
Collecting - number of semaphore operations per semop system call 
Preparing to run root privileged commands  rac2.  Please enter root password when prompted. 
root@rac2's password:  
Data collections completed. Checking best practices on rac2. 
-------------------------------------------------------------------------------------- 
INFO =>    $CRS_HOME/log/hostname/client directory has too many older log files. 
INFO =>    user_dump_dest has trace files older than 30 days for RAC 
INFO =>    background_dump_dest has files older than 30 days for RAC 
WARNING => Open files limit (ulimit -n) for current user is NOT set to recommended value >= 65536 or unlimited 

Comme vous pouvez voir l'outil propose de modifier de nombreux paramètres, y compris les valeurs du noyau, la purge des fichiers journaux, la configuration du réseau, les patchs recommandés et les options de sécurité.

Plus de détails sur l'outil peut être trouvé sur la note MOS ID: 1268927.1