Oracle 11.2 Restart

Avec Oracle 11g Release 2 (aka 11gR2 ou Oracle 11.2), le clusterware devient « Grid Infrastructure ». Comme le clusterware avant elle, l’infrastructure Grid regroupe les fonctions de membership, de supervision ou de gestion des évènements du cluster bien sur. Pourtant, la vision change radicalement ! Il s’agit désormais d’offrir un ensemble de services décorrélé de la technologie Real Application Clusters et destiné aux Administrateurs Système (SA). La « Grid Infrastructure » regroupe ainsi ASM tel qu’on le connait dans les versions antérieures mais également de nombreuses facilités pour les serveurs comme :

  • Un Volume Manager (ADVM), un système de fichiers (ACFS) et une technologie snapshots
  • Un ensemble d’outils pour assurer le loadbalancing des connexions et la configuration réseau du cluster
  • Des scripts pour permettre la migration en live d’instances Oracle (OMotion)
  • Des agents spécifiques pour de nombreuses technologies comme Timesten, Siebel, Oracle

Comme vous l’avez sans doute déjà remarqué, la « Grid Infrastructure » permet différent types de déploiements qui vont d’une configuration clusters multi-noeuds à une infrastructure mono serveur appelée « Grid Infrastructure for a Standalone Server » en passant par un ensemble de RAC Single-Instances géré globalement qui pourrait s’appeler « RAC-One ».
Dans cet article, je vais vous parler de la configuration la plus simple : « Grid Infrastructure for a Standalone Server » autrement dit Oracle Restart. Et comme il faut bien commencer par quelque chose, je vous propose de commencer par l’installation en mode silencieux d’Oracle Restart et quelques manipulations associées.

Configurer ASMLib

Oracle Restart s’appuie généralement sur ASM; qui dit ASM sur Linux dit, quand c’est possible ASMLib. Pour installer Oracle Restart, j’ai donc choisi d’installer ASMLib; De ce côté, aucun changement comme le montre l’ensemble des manipulations ci-dessous:

# su -
groupadd sysasm
groupadd sysoper
groupadd asmdba
usermod -a -G sysasm,sysoper,asmdba oracle
# fdisk -l /dev/hdc
Disk /dev/hdc: 3222 MB, 3222274048 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
 Device Boot      Start         End      Blocks   Id  System
/dev/hdc1               1         391     3140676   83  Linux
# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.
Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]
# /etc/init.d/oracleasm createdisk DISK1 /dev/hdc1
Marking disk "DISK1" as an ASM disk:                       [  OK  ]
# /etc/init.d/oracleasm listdisks
DISK1
# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver:                     [  OK  ]
Scanning the system for Oracle ASMLib disks:               [  OK  ]

Installer « Grid Infrastructure for a Standalone Server »

Vous voilà prêt à installer la « Grid Infrastructure ». Si vous voulez procéder en mode silencieux, le plus simple est d’effectuer l’installation en suivant les 4 étapes ci-dessous :

  • Créer l’Inventory Oracle si celui-ci n’existe pas déjà,
  • Installer Oracle « Grid Infrastructure for Standalone Server »
  • Démarrer le logiciel en lançant le script root.sh
  • Configurer le listener et ASM avec les assistants d’après l’installation

Créer l’Inventory

Si c’est le premier logiciel que vous installez sur votre serveur, vous n’avez pas d’inventory Oracle. Vous trouverez ci-dessous un script que vous pourrez adapter en changeant les utilisateurs et les groupes à votre grès et ainsi créer cet inventory; lancez-le sous l’utilisateur root :

su -
if [ -f "/etc/oraInst.loc" ]; then
echo "File Exists"
else
echo "inventory_loc=/u01/app/oraInventory" >/etc/oraInst.loc;
echo "inst_group=oinstall" >>/etc/oraInst.loc;
mkdir -p /u01/app/oraInventory;
chown oracle:oinstall /u01/app/oraInventory;
chmod 664 /etc/oraInst.loc;
fi

Installer le logiciel Oracle

Vous voilà prêt à lancer l’installation de l’infrastructure Grid. Téléchargez le logiciel sur Oracle Technology Network ainsi que les patchs sur My Support; Vous pourrez ensuite décompresser la distribution « Grid » et connaître le détail des paramètres à utiliser dans le fichier response/crs_install.rsp; dans l’exemple qui suit, je fais quelques raccourcis puisqu’il ne s’agit que d’un test et qu’il n’existe aucun patch pour l’instant mais il vous appartient de remplir les différentes variables selon vos besoins:

unzip linux_11gR2_grid.zip
cd grid
export DISTRIB=`pwd`
./runInstaller -silent -responseFile $DISTRIB/response/crs_install.rsp
-ignoreSysPrereqs -ignorePrereq
SELECTED_LANGUAGES=en
oracle.install.option=HA_CONFIG
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid
oracle.install.asm.OSDBA=asmdba
oracle.install.asm.OSOPER=sysoper
oracle.install.asm.OSASM=sysasm
oracle.install.crs.config.autoConfigureClusterNodeVIP=false
oracle.install.asm.diskGroup.name=DATA
oracle.install.asm.diskGroup.redundancy=EXTERNAL
oracle.install.asm.diskGroup.diskDiscoveryString="ORCL:*"
oracle.install.asm.diskGroup.disks="ORCL:DISK1"
oracle.install.asm.SYSASMPassword=ArKZoYD666
oracle.install.asm.monitorPassword=ArKZoYD666

Voici le journal de mon installation; vous remarquerez les différents avertissements que vous n’aurez aucun mal à contournez :

Starting Oracle Universal Installer...
Checking Temp space: must be greater than 80 MB.   Actual 1015 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 2039 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-09-10_04-00-05PM. Please wait ...
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root scripts to run
/u01/app/oracle/product/11.2.0/grid/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
4. Return to this window and hit "Enter" key to continue
Configuration assistants have not been run. This can happen for following reasons - either root.sh
is to be run before config or Oracle Universal Installer was invoked with the -noConfig option.
"/u01/app/oracle/product/11.2.0/grid/cfgtoollogs/configToolAllCommands" script contains all
commands to be executed by the configuration assistants. This file may be used to run the configuration
 assistants outside of OUI. Note that you may have to update this script with passwords (if any)
before executing the same.
Successfully Setup Software.

Exécuter le script root.sh

Voilà, l’installation est terminée ou presque; il vous reste plus qu’à exécuter le script root.sh sous root :

/u01/app/oracle/product/11.2.0/grid/root.sh
Check /u01/app/oracle/product/11.2.0/grid/install/root_black.easyteam.fr_2009-09-10_16-43-12.log
for the output of root script

Vous pouvez ensuite vérifier que le service HAS est démarré:

. oraenv
ORACLE_SID = [oracle] ? grid
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/11.2.0/grid
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle
crsctl check has
CRS-4638: Oracle High Availability Services is online
exit;

Exécuter les assistants de configuration complémentaires

En mode interactif, l’installation exécute ensuite les assistants pour configurer le listener et ASM qui font désormais parti de la « Grid Infrastructure ». En mode silencieux, le script associé est contenu dans le fichier $ORACLE_HOME/cfgtoollogs/configToolAllCommands; pour l’exécuter, vous devez ajouter une variable supplémentaires qui contient le mot de passe d’ASM. Cela qui évite aux assistants de stocker un mot de passe, même temporairement, dans un fichier; la commande ci-dessous termine donc la configuration:

. oraenv
ORACLE_SID = [oracle] ? grid
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/11.2.0/grid
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid is /u01/app/oracle
touch  $ORACLE_HOME/cfgtoollogs/cfg.properties
chmod 600 $ORACLE_HOME/cfgtoollogs/cfg.properties
echo "oracle.assistants.asm|S_ASMPASSWORD=ArKZoYD666" >> $ORACLE_HOME/cfgtoollogs/cfg.properties
echo "oracle.assistants.asm|S_ASMMONITORPASSWORD=ArKZoYD666" >> $ORACLE_HOME/cfgtoollogs/cfg.properties
cd $ORACLE_HOME/cfgtoollogs
./configToolAllCommands RESPONSE_FILE=$ORACLE_HOME/cfgtoollogs/cfg.properties

La sortie du script de configuration ressemble à ce qui suit:

Setting the invPtrLoc to /u01/app/oracle/product/11.2.0/grid/oraInst.loc
perform - mode is starting for action: configure
Sep 11, 2009 2:39:49 AM oracle.install.driver.oui.config.GenericInternalPlugIn invoke
INFO: Executing ASMCA
Sep 11, 2009 2:39:50 AM oracle.install.driver.oui.config.GenericInternalPlugIn invoke
INFO: Command /u01/app/oracle/product/11.2.0/grid/bin/asmca -silent -oui_internal
   -configureASM -diskString ORCL:* -diskGroupName DATA -diskList ORCL:DISK1 -redundancy EXTERNAL
Sep 11, 2009 2:39:50 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: ... GenericInternalPlugIn.handleProcess() entered.
Sep 11, 2009 2:39:50 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: ... GenericInternalPlugIn: getting configAssistantParmas.
Sep 11, 2009 2:39:50 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: ... GenericInternalPlugIn: checking secretArguments.
Sep 11, 2009 2:39:50 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: ... GenericInternalPlugIn: starting read loop.
Sep 11, 2009 2:40:07 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read: SYS_PASSWORD_PROMPT
Sep 11, 2009 2:40:07 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Processing: SYS_PASSWORD_PROMPT for argument tag -sysAsmPassword
Sep 11, 2009 2:40:07 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read: ASMSNMP_PASSWORD_PROMPT
Sep 11, 2009 2:40:07 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Processing: ASMSNMP_PASSWORD_PROMPT for argument tag -asmMonitorPassword
Sep 11, 2009 2:40:07 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: End of argument passing to stdin
Sep 11, 2009 2:41:25 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read:
Sep 11, 2009 2:41:25 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read: ASM created and started successfully.
Sep 11, 2009 2:41:25 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read:
Sep 11, 2009 2:41:25 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read: DiskGroup DATA created successfully.
Sep 11, 2009 2:41:25 AM oracle.install.driver.oui.config.GenericInternalPlugIn handleProcess
INFO: Read:
perform - mode finished for action: configure
You can see the log file: /u01/app/oracle/product/11.2.0/grid/cfgtoollogs/oui/configActions2009-09-11_02-39-28-AM.log

Vous pouvez effacer le fichier qui contient les mots de passe ASM pour des raisons évidentes de sécurité et valider l’installation et la configuration de restart et des composants associés :

rm -f $ORACLE_HOME/cfgtoollogs/cfg.properties
$ crsctl check css
CRS-4529: Cluster Synchronization Services is online
$ srvctl config asm
ASM home: /u01/app/oracle/product/11.2.0/grid
ASM listener: LISTENER
Spfile: +DATA/asm/asmparameterfile/registry.253.697257661
ASM diskgroup discovery string: ORCL:*
$ srvctl status asm
ASM is running on black
$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): black
$ srvctl status diskgroup -g data -a
Disk Group data is running on black
Disk Group data is enabled

Si vous exécutez le script sans préciser de paramètre, il échouera avec un message d’erreur à propos d’ASM dans les fichiers de $ORACLE_HOME/cfgtoollogs/cfgfw comme ci-dessous :

{Parameter:S_ASMPASSWORD in {Aggregate:oracle.assistants.asm:11.2.0.1.0:common}}:
parameter value has never been set and no default is present.
 at oracle.sysman.emCfg.core.CfmParameterState.expressData(CfmParameterState.java:720)
 at oracle.sysman.emCfg.core.CfmParameterState.expressDataAsArgv(CfmParameterState.java:541)
 at oracle.sysman.emCfg.core.CfmParameterPair.appendDataAsArgv(CfmParameterPair.java:372)
 at oracle.sysman.emCfg.core.CfmArguments.expandOneArgv(CfmArguments.java:92)
 at oracle.sysman.emCfg.core.CfmArguments.expand(CfmArguments.java:61)
 at oracle.sysman.emCfg.core.CfmArguments.expandAsArgv(CfmArguments.java:107)
 at oracle.sysman.emCfg.core.PerformMicroStep.runJavaClass(PerformMicroStep.java:540)
 at oracle.sysman.emCfg.core.PerformMicroStep.executeMicroStep(PerformMicroStep.java:120)
 at oracle.sysman.emCfg.core.ActionPerformer.performMicroStep(ActionPerformer.java:917)
 at oracle.sysman.emCfg.core.ActionPerformer$Performer.run(ActionPerformer.java:1038)

Et ensuite ?

Vous voilà fin prêt pour la suite : créer un système de fichier ACFS et Installer un ORACLE_HOME de base de données dessus ? Créer un volume ASM et le monter en ext3 ? Créer une base de données et la piloter avec srvctl ? Créer des fichiers et générer des snapshots ?

5 réflexions sur “Oracle 11.2 Restart”

  1. Ping : Créer vos templates OracleVM manuellement | EASYTEAM

  2. Ping : Oracle Silent Mode, Partie 10 : Installer un Cluster RAC 11.2 | EASYTEAM

  3. Bonjour,
    j’essaye d’installer Oracle restart sur une base oracle 11gR2 déjà existante.
    La base est géré par un système de fichiers pas ASM.
    En essyant d’installer oracle restart avec une installation silencieuse j’ai l’erreur suivante:
    [grid@db grid]$ ./runInstaller -silent -responseFile /opt/Linux_installs/restart/grid/response/grid_install.rsp
    Starting Oracle Universal Installer…
    Checking Temp space: must be greater than 120 MB. Actual 23763 MB Passed
    Checking swap space: must be greater than 150 MB. Actual 16479 MB Passed
    Preparing to launch Oracle Universal Installer from /tmp/OraInstall2011-06-21_09-21-07PM. Please wait …
    [grid@db grid]$ [FATAL] [INS-30504] Missing ASM disk group name.
    CAUSE: ASM disk group name was not entered in the text field.
    ACTION: Enter a valid ASM disk group name.
    [FATAL] [INS-30507] Empty ASM disk group.
    CAUSE: No disks were selected from a managed ASM disk group.
    ACTION: Select appropriate number of disks from a managed ASM disk group.
    [grid@db grid]$
    Aucune idée?
    Merci,

  4. Ping : Pendant les vacances, consultez les dix articles les plus lus du blog EASYTEAM « EASYTEAM LE BLOG

  5. Ping : Oracle Restart Silent Installation | Pythian Group Blog

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *