Archive

Archive for the ‘ORA-Errors’ Category

ORA-28043: invalid bind credentials for DB-OID connection

In this article, I will write about resolving ORA-28043 error. Our databases integrated with Oracle Internet Directory and registered in OID under domain dc=tholdap,dc=local
Some users in my company reported that they can’t login to database using OID user accounts. They get ORA-28043 error when attempt to login database. In this situation, first thing to do is enable a trace for this error in database as below.

sqlplus / as sysdba

SQL> alter system set events ‘28033 trace name context forever, level 9’;

Try to reconnect with OID user account and get ORA-28043 error again.

Go trace file location under directory $ORACLE_BASE/diag/rdbms/$SID/$SID/trace

The sample trace file contains following lines.

vi /u01/app/oracle/diag/rdbms/testdb/TESTDB/trace/TESTDB_ora_9951.trc

ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1
System name: SunOS
Node name: dbtest
Release: 5.10
Version: Generic_150400-09
Machine: sun4v
Instance name: TESTDB
Redo thread mounted by this instance: 1
Oracle process number: 2610
Unix process pid: 9951, image: oracle@dbtest

*** ACTION NAME:() 2016-02-24 09:04:40.463
*** MODULE NAME:(Toad.exe) 2016-02-24 09:04:40.463
*** SERVICE NAME:(TESTDB) 2016-02-24 09:04:40.463
*** SESSION ID:(1212.44043) 2016-02-24 09:04:40.463
kzld_discover received ldaptype: OID
kzld found pwd in wallet
KZLD_ERR: Failed to bind to LDAP server. Err=49
KZLD_ERR: 49
KZLD is doing LDAP unbind
KZLD_ERR: found err from kzldini.
~
~

According to trace file, the error message is related to binding to LDAP Server.

kzld_discover received ldaptype: OID
kzld found pwd in wallet
KZLD_ERR: Failed to bind to LDAP server. Err=49
KZLD_ERR: 49
KZLD is doing LDAP unbind
KZLD_ERR: found err from kzldini.

Let me check, if I can connect to ldap server using username and password stored in database wallet.

Now, there is a question: How can we find the username and password stored in our database wallet ?

$ mkstore -wrl $ORACLE_BASE/admin/TESTDB/wallet -viewEntry ORACLE.SECURITY.DN
Oracle Secret Store Tool : Version 11.2.0.3.0 – Production
Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.

Enter wallet password: abcd678xx_

ORACLE.SECURITY.DN = cn=TESTDB,cn=OracleContext,dc=tholdap,dc=local
$ mkstore -wrl $ORACLE_BASE/admin/TESTDB/wallet -viewEntry ORACLE.SECURITY.PASSWORD
Oracle Secret Store Tool : Version 11.2.0.3.0 – Production
Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.

Enter wallet password: abcd678xx_

ORACLE.SECURITY.PASSWORD = +HKRbmQ7

mkstore will ask you for wallet password which you entered during database OID registration.

Now, we have the username and password as below.

ORACLE.SECURITY.PASSWORD = +HKRbmQ7
ORACLE.SECURITY.DN = cn=TESTDB,cn=OracleContext,dc=tholdap,dc=local

Now it is needed to verify database connection to LDAP Server.

First let me get port number from ldap.ora file located in directory $ORACLE_HOME/network/admin.

$ cat /u01/app/oracle/product/11.2.0/db_1/network/admin/ldap.ora
# ldap.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/ldap.ora
# Generated by Oracle configuration tools.

DIRECTORY_SERVERS= (idmoid.vodafone.local:1389:1636)

DEFAULT_ADMIN_CONTEXT = “dc=tholdap,dc=local”

DIRECTORY_SERVER_TYPE = OID

Run ldapbind command to check connection to LDAP Server.

$ ldapbind -h idmoid.vodafone.local -p 1389 -D cn=TESTDB,cn=OracleContext,dc=tholdap,dc=local -w kSlIt+n2
ldap_bind: Invalid credentials

So the problem was due to Invalid credentials. All right! How we can solve this issue?

There is two way:

1- Go to OID and update password for cn=TESTDB,cn=OracleContext,dc=tholdap,dc=local at attribute userPassword with value received from ORACLE.SECURITY.PASSWORD

2- Re-register the database using DBCA as below

dbca -silent -configureDatabase -sourceDB TESTDB -unregisterWithDirService true -dirServiceUserName cn=dirManager -dirServicePassword OracleTHO11 walletPassword abcd678xx_

dbca -silent -configureDatabase -sourceDB TESTDB -registerWithDirService true -dirServiceUserName cn=dirManager -dirServicePassword OracleTHO11 walletPassword abcd678xx_

After re-registering database, ldapbind will be successful

$ ldapbind -h idmoid.vodafone.local -p 1389 -D cn=TESTDB,cn=OracleContext,dc=tholdap,dc=local -w +HKRbmQ7
bind successful

Now, users can login database successfully.

I want to note that, if there is spaces in your CN (Directory Service username) then you must write \20 instead of spaces.

For example: Lets assume that our directory service username is “directory manager”. So we must write it as below in DBCA

dbca -silent -configureDatabase -sourceDB TESTDB -unregisterWithDirService true -dirServiceUserName cn=directory\20manager -dirServicePassword OracleTHO11 walletPassword abcd678xx_

You will get an error without “\20” as below

dbca -silent -configureDatabase -sourceDB TESTDB -unregisterWithDirService true -dirServiceUserName cn=directory manager -dirServicePassword OracleTHO11 walletPassword abcd678xx_
manager is an invalid command line argument.

clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file

March 2, 2013 6 comments

Hi Friends,

I installed 11.2.0.3 Grid Infrastructure software on Red Hat Enterprise Linux 6.3. After installation I executed root.sh script and got following error.

/oracle/grid11g/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory Failed to create keys in the OLR, rc = 127, Message:

Especially, you can get this error during execution of root.sh script on Linux 6.X

When I executed root.sh script, the output was below.

[root@dbtestvm1 ~]# /oracle/grid11g/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
ORACLE_OWNER= ora11g
ORACLE_HOME= /oracle/grid11g

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of “dbhome” have not changed. No need to overwrite.
The contents of “oraenv” have not changed. No need to overwrite.
The contents of “coraenv” have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /oracle/grid11g/crs/install/crsconfig_params
/oracle/grid11g/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory Failed to create keys in the OLR, rc = 127, Message:

Failed to write the checkpoint:” with status:FAIL.Error code is 256

Failed to create keys in the OLR at /oracle/grid11g/crs/install/crsconfig_lib.pm line 7497. /oracle/grid11g/perl/bin/perl -I/oracle/grid11g/perl/lib -I/oracle/grid11g/crs/install /oracle/grid11g/crs/install/roothas.pl execution failed

I checked libcap rpm is installed or not.

[root@dbtestvm1 ~]# rpm -q libcap
libcap-2.16-5.5.el6.x86_64

Hımm libcap-2.16-5.5.el6.x86_64  is installed. The error message shows that it searches for libcap.so.1.  I configured YUM according to my article https://taliphakanozturken.wordpress.com/2012/03/17/how-to-use-yum-to-install-rpm-packages-with-dependencies/

I checked the availability of rpm files which contains libcap.

[root@dbtestvm1 ~]# yum list | grep libcap
libcap.i686 2.16-5.5.el6 @cd
libcap.x86_64 2.16-5.5.el6 @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3
libcap-devel.x86_64 2.16-5.5.el6 @cd
libcap-ng.x86_64 0.6.4-3.el6_0.1 @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3
libcap-ng-devel.x86_64 0.6.4-3.el6_0.1 @anaconda-RedHatEnterpriseLinux-201206132210.x86_64/6.3
compat-libcap1.i686 1.10-1 cd
compat-libcap1.x86_64 1.10-1 cd
libcap-devel.i686 2.16-5.5.el6 cd
libcap-ng.i686 0.6.4-3.el6_0.1 cd
libcap-ng-devel.i686 0.6.4-3.el6_0.1 cd

So I need to install compat-libcap1.x86_64 rpm rpm. (My operating system is x86_64)

[root@dbtestvm1 ~]# yum install compat-libcap1.x86_64
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package compat-libcap1.x86_64 0:1.10-1 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
compat-libcap1 x86_64 1.10-1 cd 17 k

Transaction Summary
================================================================================
Install 1 Package(s)

Total download size: 17 k
Installed size: 29 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : compat-libcap1-1.10-1.x86_64 1/1
Installed products updated.
Verifying : compat-libcap1-1.10-1.x86_64 1/1

Installed:
compat-libcap1.x86_64 0:1.10-1

Complete!

Now, we can continue. Before rerunning of root.sh script, we must deconfigure it.

[root@dbtestvm1 ~]# /oracle/grid11g/crs/install/roothas.pl -deconfig -force
Using configuration parameter file: /oracle/grid11g/crs/install/crsconfig_params
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Stop failed, or completed with errors.
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Delete failed, or completed with errors.
CRS-4544: Unable to connect to OHAS
CRS-4000: Command Stop failed, or completed with errors.
Failure in execution (rc=-1, 0, No such file or directory) for command /etc/init.d/ohasd deinstall
Successfully deconfigured Oracle Restart stack

let’s rerun root.sh script. It will run successfully.

[root@dbtestvm1 ~]# /oracle/grid11g/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
ORACLE_OWNER= ora11g
ORACLE_HOME= /oracle/grid11g

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of “dbhome” have not changed. No need to overwrite.
The contents of “oraenv” have not changed. No need to overwrite.
The contents of “coraenv” have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file: /oracle/grid11g/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user ‘ora11g’, privgrp ‘dba’..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user ‘root’, privgrp ‘root’..
Operation successful.
CRS-4664: Node dbtestvm1 successfully pinned.
Adding Clusterware entries to upstart

dbtestvm1 2013/02/28 16:55:21 /oracle/grid11g/cdata/dbtestvm1/backup_20130228_165521.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
[root@dbtestvm1 ~]#

Talip Hakan Öztürk

How To Solve ORA-06508 | ORA-04065 | ORA-04068 Errors?

April 19, 2012 Leave a comment

In this article, I will write about resolving  ORA-06508, ORA-04065, ORA-04068 errors.

The cause of the ORA-04068 is when a dependent object in a package is altered by a DDL statement.  When packages are compiled, the copies of the package in the shared pool are marked as invalid.  In the meantime, there is a new copy of the package that recognizes the calling package. As a result, the ORA-04068 occures. This error occures on the first time when it is called. On the second time, it runs successfuly. But in some cases may have to make a small change in our codes to get rid of these errors.

Now let’s do a test on this issue. I build a package as follows talip_test. Declare a global variable at the SPEC of the package.

CREATE OR REPLACE PACKAGE talip_test
IS
global_var NUMBER := 10;

PROCEDURE inner_test_proc;
END;
/

CREATE OR REPLACE PACKAGE BODY talip_test
IS
PROCEDURE inner_test_proc
IS
BEGIN
global_var := global_var + 1;
DBMS_OUTPUT.put_line (‘Variable =’ || global_var);
END;
END;
/

Next we create a procedure that will call this package.

CREATE OR REPLACE PROCEDURE outer_test_proc
AS
err VARCHAR2 (1024);
BEGIN
talip_test.inner_test_proc;
END;
/

We see that it works successfuly on SQL * Plus.

SQL> set serveroutput on

SQL> begin outer_test_proc; end; /

Variable =12

PL/SQL procedure successfully completed.

Now let some change at the SPEC of  the talip_test package. Add second global variable. And re-compile the SPEC + BODY.

CREATE OR REPLACE PACKAGE talip_test
IS
global_var NUMBER := 10;
global_var2 NUMBER := 10;

PROCEDURE inner_test_proc;
END;
/

CREATE OR REPLACE PACKAGE BODY talip_test
IS
PROCEDURE inner_test_proc
IS
BEGIN
global_var := global_var + 1;
DBMS_OUTPUT.put_line (‘Variable =’ || global_var);
END;
END;
/

outer_test_proc  procedure was invalidated. Compile it.

SQL> select status from dba_objects where object_name=’OUTER_TEST_PROC’;

STATUS

——-

INVALID

SQL> alter procedure outer_test_proc compile ;

SQL> select status from dba_objects where object_name=’OUTER_TEST_PROC’;

STATUS

——-

VALID

In this case, the sessions connected to the database receives ORA-04 068 error when they call the procedure. This error is logged only once in the calling package.

SQL>begin outer_test_proc; end; /

begin outer_test_proc; end;

* ERROR at line 1: ORA-04068: existing state of packages has been discarded

ORA-04061: existing state of package body “TALIP.TALIP_TEST” has been invalidated

ORA-04065: not executed, altered or dropped package body “TALIP.TALIP_TEST”

ORA-06508: PL/SQL: could not find program unit being called: “TALIP.TALIP_TEST”

ORA-06512: at “TALIP.OUTER_TEST_PROC”, line 5 ORA-06512: at line 1

If the package executed for the second time in the same session, it runs successfuly.

SQL> set serveroutput on

SQL> /

Variable =12

PL/SQL procedure successfully completed.

Any PL/SQL block can have an exception-handling part, which can have one or more exception handlers.  In this case, the sessions connected to a database receives these errors on each execution. let’s change outer_test_proc procedure as follows.

CREATE OR REPLACE PROCEDURE outer_test_proc
AS
err VARCHAR2 (1024);
BEGIN
talip_test.inner_test_proc;
EXCEPTION
WHEN OTHERS
THEN
err := SUBSTR (SQLERRM, 0, 1000);
DBMS_OUTPUT.put_line (err);
ROLLBACK;
END;
/

Now let talip_test some change at the SPEC. Add a third global variable. And recompile the SPEC + BODY.

CREATE OR REPLACE PACKAGE talip_test
IS
global_var NUMBER := 10;
global_var2 NUMBER := 10;
global_var3 NUMBER := 10;

PROCEDURE inner_test_proc;
END;
/

CREATE OR REPLACE PACKAGE BODY talip_test
IS
PROCEDURE inner_test_proc
IS
BEGIN
global_var := global_var + 1;
DBMS_OUTPUT.put_line (‘Değişken =’ || global_var);
END;
END;
/

Our outer_test_proc procedure was invalidated. Compile it.

SQL> select status from dba_objects where object_name=’OUTER_TEST_PROC’;

STATUS

——-

INVALID

SQL> alter procedure outer_test_proc compile ;

SQL> select status from dba_objects where object_name=’OUTER_TEST_PROC’;

STATUS

——-

VALID

In this case, the sessions connected to the database will receive ORA-06508 error on each execution of outer_test_proc procedure.

SQL> begin outer_test_proc; end; /

ORA-06508: PL/SQL: could not find program unit being called

PL/SQL procedure successfully completed.

SQL> /

ORA-06508: PL/SQL: could not find program unit being called

PL/SQL procedure successfully completed.

Raise the exception in “when others then” block. In this situation, sessions will receive error on the first time. They will not receive any error on the second time.

CREATE OR REPLACE PROCEDURE outer_test_proc
AS
err VARCHAR2 (1024);
BEGIN
talip_test.inner_test_proc;
EXCEPTION
WHEN OTHERS
THEN
err := SUBSTR (SQLERRM, 0, 1000);
DBMS_OUTPUT.put_line (err);
ROLLBACK;
RAISE;
END;
/

Re-execute the procedure. It will run successfuly on the second time.

SQL> begin outer_test_proc; end; /

begin outer_test_proc; end;

* ERROR at line 1: ORA-04068: existing state of packages has been discarded

ORA-04061: existing state of package “TALIP.TALIP_TEST” has been invalidated

ORA-04065: not executed, altered or dropped package “TALIP.TALIP_TEST”

ORA-06508: PL/SQL: could not find program unit being called: “TALIP.TALIP_TEST”

ORA-06512: at “TALIP.OUTER_TEST_PROC”, line 11 ORA-06512: at line 1

SQL> /

PL/SQL procedure successfully completed.

Wishing to be useful …

Talip Hakan Öztürk

%d bloggers like this: