Sep 21 2007

Log SQL results

Catégorie : Shell, SQL, Tips and tricksCharles Collier @ 12:40 pm

If you’d like to log the result from a sql script, just prepare your sql script like that:spool result.log
SET SERVEROUTPUT ON
select * from dual;
spool off
exit

Then from a command line or a script shell execute the following command:
# sqlplus user/pwd@db_name @script.sql


Jun 15 2007

Information Request

Catégorie : Supervision, Nagios, Tips and tricks, News, Oracle, LinuxCharles Collier @ 12:06 am

You’d like to have a post or a tutorial about linux (redhat, fedora) Oracle (database, 10g, RAC or OAS - oracle application suite), Nagios, Cacti,…

Feel free to ask and i’ll try to answer to your question.
Leave a comment with your question.


Jun 08 2007

Oracle’s Certification Matrices

Catégorie : Database, Tips and tricks, Oracle Database, OracleCharles Collier @ 1:07 pm

Because i didn’t find it quickly, i’d just want to publish this very useful link to publish this access to the Certify - Oracle’s Certification Matrices:
http://www.oracle.com/technology/support/metalink/index.html

    —°°°— 

Une petite info pratique que je souhaite publié parce que je ne l’ai pas trouvé rapidemment. Voici le lien pour acceder aux matrices de compatibilté Oracle:
http://www.oracle.com/technology/support/metalink/index.html


Jun 08 2007

List installed oracle components

Catégorie : Database, Tips and tricks, Oracle Database, OracleCharles Collier @ 12:37 pm

If you want to know which components were installed on your server:

$ORACLE_HOME/OPatch/opatch lsinventory -detail


Mar 08 2007

The Deployment scanner - jboss

Catégorie : Web & J2EE server, Jboss, Tips and tricksCharles Collier @ 1:13 am

Start

The conf/jboss-service.xml file is full of options. One of these ones is about the deployment scanner. If you make any change in a jboss config file then you’ll have to restart the server.

Open the conf/jboss-service.xml in vi or some text editor capable of saving in plain text. Scroll near the bottom to the MBean definition for the DeploymentScanner:

Deployment Sorter

As you scroll down you should see some comments followed by this:

org.jboss.deployment.DeploymentSorter

This is the deployment sorter which enforces the default deployment order. Starting from 4.0.1, it gets the sort order from the MainDeployerss EnhancedSuffixOrder. If you prefer a UNIX System-V init style you can comment this sorter and uncomment the following line:

org.jboss.deployment.scanner.PrefixDeploymentSorter

This sorter will use a numeric prefix-based order. If you wish to use this sort, you should read further on the prefix deployment order.

Scan Period

As you scroll further you will find:

5000

The default value is 5000 milliseconds or 5 seconds. This determines how frequently the directories which the Deployment Scanner is watching (/deploy) will be polled. Of course it very usefull when you are under development. But when you a production server this option should be disable (because of waste CPU, or protect from unwanted productions changes)

URLs

As you scroll further you will find:

deploy/

It will defined where data (such as .ear or .war) for hot deployments will be used.
It could even be http://url or webdav url.
For example, if you wanted to protect the database passwords you might do this:

deploy/,datasources/

You could set the file system permissions on datasources/ such that JBoss could read them, but developers could not.

Recursive

Finally, you should see:

True

This will cause the deployment scanner to recurse into subdirectories. Read this for more informaton on the drawbacks.

Disable Hot Deployment

Add the following attribute:

false

Feb 22 2007

Lister un répertoire de manière sélective

Catégorie : Tips and tricks, LinuxCharles Collier @ 9:27 pm

Le plus souvent on utilisera grep
$ ls -l backup/2007 | grep Feb

mais parfois il peut s’aveer plus utile d’utliser awk
$ ls -l backup/2007 | awk ‘$6 == “Feb”‘


Feb 22 2007

create a directory tree

Catégorie : Tips and tricks, sysadmin, LinuxCharles Collier @ 9:14 pm

If you want to quick, don’t forget to use the ‘-p’ option

wrong way:
[john@host john]$ mkdir dev
[john@host john]$ cd dev
[john@host dev]$ mkdir first
[john@host dev]$ cd first
[john@host first]$ mkdir alpha
[john@host dev]$ mkdir second
[john@host dev]$ ll
[john@host dev]$ cd ..
[john@host john]$ mkdir prod
[john@host john]$ cd prod
[john@host prod]$ mkdir first
[john@host prod]$ mkdir second

good way:
[john@host john]$ mkdir -p dev/first/alpha

best way:
[john@host john]$ mkdir -p dev/{first/alpha,second},prod/{first,second}


Feb 21 2007

How to extract files from a tar.gz

Catégorie : Tips and tricks, LinuxCharles Collier @ 1:47 pm

usually people do:
$ cd backup/2007/02
$ tar -zxvf data.tar.gz

you can simply do:
tar -zxvf -C backup/2007/02 data.tar.gz

or even do it better:
cd backup/2007/02 && tar -zxvf data.tar.gz

the best way:
cd backup/2007/02 || mkdir -p backup/2007/02 && tar -zxvf data.tar.gz


Page suivante »