This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions..

 

Sunday, May 4, 2008

ORA-27101: shared memory realm does not exist

ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist

Cause: SGA is not allocated and instance is not started due to use the wrong oracle_sid and or oracle_home.

Action: use the following command on your sqlplus

set ORACLE_SID = grms

sqlplus /nolog

sql>conn system/manager as sysdba

sql>shutdown abort

sql>startup



Oralce Error List

ORA-06512
ORA-09936
ORA-00600
ORA-00904
ORA-00942
ORA-01034
ORA-600
ORA-06550
ORA-12560
ORA-01422
ORA-27101
ORA-20000
ORA-01555
ORA-01722
ORA-12500
ORA-01000
ORA-12514
ORA-01110
ORA-01017
ORA-00001
ORA-01843
ORA-01033
ORA-00054
ORA-07445
ORA-12638
ORA-06508
ORA-01652
ORA-00020
ORA-01113
ORA-12203
ORA-00922
ORA-01658
ORA-00923
ORA-03114
ORA-24324
ORA-01002
ORA-01502
ORA-29283
ORA-01461
ORA-12571
ORA-01151
ORA-01008
ORA-00932
ORA-01401
ORA-12705
ORA-3113
ORA-27102
ORA-01861
ORA-01036
ORA-12547
ORA-12505
ORA-01653
ORA-01041
ORA-01001
ORA-01012
ORA-01013
ORA-00900
ORA-02291
ORA-28000
ORA-04091
TNS-00510
ORA-01858
ORA-01427
ORA-02068
ORA-03106
ORA-24338
ORA-01410
exp-00091
ORA-00972
ORA-00979
ORA-01438
ORA-04098
ORA-3136
TNS-12502
ORA-12170
ORA-00905
ORA-12899
ORA-1403
ORA-12519
ORA-02292
ORA-12518
ORA-00984
ORA-00937
ORA-02049
ORA-00980
ORA-01841
ORA-1031
ORA-08103
ORA-01950
ORA-12162
ORA-30036
ORA-27100
ORA-00913
ORA-03135
TNS-12505
ORA-12540
ORA-02019
EXP-00056
ORA-00936

ORA-01034: ORACLE not available

ORA-01034: ORACLE not available

Cause: oracle database/ instance not started

Action: start oracle oracle database/instance




To start oracle simply just logon using sqlplus on local server

sqlplus "/ as sysdba"

then start the database using the following command

sqplus> startup

ORA-00942 : table or view does not exist

ORA-00942: table or view does not exist

Cause: The table or view entered does not exist or you don't have the privilege to that referencestable or view. Or those specified table or view belong to difference schema.

Action: check if you specified the correct table name or check if you have the privilege to the specific object or specified schema and dot in front of those table or view i.e. [schema name].table/view name.




related website
http://www.adp-gmbh.ch/ora/err/ora_00942.html
http://ora-00942.ora-code.com/


.

ORA-00904: invalid identifier

ORA-00904: "string": invalid identifier/invalid column name

Cause: The column name entered is either missing or invalid.

Action: Enter a valid column name.



A valid column name must begin with a letter, be less than or equal to 30 characters, and consist of only alphanumeric characters and the special characters $, _, and #. If it contains other characters, then it must be enclosed in double quotation marks.

A valid column name may not be an oracle reserver word. The following sql command show list all oracle reserved words

select keyword from V_$RESERVED_WORDS'
or to query the reserved word related to your term just use the following one:
select keyword from V_$RESERVED_WORDS where keyword like '%[your column term]%'

ORA-09933 Deletion of old password file failed

ORA-09933: Deletion of old password file failed.

Cause: The removal of the old password file failed or ORACLE was unable to create a password file.

Action: Check the UNIX error number for the specific reason.

Saturday, May 3, 2008

EXP-00056: ORACLE error 19206 encountered during an expor

EXP-00056: ORACLE error 19206 encountered during an export
Cause: missing or invalid of metadata tables or XMLDB schema was dropped or modified
Action: run the "$ORACLE_HOME/rdbms/admin/catmeta.sql" script when connected as sysdba




you might following error during doing an export of an entire schema in Oracle 9i/10g:


EXP-00056: ORACLE error 19206 encountered
ORA-19206: Invalid value for query or REF CURSOR parameter
ORA-06512: at "SYS.DBMS_XMLGEN", line 83
ORA-06512: at "SYS.DBMS_METADATA", line 353
ORA-06512: at "SYS.DBMS_METADATA", line 418
ORA-06512: at "SYS.DBMS_METADATA", line 457
ORA-06512: at "SYS.DBMS_METADATA", line 1181
ORA-06512: at "SYS.DBMS_METADATA", line 1162
ORA-06512: at line 1
EXP-00056: ORACLE error 19206 encountered
ORA-19206: Invalid value for query or REF CURSOR parameter
ORA-06512: at "SYS.DBMS_XMLGEN", line 83
ORA-06512: at "SYS.DBMS_METADATA", line 353
ORA-06512: at "SYS.DBMS_METADATA", line 418
ORA-06512: at "SYS.DBMS_METADATA", line 457
ORA-06512: at "SYS.DBMS_METADATA", line 1181
ORA-06512: at "SYS.DBMS_METADATA", line 1162
ORA-06512: at line 1
EXP-00000: Export terminated unsuccessfully
(END)

if you do a a single table export could do the trick, but exporting an entire user ("schema") failed with the above error.

This cause of this EXP-00056: ORACLE error 19206 might either be the missing or invalid of metadata tables which need for performing an export or you have dropped or modified the XMLDB schema.

The solution is simply run the following script when connected as sysdba:

$ORACLE_HOME/rdbms/admin/catmeta.sql

i.e. login to your oracle database
at the command line prompt enter

sqlplus "/ as sysdba"

at the sqlplus prompt enter

sqlplus>@$ORACLE_HOME/rdbms/admin/catmeta.sql

Friday, May 2, 2008

Grid Computing on Windows

At Solutia, the IT goal is to get information to the people who need it, any time they need it. Solutia's high?volume manufacturing facilities are humming 24 hours a day, so critical database information must be accessible every minute. Downtime translates into lost production time, which ultimately results in lost revenues for the company.

At the core of Solutia's IT strategy is the simple idea that the required information must be easily available at a low cost. In addition, as the company grows, the capacity to manage and access the information must grow along with it. With 6,000 employees scattered across five continents, Solutia needs a scalable, reliable, high?performance database solution that can work with nearly any application in any location.

In addition to addressing its technical requirements, Oracle RAC enables Solutia to meet it business goals of cost and quality leadership, market innovation, and improving profits.

Get this white paper at: http://searchoracle.bitpipe.com/data/document.do?res_id=1207851849_349

Oracle Database Backup with RMAN


Backup related technical terms



    Main category of doing database backup
  • Whole database backups: a backup of every datafile in the database, plus the control file. Whole database backups are the most common type of backup.
  • Partial database backups: backup of either tablespaces ,datafiles, control files or Archived Redo Log but not the whole database.



    Backup Type
  • Full backup : every time the backup has been doing it will create a whole database.
  • Incremental backup : backup only the updated data, there must be an old backup file for comparison purpose.
    Backup Mode
  • Offline backup/consistent backup: doing backup while the database is offline. The files in the backup contain all the data taken from a same point in time. This type of backup does not require recovery after it is restored.
  • Online backup/inconsistent backup/hot backup : doing backup while the database is online.
    Backup Format
  • Image Copies: this type of backup is copying physical file, this kind of format the original file size would be the same as the copy file size. Which would take space.
  • Backup set: this format is the backup default and only used for Oracle database. The difference between Image Copied and Set Backup is Set Backup would do the backup only the block with data and we could configure the set level and the media type to keep the data on i.e. disk or tape

Recovery Manager (RMAN)

RMAN is an Oracle utility which come with Oracle Database from installation process. The main functionality of this utility is backup, restoring and recovering database.
You can also use operating system commands for backups and SQL*Plus for recovery. This method, also called user-managed backup and recovery, is fully supported by Oracle, although use of RMAN is highly recommended because it is more robust and greatly simplifies administration.

    RMAN related technical terms
  • Target Database: the database server we want to do the backup.
  • Channel Process: the channel which RMAN would access the target database.
  • RMAN Repository: Path that keep RMAN’s information, which will hold backup information of each instance. The default path is configured in control file of each instance. We could create a new database for the use of this purpose. With this new database we could keep the backup’ information of every instances we would do the backup
  • Flash Recovery Area: The flash recovery area is an Oracle-managed directory, file system, or Automatic Storage Management disk group that provides a centralized disk location for backup and recovery files. Oracle creates archived logs in the flash recovery area. RMAN can store its backups in the flash recovery area, and it uses it when restoring files during media recovery. The flash recovery area also acts as a disk cache for tape
  • Recovery catalog: The database the store recovery catalog schema, which contain metadata that RMAN use for backup and recovery


    RMAN Configuration Parameters
  • DB_RECOVERY_FILE_DEST_SIZE: set how much flash_recovery size could go.
  • DB_RECOVERY_FILE_DEST: set the path that keep backup set.


    RMAN Related View List
  • V$RECOVERY_FILE_DEST: This view shows the position of flash recovery.
  • V$FLASH_RECOVERY_AREA_USAGE : this view shows how much the space had been taken for each file.


    Physical File which RMAN could do the backup
  • Database file = { data file, control file, spfile }
  • Archived log file

Note: password file, network configure file (tnsname.ora, listener.ora, sqlnet.ora) we need to do manual backup.

Basic RMAN command

Start & Exit RMAN
# RMAN target /[@] [nocatalog | catalogname]
# RMAN
RMAN> EXIT


run script RMAN from file
# RMAN target / @file1
RMAN> @file1

command to validate RMAN syntax
# RMAN CHECKSYNTAX
# RMAN CHECKSYNTAX @file1


command to display parameters
RMAN> show ;
RMAN> SHOW ALL;
RMAN> CONFIGURE CLEAR;


Media management command

Specify the media
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO ;

Specify to compress the backup
RMAN> CONFIGURE DEVICE TYPE BACKUP TYPE TO ;
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ‘/backup/ora_df%t_s%s_s%p’;
some of media managers need to configure through parameter.
RMAN> CONFIGURE CHANNEL DEVICE TYPE SBT PARMS=’ENV=mml_env_settings’;


backup data file command
RMAN> BACKUP DATABASE;

backup tablespaces
RMAN> BACKUP TABLESPACE system, users, tools;
RMAN> BACKUP DEVICE TYPE sbt MAXSIZE=10M TABLESPACE user, tool;


Backup data file
RMAN> BACKUP DEVICE TYPE sbt DATAFILE 1,2,3,4 DATAFILECOPY ‘/tmp/system.dbf’;
RMAN> BACKUP DEVICE TYPE sbt TABLESPACE user INCLUDE CURRENT CONTROLFILE;
RMAN> BACKUP AS BACKUPSET DATAFILE
’ORACLE_HOME/oradata/trgt/users01.dbf’,
’ORACLE_HOME/oradata/trgt/tools01.dbf’;


to be able to set the incremental backup, which is level 1 we need to do level 0 first. In other word, we need to do the first backup with level 0. There is one caution to be made, that is when we do the incremental backup, the backup file level 0 และ 1 need to be together so we could completely do the restoration and recovery.
RMAN> BACKUP INCREMENTAL LEVEL [0 | 1] CUMULATIVE DATABASE;

backup control file
Set the configuration so that it could do the auto backup control file and parameter file when there were some changes and when there is some disasters RMAN would recover for that particular instance.
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ;

change the autobackup default name
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE to ‘?/oradata/cf_%F’;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE clear;


to override autobackup value for any particular session (use run block on RMAN prompt)
RMAN> SET CONFIGURE AUTOBACKUP FORMAT
Backup current control file
RMAN> BACKUP CURRENT CONTROLFILE;
RMAN> BACKUP CURRENT CONTROLFILE TO ’/backup/curr_cf.copy’;


Backup control file
RMAN> BACKUP AS COPY CURRENT CONTROLFILE FORMAT ‘/tmp/control01.ctl’;
RMAN> BACKUP DEVICE TYPE sbt CONTROLFILECOPY ‘/tmp/control01.ctl’;

backup parameter file
RMAN> BACKUP SPFILE;
RMAN> BACKUP DEVICE TYPE sbt SPFILE;


backup archived log file
RMAN> BACKUP ARCHIVELOG …;
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
RMAN> BACKUP DATABASE PLUS ARCHIVELOG DELETE INPUT;
RMAN> BACKUP ARCHIVELOG COMPLETION TIME BETWEEN ’SYSDATE-31’ AND ’SYSDATE-7’;


restore command
RMAN> RESTORE DATABASE;
RMAN> RESTORE TABLESPACE users;
RMAN> RESTORE DATAFILE <ชื่อ datafile>;
RMAN> RESTORE DATAFILE 7;


recovery command
RMAN> RECOVER DATABASE;
RMAN> RECOVER TABLESPACE users;
RMAN> RECOVER DATAFILE ;
RMAN> RECOVER DATAFILE 7;


backup sample
Backup Database including Archivelog file plus delete archive log file from backup
# RMAN TARGET backup_admin/backup_admin NOCATALOG
RMAN> BACKUP DATABASE PLUS ARCHIVELOG DELETE INPUT;


Backup Database including Control file plus delete un-updated backup.

RMAN> backup incremental level 0 cumulative device type disk tag '%TAG' database include current controlfile;
RMAN> allocate channel for maintenance type disk;
RMAN> delete noprompt obsolete device type disk;
RMAN> release channel;

restore & recovery sample
Recovering whole database
RMAN> STARTUP FORCE MOUNT;
RMAN> RESTORE DATABASE;
RMAN> RECOVER DATABASE;
RMAN> ALTER DATABASE OPEN;


Recovering tablespace
RMAN> SQL 'ALTER TABLESPACE users OFFLINE';
RMAN> RESTORE TABLESPACE users;
RMAN> RECOVER TABLESPACE users;
RMAN> SQL 'ALTER TABLESPACE users ONLINE';

Recovering Datafiles 7
RMAN> SQL 'ALTER DATABASE DATAFILE 7 OFFLINE';
RMAN> RESTORE DATAFILE 7;
RMAN> RECOVER DATAFILE 7;
RMAN> SQL 'ALTER DATABASE DATAFILE 7 ONLINE';


Backup Control File to Trace
To do trace backup control file for recovery when control file is corrupted
for OEM go to “Controlfiles” menu then “Backup To Trace”;
or you could use command line as below.

SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;

The result would be kept as configured parameter USER_DUMP_DEST
the default name is _ora_pid.trc
and default path is /admin//udump
the trace file would contain the sql command that could recreate the control file .

ORA-01422: exact fetch returns more than requested number of rows

ORA-01422: exact fetch returns more than requested number of rows

Cause: The number specified in exact fetch is less than the rows returned.

Action: Rewrite the query or change number of rows requested



With Oralce ORA-01422 error the cause would be you tried to execute a SELECT INTO statement and more than one row was returned. This error is on oracle PL/SQL lanugauge.

Here are the option that you could do.
1. rewrite your sql statement so it return only one record.
2. use an exception in case of unexpected scenario.
The exception syntax would look like this
Syntax:
BEGIN

your sql statement here
ie. select a, b, c into d, e, f from i;
EXCEPTION
WHEN exception1 [OR exception2...]] THEN
...
[WHEN exception3 [OR exception4...] THEN
...]
[WHEN OTHERS THEN
...]

your code need to be something like

BEGIN

your sql statement here
ie. select a, b, c into d, e, f from i;
EXCEPTION
WHEN TOO_MANY_ROWS THEN
do something ie. raise error
WHEN OTHERS THEN
do something
END;

3. use cursor for more information on cursor take a look at
http://www.oracle-base.com/articles/8i/UsingRefCursorsToReturnRecordsets.php.
http://www.psoug.org/reference/ref_cursors.html

ORA-00001: unique constraint (string.string) violated

ORA-00001: unique constraint (string.string) violated

Cause: An UPDATE or INSERT statement attempted to insert a duplicate key. For Trusted Oracle configured in DBMS MAC mode, you may see this message if a duplicate entry exists at a different level.

Action: Either remove the unique restriction or do not insert the key.



the sample message might be as below

insert into student(pk_id, fieldname) values(1, '')
*
ERROR at line 1:
ORA-00001: unique constraint (PROMIS.SYS_C0012876) violated


With the example above we knew that it must be at table student. But if the query is more complex it might be hard to locate the problem constraint. If you already know where the prob is go to step 2 otherwise go to step 1

Step 1.> Locate the problem
To locate where might be the problem you may need to use the following query to find which table is your problem.
select distinct table_name
from all_indexes
where index_name = 'CONSTRAINT_NAME';

replace the CONSTRAINT_NAME with your constraint code (as the example above it is the text with the underline, SYS_C0012876. So the query would be:

select distinct table_name
from all_indexes
where index_name = 'SYS_C0012876';

and you will get the table name which cause the problem.

Step 2.> solve the problem
The options to resolve this Oracle ORA-00001 error are:

1. Modify your SQL so that a duplicate value is not created.
2. Change the constraint to allow duplicate values.
3. Diable the unique constraint.
4. Drop the unique constraint.

from 1-4 I would say it is likely that the first one is quite the right solution for me, as the constraint itself had the reason to be there from the first place. I suggest stick to number 1 to be on the save side, unless you know what you are doing.

ORA-00936: missing expression

ORA-00936: missing expression

Cause: A required part of a clause or expression has been omitted. For example, a SELECT statement may have been entered without a list of columns or expressions or with an incomplete expression. This message is also issued in cases where a reserved word is misused, as in SELECT TABLE (see case 2 below).

Action: Check the statement syntax and specify the missing component.


1. if you are using prepare statement to connect to oracle with vb or asp you might as get this error as using named parameters. The reason is that OLEDB doesn't support named parameters. e.g.


here i have the example of how to do it

Dim objCmd

Set objCmd = Server.CreateObject("ADODB.Command")
Set objCmd.ActiveConnection = objConn

objCmd.CommandType = adCmdText


objCmd.CommandText = "{CALL procedurename(?,?,?,?,?,?)}"

objCmd.Parameters.Append objCmd.CreateParameter("@a", adVarChar, adParamInput,16)
objCmd.Parameters.Append objCmd.CreateParameter("@b", adVarChar, adParamInput,32)
objCmd.Parameters.Append objCmd.CreateParameter("@c", adDouble, adParamOutput)
objCmd.Parameters.Append objCmd.CreateParameter("@d", adVarChar, adParamOutput,255)
objCmd.Parameters.Append objCmd.CreateParameter("@e", adDouble, adParamOutput)
objCmd.Parameters.Append objCmd.CreateParameter("@f", adDouble, adParamOutput)

objCmd("@a") = sString
objCmd("@b") = sString2

objCmd.Execute

If ERR = 0 Then

o_errnum = objCmd("@c")
o_errStr = objCmd("@d")
o_usertype = objCmd("@e")
o_userid = objCmd("@f")

isValidLogin = True

End If
Set objCmd = Nothing

with this example you can use procedure to pass the paremeter to oracle and at the same time get the output parameters. The keyword is adParamOutput and adParamInput plus you need to specified parameter type make sure they are the same with your oracle procedure. Otherwise you will get an error.

2. If you are not running procedure. The other possibly cause of the error "ORA-00936: missing expression" might be that you tried to execute a SELECT statement and forget to the list of the columns in the SELECT statement.
i.e.

select
from tablename;


this also would raise you the same error

So the solution would be "Check the statement syntax and specify the missing component". If you are calling procedure using ? in your preparestatement not @ as I had already said "OLEDB doesn't support named parameters"

EXP-00056: ORACLE error 6550 encountered


EXP-00056: ORACLE error 6550 encountered
ORA-06550: line 1, column 41:
PLS-00302: component 'SET_NO_OUTLINES' must be declared
ORA-06550: line 1, column 15:
PL/SQL: Statement ignored
EXP-00000: Export terminated unsuccessfully


You would get this error when you are trying to export your database with exp binary that is not compatible with your database
The cause of this error is, as the above message had already mentioned, that you are tring to export your database from client with oracle version higher
than the server version ie. using oracle 10g to export from oracle database 9i.



The solution are
- first option: you need exp program with the same version (or lower one) as your database, which mean
you need to find the client machine that have the same oracle version or lower installed
or
you may need to reinstall your oracle client.

- second option: if you have an access to your server, physically or remotely, simply just logon and use the exp command from the command line.

Step by Step Installing Red Hat Linux on VmWare

Installing Red Hat over VmWare - part 1




Installing Red Hat over VmWare - part 2





Installing Red Hat over VmWare - part 3




Installing Red Hat over VmWare - part 4

Thursday, May 1, 2008

SUN'S REFERENCE ARCHITECTURE FOR ORACLE 11g GRID

Sun's Reference Architecture for Oracle 11g Grid is a portfolio of Sun and third-party products designed to reduce the risks, uncertainty, and costs associated with implementing an Oracle database within a grid computing environment. Designed, tested, implemented, and tuned at the Sun Competency Center for Oracle in Menlo Park, California, the reference architecture consists of recommended, integrated hardware and software stacks for a proven grid database solution. Along with this architecture, Sun provides a best practices framework for obtaining optimal performance, availability, and resiliency.

The most compelling benefits of Sun's Reference Architecture for Oracle 11g Grid come not from the individual components, but from the ability to integrate complementary elements - whether they come from Sun or another vendor. The combination of Sun Fire x64 servers with AMD Opteron processors and Cisco InfiniBand technology ensures higher database throughput, while the adoption of Solaris Cluster Advanced Edition for RAC enhances the reliability and availability of Oracle RAC 11g. The result is a solution that can help deliver the highest service levels and satisfy the most demanding business requirements of a database grid.

Get this white paper at:
http://searchoracle.bitpipe.com/data/document.do?res_id=1200499879_537