L'utilitaire "rlwrap" permet de rappeler les anciennes commandes dans SQLPLUS ou RMAN.
Pour installer rlwrap :
Télécharger rlwrap ici :
http://utopia.knoware.nl/~hlub/uck/rlwrap/
Une fois téléchargé, copier le fichier "rlwrap-0.37.tar.gz" (c'est la version que j'ai utilisée) dans un répertoire sur le serveur, exemple /tmp
Se connecter sur le serveur linux en tant que root.
Décompresser le fichier:
cd /tmp
gunzip rlwrap-0.37.tar.gz
tar -xvf rlwrap-0.37.tar
Se positionner dans le répertoire obtenu:
cd rlwrap-0.37
Installer comme suit :
./configure
Si vous rencontrez l’erreur :
configure: error:
You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build
this program!
Installer gcc et readline-devel comme suit, en utilisant "yum":
yum install gcc
yum install readline-devel
Reprendre l’installation de rlwrap:
./configure
make
make check
make install
Pour utiliser rlwrap avec sqlplus ou rman,
1- Lancer la commande en utilisant rlwrap en avant:
rlwrap sqlplus system/mdp@alias
2- Ou créer un alias sqlplus et rman avec rlwrap en avant, comme suit:
alias sqlplus=’rlwrap $ORACLE_HOME/bin/sqlplus’
alias rman=’rlwrap $ORACLE_HOME/bin/rman’
Avec les alias on n'a plus besoin de préciser rlwrap en avant, on lance juste la commande:
sqlplus system/mdp@alias
Une fois connecté à SQLPLUS ou RMAN en utilisant rlwrap, on peut rappeler les anciennes commandes utilisées à l'aide des flèches du clavier.
Hope it helps...
Par Herve Etche, MBA
- Oracle Database 11g Administrator Certified Master (OCM)
- Oracle Certified Expert, RAC 11g and Grid Infrastructure Administrator
- Oracle Database 11g Performance Tuning Certified Expert
- Oracle Exadata 11g Certified Implementation Specialist
- Oracle Database 11g, 10g & 9i Certified Professional
- Oracle Application Server 10g Certified Professional
samedi 12 avril 2014
mardi 8 avril 2014
Oracle Database 12c Interactive Quick Reference
Voici un petit guide concernant la version 12c d'oracle database que j'ai trouve interessant.
Il contient plusieurs onglets dont l'architecture de la base de donnees 12c, l'architecture multitenant, les vues de performance, etc...
Ce qui est interessant c'est qu'on peut cliquer sur les images pour les agrandir, on peut voir les commentaires a droite de l'ecran, etc...
On peut y acceder a partir de otn.oracle.com en allant au niveau de la page de documentation d'oracle database 12c. Mais voici le lien direct:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/12c/r1/poster/OUTPUT_poster/poster.html#tab_1
Hope it helps...
Il contient plusieurs onglets dont l'architecture de la base de donnees 12c, l'architecture multitenant, les vues de performance, etc...
Ce qui est interessant c'est qu'on peut cliquer sur les images pour les agrandir, on peut voir les commentaires a droite de l'ecran, etc...
On peut y acceder a partir de otn.oracle.com en allant au niveau de la page de documentation d'oracle database 12c. Mais voici le lien direct:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/12c/r1/poster/OUTPUT_poster/poster.html#tab_1
Hope it helps...
lundi 4 novembre 2013
Comment vérifier si RAC est activée dans un ORACLE_HOME?
Dans un environnement unix (autre que AIX) et linux, pour vérifier si RAC est activé pour un home oracle utiliser la commande "ar" comme suit:
ar -t $ORACLE_HOME/rdbms/lib/libknlopt.a|grep kcsm.o
Si RAC est activé la commande retourne "kcsm.o" sinon elle ne retourne rien.
Note:
L'archive "libknlopt.a" contient les fichiers indiquant les différentes composantes installées.
Exemple:
1- Dans un environnement où RAC est activé (qu'il s'agisse du home du grid infrastructure ou d'un home base de données):
[oracle@svrhost1 ~]$ ar -t $ORACLE_HOME/rdbms/lib/libknlopt.a|grep kcsm.o
kcsm.o
[oracle@svrhost1 ~]$
2- Dans un environnement où RAC n'est pas activé (qu'il s'agisse du home du grid infrastructure ou d'un home base de données):
[oracle@testhost ~]$ ar -t $ORACLE_HOME/rdbms/lib/libknlopt.a|grep kcsm.o
[oracle@testhost ~]$
Lorsque RAC n'est pas activé, le fichier contenu dans l'archive est "ksnkcs.o":
[oracle@testhost ~]$ ar -t $ORACLE_HOME/rdbms/lib/libknlopt.a|grep ksnkcs.o
ksnkcs.o
[oracle@testhost ~]$
Hope it helps...
ar -t $ORACLE_HOME/rdbms/lib/libknlopt.a|grep kcsm.o
Si RAC est activé la commande retourne "kcsm.o" sinon elle ne retourne rien.
Note:
L'archive "libknlopt.a" contient les fichiers indiquant les différentes composantes installées.
Automatic
Storage Mgt ON=kfon.o
Automatic Storage Mgt OFF=kfoff.o
Context Management Text ON=kciwcx.o <<CTX est toujours activé et ne peut être désactivé.
Oracle Data Mining ON=dmwdm.o
Oracle Data Mining OFF=dmndm.o
Oracle Database Vault ON=kzvidv.o
Oracle Database Vault OFF=kzvndv.o
Oracle OLAP ON=xsyeolap.o
Oracle OLAP OFF=xsnoolap.o
Oracle Label Security ON= kzlilbac.o
Oracle Label Security OFF= kzlnlbac.o
Oracle Partitioning ON=kkpoban.o
Oracle Partitioning OFF=ksnkkpo.o
Real Application Cluster ON=kcsm.o
Real Application Cluster OFF=ksnkcs.o
Oracle Real Application Testing ON=kecwr.o
Oracle Real Application Testing OFF=kecnr.o
Automatic Storage Mgt OFF=kfoff.o
Context Management Text ON=kciwcx.o <<CTX est toujours activé et ne peut être désactivé.
Oracle Data Mining ON=dmwdm.o
Oracle Data Mining OFF=dmndm.o
Oracle Database Vault ON=kzvidv.o
Oracle Database Vault OFF=kzvndv.o
Oracle OLAP ON=xsyeolap.o
Oracle OLAP OFF=xsnoolap.o
Oracle Label Security ON= kzlilbac.o
Oracle Label Security OFF= kzlnlbac.o
Oracle Partitioning ON=kkpoban.o
Oracle Partitioning OFF=ksnkkpo.o
Real Application Cluster ON=kcsm.o
Real Application Cluster OFF=ksnkcs.o
Oracle Real Application Testing ON=kecwr.o
Oracle Real Application Testing OFF=kecnr.o
1- Dans un environnement où RAC est activé (qu'il s'agisse du home du grid infrastructure ou d'un home base de données):
[oracle@svrhost1 ~]$ ar -t $ORACLE_HOME/rdbms/lib/libknlopt.a|grep kcsm.o
kcsm.o
[oracle@svrhost1 ~]$
2- Dans un environnement où RAC n'est pas activé (qu'il s'agisse du home du grid infrastructure ou d'un home base de données):
[oracle@testhost ~]$ ar -t $ORACLE_HOME/rdbms/lib/libknlopt.a|grep kcsm.o
[oracle@testhost ~]$
Lorsque RAC n'est pas activé, le fichier contenu dans l'archive est "ksnkcs.o":
[oracle@testhost ~]$ ar -t $ORACLE_HOME/rdbms/lib/libknlopt.a|grep ksnkcs.o
ksnkcs.o
[oracle@testhost ~]$
Hope it helps...
vendredi 4 octobre 2013
L'outil "sosreport" sur Oracle Linux
L'outil "sosreport" permet de collecter les informations sur le hardware et les configurations de Linux.
Pour l'utiliser:
[root@host ~]# sosreport
sosreport (version 1.7)
This utility will collect some detailed information about the
hardware and setup of your Enterprise Linux system.
The information is collected and an archive is packaged under
/tmp, which you can send to a support representative.
This information will be used for diagnostic purposes ONLY
and it will be considered confidential information.
This process may take a while to complete.
No changes will be made to your system.
Press ENTER to continue, or CTRL-C to quit.
One or more plugins have detected a problem in your configuration.
Please review the following messages:
process:
* one or more processes are in state D (sosreport might hang)
Are you sure you would like to continue (y/n) ? y
Please enter your first initial and last name [texans]: hetche
Please enter the case number that you are generating this report for: 1
plugin system finished ...
Completed.
Creating compressed archive...
Your sosreport has been generated and saved in:
/tmp/sosreport-hetche.1-797857-a51333.tar.bz2
The md5sum is: b9c7ff320009c7b19ad48b93eca51333
Please send this file to your support representative.
Par défaut le résultat est généré dans le répertoire /tmp.
Pour le générer à un autre emplacement, lancer l'utilitaire comme suit:
TMP=/home/hetche sosreport
Hope it helps...
Pour l'utiliser:
[root@host ~]# sosreport
sosreport (version 1.7)
This utility will collect some detailed information about the
hardware and setup of your Enterprise Linux system.
The information is collected and an archive is packaged under
/tmp, which you can send to a support representative.
This information will be used for diagnostic purposes ONLY
and it will be considered confidential information.
This process may take a while to complete.
No changes will be made to your system.
Press ENTER to continue, or CTRL-C to quit.
One or more plugins have detected a problem in your configuration.
Please review the following messages:
process:
* one or more processes are in state D (sosreport might hang)
Are you sure you would like to continue (y/n) ? y
Please enter your first initial and last name [texans]: hetche
Please enter the case number that you are generating this report for: 1
plugin system finished ...
Completed.
Creating compressed archive...
Your sosreport has been generated and saved in:
/tmp/sosreport-hetche.1-797857-a51333.tar.bz2
The md5sum is: b9c7ff320009c7b19ad48b93eca51333
Please send this file to your support representative.
Par défaut le résultat est généré dans le répertoire /tmp.
Pour le générer à un autre emplacement, lancer l'utilitaire comme suit:
TMP=/home/hetche sosreport
Hope it helps...
lundi 30 septembre 2013
Lecture des fichiers binaires avec la command "strings"
La commande strings peut être utilisé pour visualiser le contenu d'un fichier binaire.
Par exemple, pour voir le contenu d'un fichier olr dans un environnement grid infrastructure 11g (en cluster ou en standalone):
sudo su -
cd $GRID_HOME/cdata
strings host1.olr
Exemple de contenu obtenu:
[root@host1 cdata]# strings host1.olr |grep SPFile
tp://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd" ProfileSequence="36" ClusterUId="63077d79ae5dcf99fff118cfb1a5c515" ClusterName="crstest11g" PALocation=""><gpnp:Network-Profile><gpnp:HostNetwork id="gen" HostName="*"><gpnp:Network id="net1" IP="142.41.242.0" Adapter="bond0" Use="public"/><gpnp:Network id="net2" IP="192.168.30.0" Adapter="bond1" Use="cluster_interconnect"/></gpnp:HostNetwork></gpnp:Network-Profile><orcl:CSS-Profile id="css" DiscoveryString="+asm" LeaseDuration="400"/><orcl:ASM-Profile id="asm" DiscoveryString="/dev/oracleasm/disks/*" SPFile="+OCR_VOTE/crstest11g/asmparameterfile/registry.253.801067269"/><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="gpnp orcl xsi"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>3mfJqBrkkNz2lvK1CJXvq2/UtJw=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>scGjbnPKShIDg/NAVJXkn399lt7ifLjbdH6DAHVZnJGSOmZwlcrfSL/mqOHyzHNgtRyhW6yGs+rXukexq0dPI+PtiLTkN6yX1JrC6rdsxemwtoPJAyA9X5lJhdcy4nfNQ/Mv0+nfGlnMXcvBIhGjPiLeFtKmuGUHOvbz+U47hfk=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>
[root@host1 cdata]#
Hope it helps....
Par exemple, pour voir le contenu d'un fichier olr dans un environnement grid infrastructure 11g (en cluster ou en standalone):
sudo su -
cd $GRID_HOME/cdata
strings host1.olr
Exemple de contenu obtenu:
[root@host1 cdata]# strings host1.olr |grep SPFile
tp://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.grid-pnp.org/2005/11/gpnp-profile gpnp-profile.xsd" ProfileSequence="36" ClusterUId="63077d79ae5dcf99fff118cfb1a5c515" ClusterName="crstest11g" PALocation=""><gpnp:Network-Profile><gpnp:HostNetwork id="gen" HostName="*"><gpnp:Network id="net1" IP="142.41.242.0" Adapter="bond0" Use="public"/><gpnp:Network id="net2" IP="192.168.30.0" Adapter="bond1" Use="cluster_interconnect"/></gpnp:HostNetwork></gpnp:Network-Profile><orcl:CSS-Profile id="css" DiscoveryString="+asm" LeaseDuration="400"/><orcl:ASM-Profile id="asm" DiscoveryString="/dev/oracleasm/disks/*" SPFile="+OCR_VOTE/crstest11g/asmparameterfile/registry.253.801067269"/><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/><ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"> <InclusiveNamespaces xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="gpnp orcl xsi"/></ds:Transform></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue>3mfJqBrkkNz2lvK1CJXvq2/UtJw=</ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue>scGjbnPKShIDg/NAVJXkn399lt7ifLjbdH6DAHVZnJGSOmZwlcrfSL/mqOHyzHNgtRyhW6yGs+rXukexq0dPI+PtiLTkN6yX1JrC6rdsxemwtoPJAyA9X5lJhdcy4nfNQ/Mv0+nfGlnMXcvBIhGjPiLeFtKmuGUHOvbz+U47hfk=</ds:SignatureValue></ds:Signature></gpnp:GPnP-Profile>
[root@host1 cdata]#
Hope it helps....