jeudi 14 mars 2013

OEM 12c - AdminServer Could Not Be Started

Dans un environnement OEM 12.1.0.1.0, après avoir arrêté l'oms, lors du démarrage j'ai rencontré le problème suivant:

cd /bin

[oracle@svrhost ~]$ emctl start oms
Oracle Enterprise Manager Cloud Control 12c Release 12.1.0.1.0
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
Starting WebTier...
WebTier Successfully Started
Starting Oracle Management Server...
Oracle Management Server Successfully Started
AdminServer Could Not Be Started
Oracle Management Server is Up
[oracle@
svrhost ~]$

Après quelques recherches j'ai trouvé ce document oracle:


Le document parle de la version 11g mais cela s'applique aussi à la version 12c.

Commencer par arrêter l'oms:
 
cd /bin
emctl stop oms -all


Rechercher les processus dont le nom contient le mot EMGC_ADMINSERVER
$ ps -aef |grep EMGC_ADMINSERVER

S'il en existe, les tuer comme suit:

$ kill -9

Vérifier la présence des fichiers .lok suivants. S'ils sont présents, les supprimer:


Redémarrer ensuite l'oms:
 
cd /bin
[oracle@
svrhost ~]$ emctl start oms
Oracle Enterprise Manager Cloud Control 12c Release 12.1.0.1.0
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
Starting WebTier...
WebTier Successfully Started
Starting Oracle Management Server...
Oracle Management Server Successfully Started
Oracle Management Server is Up
[oracle@svrhost
~]$

Hope it helps...

mercredi 27 février 2013

ORA-27300: OS system dependent operation:semget failed with status: 28

Dans un environnement Oracle LInux 5.5, en voulant démarrer une instance ou une base de données, je reçois le message suivant:

[oracle@svrhost1 ~]$ srvctl start instance -d exem -i exem1
PRCR-1013 : Failed to start resource ora.exem.db
PRCR-1064 : Failed to start resource ora.exem.db on node svrhost1
CRS-5017: The resource action "ora.exem.db start" encountered the following error:
ORA-27154: post/wait create failed
ORA-27300: OS system dependent operation:semget failed with status: 28
ORA-27301: OS failure message: No space left on device
ORA-27302: failure occurred at: sskgpcreates
. For details refer to "(:CLSN00107:)" in "/ora01/logi/crs/crs_11g/log/svrhost1/agent/crsd/oraagent_oracle/oraagent_oracle.log".

CRS-2674: Start of 'ora.exem.db' on 'svrhost1' failed
[oracle@svrhost1 ~]$

Le document suivant explique quoi faire:

Database Startup Fails with ORA-27300: OS system dependent operation:semget failed with status: 28 [ID 949468.1]

En fait il s'agit de la configuration des sémaphores.

[root@svrhost1 etc]# ipcs -s | grep ^0 | cat -n
     1  0x224685fe 0          root      0          2
     2  0x00000000 360449     hpsmh     600        1
     3  0x00000000 65538      hpsmh     600        1
     4  0x00000000 98307      hpsmh     600        1
…......
   136  0x8c711c30 1497596039 oracle    640        156
   137  0x8c711c31 1497628808 oracle    640        156
   138  0x8c711c32 1497661577 oracle    640        156
   139  0x8c711c33 1497694346 oracle    640        156
   140  0x8c711c34 1497727115 oracle    640        156

[root@svrhost1 etc]# sysctl -a  |grep sem
kernel.sem = 250        32000   100     142
#kernel.sem = SEMMSL SEMMNS SEMOPM  SEMMNI

La commande suivante montre que ces paramètres ont été modifiés par le package Oracle-Validated

[root@svrhost1 etc]# grep sem sysctl.conf
# Oracle-Validated setting for kernel.sem is '250 32000 100 142'
kernel.sem = 250 32000 100 142

[root@svrhost1 etc]# rpm -qa | grep oracle-va
oracle-validated-1.0.0-22.el5

La valeur du paramètre peut être modifiée avec la commande:

[root@svrhost1 etc]# echo "250 64000 100 250" > /proc/sys/kernel/sem
[root@svrhost1 etc]# sysctl -a | grep sem
kernel.sem = 250        64000   100     250 

Hope it helps


jeudi 31 janvier 2013

The filename, directory name, or volume label syntax is incorrect.

En désinstallant le client oracle 11.2.0.2 sur une machine windows xp, j'ai rencontré le problème suivant:

C:\lgc\OraCli11gR2\client1\deinstall>deinstall.bat
Checking for required files and bootstrapping ...
Please wait ...
        1 file(s) copied.
        1 file(s) copied.
The filename, directory name, or volume label syntax is incorrect.
The directory name is invalid.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.
C:\lgc\OraCli11gR2\client1\deinstall>

Pour connaitre la cause de ce message d'erreur, dans le script ORACLE_HOME\deinstall\deinstall.bat , mettre la ligne "echo off" en commentaire pour avoir plus d'information lors de l'exécution:

La ligne
@echo off
Devient
Rem @echo off

Ensuite lancer la désinstallation de nouveau:

 set startupCmd=C:\DOCUME~1\adb-016\LOCALS~1\Temp\1\startup.bat 1 ERROR: Cannot
find bin\oramts_deinst.exe in the ORACLE_HOME C:\lgc\OraCli11gR2\client1.  You m
ust download the standalone version of the deinstall tool from OTN to deconfigure/deinstall this Oracle Home. C:\lgc\OraCli11gR2\client1
)  else (set startupCmd=C:\lgc\OraCli11gR2\client1\deinstall\\utl\startup.bat 1
ERROR: Cannot find bin\oramts_deinst.exe in the ORACLE_HOME C:\lgc\OraCli11gR2\c
lient1.  You must download the standalone version of the deinstall tool from OTN
 to deconfigure/deinstall this Oracle Home. C:\lgc\OraCli11gR2\client1\deinstall
\ C:\lgc\OraCli11gR2\client1  )
        1 file(s) copied.
        1 file(s) copied.

C:\lgc\OraCli11gR2\client1\deinstall>C:\DOCUME~1\adb-016\LOCALS~1\Temp\1\startup
.bat 1 ERROR: Cannot find bin\oramts_deinst.exe in the ORACLE_HOME C:\lgc\OraCli
11gR2\client1.  You must download the standalone version of the deinstall tool from OTN to deconfigure/deinstall this Oracle Home. C:\lgc\OraCli11gR2\client1
The filename, directory name, or volume label syntax is incorrect.
The directory name is invalid.
The filename, directory name, or volume label syntax is incorrect.
The filename, directory name, or volume label syntax is incorrect.

La section en gras montre qu'il manque un fichier de le répertoire $ORACLE_HOME\bin.
Je ne saurais expliquer la raison pour laquelle le fichier manque, mais on recommande de télécharger la version standalone de l'outil "deinstall" pour désinstaller le client.

Dans mon cas, j'avais une installation similaire sur une autre machine. J'ai donc copié le fichier manquant à partir de l'autre machine. Après ça la désinstallation a fonctionné sans que j'aie eu besoin de télécharger la version standalone de l'outil "deinstall".

Hope it helps.

mercredi 16 janvier 2013

CHECK TIMED OUT dans le résultat de la commande "crsctl stat res -t"

Dans un environnement RAC à 2 noeuds avec le Grid infrastructure 11.2.0.3 et des bases de données 10.2.0.3 je constate que l'une des instances ne réponds et je décide d'investiguer.

Je commence par la commande "crsctl stat res -t" et je constate le statut "CHECK TIMED OUT" pour certaines ressources:

[oracle@reds ~]$ GRID_HOME/bin/crsctl stat res -t
...
ora.dste.ADMIN_DSTE.cs
      1        ONLINE  INTERMEDIATE reds                     CHECK TIMED OUT
ora.dste.ADMIN_DSTE.dste1.srv
      1        ONLINE  ONLINE       reds
ora.dste.DSTE_SRV.cs
      1        ONLINE  INTERMEDIATE reds                     CHECK TIMED OUT
ora.dste.DSTE_SRV.dste1.srv
      1        ONLINE  ONLINE       texans
ora.dste.DSTE_SRV.dste2.srv
      1        ONLINE  ONLINE       reds
ora.dste.NONRAC_T.cs
      1        ONLINE  INTERMEDIATE reds                     CHECK TIMED OUT

...

Après quelques recherches, je constate qu'il y a plusieurs processus "racgmain check" sur le serveur:

[oracle@reds ~]$ ps -ef|grep "racgmain check"|grep -v grep
oracle     315     1  0  2012 ?        00:00:00 /ora01/logi/oracle/product/bd10203t/bin/racgmain check
oracle     319     1  0  2012 ?        00:00:00 /ora01/logi/oracle/product/bd10203t/bin/racgmain check
oracle     363     1  0 Jan06 ?        00:00:00 /ora01/logi/oracle/product/bd10203t/bin/racgmain check
oracle     417     1  0  2012 ?        00:00:00 /ora01/logi/oracle/product/bd10203t/bin/racgmain check
oracle     530     1  0  2012 ?        00:00:00 /ora01/logi/oracle/product/bd10203t/bin/racgmain check
oracle     552     1  0 Jan02 ?        00:00:00 /ora01/logi/oracle/product/bd10203t/bin/racgmain check
oracle     561     1  0  2012 ?        00:00:00 /ora01/logi/oracle/product/bd10203t/bin/racgmain check
oracle     598     1  0 Jan02 ?        00:00:00 /ora01/logi/oracle/product/bd10203t/bin/racgmain check

...
[oracle@reds ~]$ ps -ef|grep "racgmain check"|grep -v grep|wc -l
1159

En tout il y a donc 1159 processus de ce genre.

Pour corriger le problème je n'ai pas eu d'autre choix que de redémarrer l'instance.

[oracle@reds ~]$ $ORACLE_HOME/bin/srvctl stop instance -d dste -i dste1

Puis il faut tuer tous les processus en question:

[oracle@reds ~]$ for x in `ps -ef|grep "racgmain check"|grep -v grep|awk '{print $2}'`; do  kill -9 $x; done

Pour ne plus que le problème se reproduise, il faut suivre le workaround du document
10g/11gR1: Many Orphaned Or Hanging "racgmain" Processes Running [ID 732086.1]

Le workaround consiste à modifier le fichier $ORACLE_HOME/bin/racgwrap comme suit:

Supprimer les lignes suivantes (à la fin du fichier):

$ORACLE_HOME/bin/racgmain "$@"
status=$?
exit $status


Les remplacer par:

# Line added to fix for Bug 6196746
exec $ORACLE_HOME/bin/racgmain "$@"


Hope it helps...

vendredi 14 décembre 2012

ORA-13226 interface not supported without a spatial index

La requête suivante m'a donné le message d'erreur ci-après:

SELECT DOC1.SER_NO_SEQ, DOC1.DOC_NO_SEQ FROM CIG_DOCUMENT DOC1, CIG_ZONE_RECHE ZRE1
WHERE SDO_RELATE ( DOC1.SHAPE_M, ZRE1.SHAPE, 'MASK=ANYINTERACT QUERYTYPE=WINDOW' ) = 'TRUE'
AND ZRE1.SES_CODE_SESSI='Z+i8zRHOva7Q7AhlJw0j61cS6Jg='
AND DOC1.SER_NO_SEQ IN (1099,1918,1905,2194);


ORA-13226: interface non prise en charge sans index spatial
ORA-06512: à "MDSYS.MD", ligne 1723
ORA-06512: à "MDSYS.MDERR", ligne 8
ORA-06512: à "MDSYS.SDO_3GL", ligne 88


Le message d'erreur fait allusion à un problème d'index spatial. Vérifions donc le statut des indexes spatial:

select OWNER, INDEX_NAME, STATUS, DOMIDX_STATUS, DOMIDX_OPSTATUS, FUNCIDX_STATUS, ITYP_NAME
from   dba_indexes
where  INDEX_TYPE = 'DOMAIN'
and ITYP_NAME = 'SPATIAL_INDEX'
and (DOMIDX_STATUS<>'VALID' or DOMIDX_OPSTATUS<>'VALID' or FUNCIDX_STATUS<>'VALID');

OWNER   INDEX_NAME   STATUS   DOMIDX_STATU DOMIDX FUNCIDX_ ITYP_NAME
------- ------------ -------- ------------ ------ -------- ---------------
CIG     DOC_AS_IS    VALID    VALID        FAILED          SPATIAL_INDEX
CIG     DOC_P_IS     VALID    VALID        FAILED          SPATIAL_INDEX


En essayant de recréer les indexes en question, j'obtiens:

SQL> DROP INDEX CIG.DOC_AS_IS FORCE;
Index supprimé.
SQL> CREATE INDEX DOC_AS_IS ON CIG_DOCUMENT
  2  (SHAPE_M)
  3  INDEXTYPE IS MDSYS.SPATIAL_INDEX
  4  PARAMETERS('sdo_indx_dims=2 sdo_dml_batch_size=1')
  5  NOPARALLEL;
CREATE INDEX DOC_AS_IS ON CIG_DOCUMENT
*
ERREUR Ó la ligne 1 :
ORA-29855: erreur d'exÚcution de la routine ODCIINDEXCREATE
ORA-13249: internal error in Spatial index: [mdidxrbd]
ORA-13249: Error in Spatial index: index build failed
ORA-13249: Error in spatial index: [mdrcrtxfergm]
ORA-13249: Error in spatial index: [mdpridxtxfergm]
ORA-13200: erreur interne [ROWID:AAAipHAAXAAAAk7AAG] dans l'indexation spatiale.
ORA-13206: erreur interne [] lors de la crÚation de l'index spatial
ORA-13033: DonnÚes non valides dans le champ SDO_ELEM_INFO_ARRAY de l'objet SDO_GEOMETRY
ORA-06512: Ó "MDSYS.SDO_INDEX_METHOD_10I", ligne 10
SQL> DROP INDEX CIG.DOC_P_IS FORCE;
Index supprimé.
SQL> CREATE INDEX DOC_P_IS ON CIG_DOCUMENT
  2  (SHAPE_P)
  3  INDEXTYPE IS MDSYS.SPATIAL_INDEX
  4  PARAMETERS('layer_gtype=MULTIPOINT sdo_indx_dims=2 sdo_dml_batch_size=1')
  5  NOPARALLEL;
CREATE INDEX DOC_P_IS ON CIG_DOCUMENT
*
ERREUR Ó la ligne 1 :
ORA-29855: erreur d'exÚcution de la routine ODCIINDEXCREATE
ORA-13249: internal error in Spatial index: [mdidxrbd]
ORA-13249: Error in Spatial index: index build failed
ORA-13249: Error in spatial index: [mdrcrtxfergm]AAAipHAAXAAAAk7AAG
ORA-13249: Error in spatial index: [mdpridxtxfergm]
ORA-13200: erreur interne [ROWID:AAAipHAAXAAAAk7AAG] dans l'indexation spatiale.
ORA-13206: erreur interne [] lors de la crÚation de l'index spatial
ORA-13033: DonnÚes non valides dans le champ SDO_ELEM_INFO_ARRAY de l'objet SDO_GEOMETRY
ORA-06512: Ó "MDSYS.SDO_INDEX_METHOD_10I", ligne 10
SQL>


Conclusion:
Il y a un problème au niveau de l'enregistrement dont le ROWID=AAAipHAAXAAAAk7AAG.

Après avoir corrigé cet enregistrement, j'ai recréé les indexes et la requête a fonctionné.

Référence:
Spatial Healthcheck Shows Index Status Failed [ID 1430629.1] 

Si cette erreur est dûe à l'utilisation de lien base de données (database link), il faut savoir que cela n'est pas supporté.
Voir le document Spatial Query Over a Database Link Fails With ORA-13226 or ORA-22804 [ID 374321.1] 

Hope it helps.