Saturday, May 17, 2008

Split Column

Old method.

SQL> select name from test;
NAME

------------------------------
MOHAMMAD TAJ
BABU B
NIVEDITA SHARMA
RASHIDA BASTAWALA
RADO DENISA

SQL> column firstname format a15
SQL> column lastname format a15

SQL> select
2 substr(name,1,instr(name,' ' )-1) as firstname,
3 substr(name, instr(name,' ',-1)+1) as lastname
4 from test;

FIRSTNAME LASTNAME
--------------- ---------------
MOHAMMAD TAJ
BABU B
NIVEDITA SHARMA
RASHIDA BASTAWALA
RADO DENISA

New Method with 10g or 11g.

Regular Expressions
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28424/adfns_regexp.htm#ADFNS1013

About ORATAB, ORACLE_HOME, ORACLE_BASE, ORACLE_SID

1. ORATAB

Oratab is a colon-delimited text file on Unix and Linux systems that associates ORACLE_SID and ORACLE_HOME values.

The last field contains a "Y" or "N" for database startup when the machine boots up. One can also use hashes (#) to start comment lines.

This file is either found in the /var/opt/oracle or the /etc directories.


http://www.orafaq.com/wiki/Oratab


2. ORACLE_HOME

ORACLE_HOME refers to either:

directory where the Oracle software is installed; or
environment variable pointing to the directory where the Oracle software is installed.

http://www.orafaq.com/wiki/ORACLE_HOME


3. ORACLE_BASE

ORACLE_BASE is an environment variable used as base directory for an OFA installation. On Unix systems, this is usually /app/oracle or /u01/app/oracle.


http://www.orafaq.com/wiki/ORACLE_BASE


4. ORACLE_SID

The Oracle System ID (SID) is used to uniquely identify a particular database on a system. For this reason, one cannot have more than one database with the same SID on a computer system.

When using RAC, all instances belonging to the same database must have unique SID's.

http://www.orafaq.com/wiki/ORACLE_SID

Subscribe via email

Enter your email address:

Delivered by FeedBurner