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..

 
Showing posts with label Ora Error. Show all posts
Showing posts with label Ora Error. Show all posts

Tuesday, August 6, 2013

ORA-28001: the password has expired


When you encounter an oracle error ORA-28001: the password has expired and you do not have sysdba priviledge, here is how to handle it.

What you need is sqlplus, which is located in ORACLE_HOME/bin. The step to resolve this are:
1. Login to you account by using sqlplus in command prompt
    c:\sqlplus or $sqlplus

2. Enter your user and the service
    Enter user-name: user@service

3. Enter your password when prompted to do so, and you will get the error ORA-28001
    Enter password:
    ERROR:
    ORA-28001: the password has expired

4. Then it will prompt for password change, you need to enter your new password twice.
    Changing password for user
    New password:
    Retype new password:
    Password changed

Then you will be able to login to the system.

 

Thursday, February 28, 2013

ORA-06530: Reference to uninitialized composite

ORA-06530: Reference to uninitialized composite
ORA-06512: at "PROCEDURE/PACKAGE", line 88
ORA-06512: at "PROCEDURE/PACKAGE", line 446
ORA-06512: at line 11
06530. 00000 -  "Reference to uninitialized composite"
*Cause:    An object, LOB, or other composite was referenced as a
           left hand side without having been initialized.
*Action:   Initialize the composite with an appropriate constructor
           or whole-object assignment.

Cause:

This error would be found when using oracle collection table type, and trying to assign the value to the collect. When compiling the code, it would be fine. But, when execute the package/procedure, you will have this error message.

The error caused when trying to extend the define table type object without being initialized. See the scenario below:

CREATE TYPE obj_test AS OBJECT
       (tst_id       number,
        tst_name    VARCHAR2(50));
/
CREATE TYPE tab_test AS TABLE OF obj_test;
/

declare
      l_tab_tst tab_test := tab_test();  
begin
    begin
        l_tab_tst.extend;
        l_tab_tst(l_tab_tst.last).tst_id := 22;
        l_tab_tst(l_tab_tst.last).tst_name :=  'TEST';
    exception
    when no_data_found then
       null;
    end;
end;
/

Solution:

To fix this, simply add initialized object line as shown below:

declare
      l_tab_tst tab_test := tab_test();  
begin
    begin
        l_tab_tst.extend;
        l_tab_tst(l_tab_tst.last) := type_supplier(NULL, NULL);

        l_tab_tst(l_tab_tst.last).tst_id := 22;
        l_tab_tst(l_tab_tst.last).tst_name :=  'TEST';
    exception
    when no_data_found then
       null;
    end;
end;
/

ORA-06052: PL/SQL: numeric or value error on PL/SQL Collections First and Last

Cause:
The error ORA-06052: PL/SQL: numeric or value error would be found when using for loop on the type collection object, as shown below, and the collection is empty:

FOR i IN type_variable.FIRST..t_variable.LAST LOOP
     ----your code
End Loop ;

When the collection is not empty, error ORA-06052: PL/SQL: numeric or value error would not be found.
This is because FIRST and LAST return the first and last (smallest and largest) index numbers in a collection that uses integer subscripts.


Solution:

Use  FOR i IN 1..t_variable.count instead of FOR i IN type_variable.FIRST..t_variable.LAST , and also apply exception block.

BEGIN
      FOR i IN 1..t_variable.count
           ----your code
      End Loop;
EXCEPTION WHEN OTHERS
     -- error handling code
END; 

Monday, April 16, 2012

ORA-06512: at line

ORA-06512: at stringline string

Cause: Backtrace message as the stack is unwound by unhandled exceptions.

Action: Fix the problem causing the exception or write an exception handler for this condition. Or you may need to contact your application administrator or DBA.
PostingPosting


Tuesday, March 22, 2011

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

Cause:
The listener received a request to establish a connection to a database or other service. The connect descriptor received by the listener specified a service name for a service (usually a database service) that either has not yet dynamically registered with the listener or has not been statically configured for the listener. This may be a temporary condition such as after the listener has started, but before the database instance has registered with the listener.


Solution:
1. Check your tnsnames.ora as shown in my post on ora-12154.
2. Check if your listener service are on, if not start your lisnter using lsnrctl. More information on this take a look at the same post at ora-12154
3. Check if the service is on using command line lsnrctl services
4. Check your listener.log 

ORA-12154: TNS:could not resolve the connect identifier specified

Cause:
A connection to a database or other service was requested using a connect identifier, and the connect identifier specified could not be resolved into a connect descriptor using one of the naming methods configured. For example, if the type of connect identifier used was a net service name then the net service name could not be found in a naming method repository, or the repository could not be located or reached.

Solution:
1. Check your tnsnames.ora.
Check your tnsnames.ora if it is configured property the key to check is SID, dba host name or ip address. The syntax are something similar this this:


ORA_TNS =
 (DESCRIPTION = 
   (ADDRESS_LIST =
     (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
   )
 (CONNECT_DATA =
   (SERVICE_NAME = ORA-10)
 )
)



2. Check your listener.ora if sid_list_listenner setup is there.
By Default when you install new oracle database the listener.ora would contain only listener configuration section but no sid_list_listenner setup. In many occasion when I have this ora-12154 problem the solution that help me is modifying listener.ora, adding SID_LIST_LISTENER section the syntax should be something similar to the below syntax:





SID_LIST_LISTENER =
   (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)
      (SID_NAME = ORA-10)
    )
  )



The complete file are as shown below



# listener.ora Network Configuration File: /u01/app/oracle/product/10.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
   (SID_LIST =
     (SID_DESC =
       (ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)
       (SID_NAME = ORA-10)
     )
   )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

After adding SID_LIST_LISTENER in your listener.ora, restart or reload your listener service. I prefer using command line lnsrctl follow by parameter reload or restart, or you can just type lnsrctl and then enter and type reload or restart. With this command line (lsnrctl) you can also check oracle listener status by enter parameter status. 


3. Check the environmental variables
Check if the environmental variables like ORACLE_HOME, ORACLE_SID, ORACLE_BASE, ORACLE_PATH do exist. The most important environmental variables are the first two variable ORACLE_HOME, ORACLE_SID.

Tools
The very handy tool you can use to check the connection is the command tnsping follow by your service name configured in your tnsnames.ora from the example above is ORA_TNS.

Wednesday, May 14, 2008

EXP-00056: ORACLE error 12541 encountered

EXP-00056: ORACLE error 12541 encountered
ORA-12541: TNS:no listener
EXP-00000: Export terminated unsuccessfully

check your tnsname.ora or your server listener

Sunday, May 4, 2008

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-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

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.

Wednesday, April 23, 2008

TNS-12535: TNS:operation timed out

There might be sometime that when you try to connect to Oracle Server and you get the error "TNS-12535: TNS:operation timed out". It seem that the server does not exist or the listener does not start or both of them. The first thing you need to have a look is
the tnsnames.ora which could be found at
- $ORACLE_HOME/network/admin for unix like OS ie. every distribute of Linux, Solaris etc.
- ..\oracle\product\10.2.0\ for Windows Platform

in this tnsnames.ora will look like this

ora_service_name =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORA_Server)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORA_SID)
)
)

there are 2 things you need to have a look there.

The first one is to check if your Ora_SID is correct, if you don't know please contact your dba admin and ask for it.

The Second thing you need to take a look at is the HOST part host/ip parth (HOST=....) this is where your oracle server is.

If both Ora_SID and HOST are correct then try to ping the server to see if you can reach the server (there might be the case that the network admin turn the ping port of for security reason though, in this case you are behind firewall).

To make sure if you are really behind the firewall try telnet the server with this syntax
telnet server_IP 1521 ( or whatever your Oracle listening port is). If you get the following error

Connecting To your server_ipd...Could not open connection to the host, on port 1521:
Connect failed


then 90% you are behind firewall, please contact your network administrator to turn the firewall on port 1521 on.

Monday, April 2, 2007

Microsoft OLE DB Provider for ODBC Drivers error '80004005' Specified driver could not be loaded due to system error 5 (Oracle in OraHome92).

Solution Description
--------------------

Oracle 9.2 Client software requires that you give the Authenticated User
privilege to the Oracle Home by following these steps:

1. Log on to Windows as a user with Administrator privileges.

2. Launch Windows Explorer from the Start Menu and and navigate to the
ORACLE_HOME folder. This is typically the "Ora92" folder under the
"Oracle" folder (i.e. D:\Oracle\Ora92).

3. Right-click on the ORACLE_HOME folder and choose the "Properties" option
from the drop down list. A "Properties" window should appear.

4. Click on the "Security" tab of the "Properties" window.

5. Click on "Authenticated Users" item in the "Name" list (on Windows XP
the "Name" list is called "Group or user names").

6. Uncheck the "Read and Execute" box in the "Permissions" list under the
"Allow" column (on Windows XP the "Permissions" list is called
"Permissions for Authenticated Users").

7. Re-check the "Read and Execute" box under the "Allow" column (this is
the box you just unchecked).

8. Click the "Advanced" button and in the "Permission Entries" list make
sure you see the "Authenticated Users" listed there with:

Permission = Read & Execute
Apply To = This folder, subfolders and files

If this is NOT the case, edit that line and make sure the "Apply onto"
drop-down box is set to "This folder, subfolders and files". This
should already be set properly but it is important that you verify this.

9. Click the "Ok" button until you close out all of the security properties
windows. The cursor may present the hour glass for a few seconds as it
applies the permissions you just changed to all subfolders and files.

10. Reboot your computer to assure that these changes have taken effect.


Re-execute the application and it should now work.

ref: http://www.ureader.com/message/451160.aspx

Wednesday, March 28, 2007

Error: 'ORA-28547: connection to server failed, probable Net8 admin error'

Error: 'ORA-28547: connection to server failed, probable Net8 admin error'
Any other error indicates that the tnsnames.ora, listener.ora, or both are not correct.

Cause: A failure occurred during initialization of a network connection from a client process to the Oracle server:
The connection was completed but a disconnect occurred while trying to perform protocol-specific initialization, usually due to use of different network protocols by opposite sides of the connection.
This usually is caused by incorrect Oracle Net administrative setup for database links or external procedure calls.
The most frequent specific causes are:

* The connection uses a connect string which refers to a Heterogeneous Services agent instead of an Oracle server.
* The connection uses a connect string which includes an (HS=) specification.


Check Oracle Net administration in the following ways:

* When using TNSNAMES.ORA or an Oracle Names server, make sure that the client connection to the ORACLE server uses the correct service name or SID.
* Check LISTENER.ORA on the connection end point's host machine to assure that this service name or SID refers to the correct server.
* Confirm in TNSNAMES.ORA or the equivalent service definition that the connect string does NOT contain (HS=).

Ref: http://www.dbmotive.com/