Monday, February 9, 2009

ORA-12557: TNS:protocol adapter not loadable

Problem Description
In my machine I had oracle 10g home , using sqlplus of 10g I could connect to an Oracle database 10g. Now I have installed a new oracle 11g home, but using sqlplus of 11g I could not connect to Oracle database 10g. Below is an example,

With 10.2g sqlplus I can connect to 10g database.
C:\>e:\oracle\product\10.2.0\db_1\bin\BIN\sqlplus.exe maximsg/a@192.168.100.160/tiger

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 26 01:54:10 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

With 11g sqlplus I could not connect to oracle database 10g. It returns error message, ORA-12557: TNS:protocol adapter not loadable.
C:\>d:\app\oracle\BIN\sqlplus.exe maximsg/a@192.168.100.160/tiger

SQL*Plus: Release 11.1.0.6.0 - Production on Mon Jan 26 01:55:00 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

ERROR:
ORA-12557: TNS:protocol adapter not loadable

Cause of the Problem
The problem happens because of two ORACLE_HOME are installed on your system. As after 10g you hav e installed 11g so whenever you write sqlplus by default new 11g binaries are selected and raises ORA-12557. But working with old home 10g works fine.

Simply sqlplus does not work but 10g home location sqlplus (e:\oracle\product\10.2.0\db_1\bin\BIN\sqlplus.exe ) works.

C:\>sqlplus.exe maximsg/a@192.168.100.160/tiger

SQL*Plus: Release 11.1.0.6.0 - Production on Mon Jan 26 22:47:08 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.

ERROR:
ORA-12557: TNS:protocol adapter not loadable

Connecting to old oracle database using new binaries are not supported in oracle and error will return.

Solution of the Problem
Only setting ORACLE_HOME is not sufficient on windows environment. Because the location is taken from windows registry. So either uninstall newer oracle home or explicitly pointing to old oracle binaries will solve the problem.

Here using pointing to old home,
C:\>e:\oracle\product\10.2.0\db_1\bin\BIN\sqlplus.exe maximsg/a@192.168.100.160/tiger

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Jan 26 01:54:10 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

Alternatively you can follow below.

Step 01: Remove registry entries of new ORACLE_HOME.
To do this,
i)Type regedit on Run.
ii)Press enter and expand HKEY_LOCAL_MACHINE.
iii)Then expand SOFTWARE and then expand ORACLE tab. There you will see two oracle home. Right click on the one that you want to delete and then select delete. If prompting click yes.

Step 02: Remove any environmental variable.
i)Right click on My computer icon. Then select properties.
ii)System properties window will appear. Click on Advanced tab.
iii)Select environmental variables.
iv)Find the variable/system variable path and ORACLE_HOME. Edit or modify them so that it point to you desired sql*plus.
Usually in the PATH system variable you will get both ORACLE_HOME path. Just remove one path. Of course if you have ORACLE_HOME variable settings first delete the key.

Wednesday, January 14, 2009

The Function Is Not Available Under The Responsibility

Cause

This issue is caused by launching the menu item before the Compile Security has completed.

When a function is added to a menu , a concurrent program 'Compile Security' is submitted which
loads the data in Fnd_Compiled_Menu_Functions table.

Whenever a function is accessed, security code checks Fnd_Compiled_Menu_Functions table to
determine whether that function is accessible under the given security context or not. So if this
function is accessed before the 'Compile Security' program is finished, the function cache gets
loaded with stale data and the reported error message is thrown.

So after modifying the 2 menu definitions associated with 'System Administrator' and 'Application
Developer' make sure that 2 concurrent requests submitted for the above 2 modifications completed
normally and then try to access the functions.

Further once this error occurs, it will be cached which means that even after the menu item has
been flagged as available, it the error will be returned from the cache.

Solution

-- To implement the solution, please execute the following steps::
1) Manually run the 'Compile Security' concurrent program with parameter "YES"
2) Shut down Middle Tier (Apache)
3) Restart Middle tier
4) Test the menu item

Sunday, December 7, 2008

Auditing ddl on a database + DDL trigger

Conn / as sysdba

15:53:53 SQL > CREATE TABLE perfstat.STATS$DDL_LOG
15:55:30 2 (
15:55:30 3 USER_NAME VARCHAR2(25 BYTE),
15:55:30 4 DDL_DATE DATE,
15:55:30 5 DDL_TYPE VARCHAR2(25 BYTE),
15:55:30 6 OBJECT_TYPE VARCHAR2(25 BYTE),
15:55:30 7 OWNER VARCHAR2(25 BYTE),
15:55:30 8 OBJECT_NAME VARCHAR2(30 BYTE),
15:55:30 9 TERMINAL_NAME VARCHAR2(40 BYTE),
15:55:30 10 IP_ADDRESS VARCHAR2(30 BYTE)
15:55:30 11 );

Table created.

15:55:32 SQL > grant all on perfstat.STATS$DDL_LOG to apps;

Grant succeeded.

15:55:38 SQL > conn apps
Enter password:
Connected.
15:55:45 SQL > create synonym DDL_LOG for perfstat.STATS$DDL_LOG;

Synonym created.

15:55:53 SQL > conn / as sysdba
Connected.
15:55:57 SQL > CREATE OR REPLACE TRIGGER DDLTrigger
15:56:21 2 AFTER DDL ON DATABASE
15:56:21 3 DECLARE
15:56:21 4 v_terminal_name varchar2(40);
15:56:21 5 v_ip_address varchar2(40);
15:56:21 6 BEGIN
15:56:21 7 SELECT SYS_CONTEXT ('USERENV', 'TERMINAL')
15:56:21 8 INTO v_terminal_name
15:56:21 9 FROM DUAL;
15:56:21 10 SELECT SYS_CONTEXT ('USERENV', 'IP_ADDRESS')
15:56:21 11 INTO v_ip_address
15:56:21 12 FROM DUAL;
15:56:21 13 insert into
15:56:21 14 perfstat.stats$ddl_log
15:56:21 15 (
15:56:21 16 user_name,
15:56:21 17 ddl_date,
15:56:21 18 ddl_type,
15:56:21 19 object_type,
15:56:21 20 owner,
15:56:21 21 object_name,
15:56:21 22 terminal_name ,
15:56:21 23 ip_address
15:56:21 24 )
15:56:21 25 VALUES
15:56:21 26 (
15:56:21 27 ora_login_user,
15:56:21 28 sysdate,
15:56:21 29 ora_sysevent,
15:56:21 30 ora_dict_obj_type,
15:56:21 31 ora_dict_obj_owner,
15:56:21 32 ora_dict_obj_name,
15:56:21 33 v_terminal_name,
15:56:21 34 v_ip_address
15:56:21 35 );
15:56:21 36
15:56:21 37 END;
15:56:22 38 /

Trigger created.


16:01:36 SQL > conn apps
Enter password:
Connected.

16:02:36 SQL > select * from DDL_LOG;

USER_NAME DDL_DATE DDL_TYPE OBJECT_TYPE OWNER OBJECT_NAME TERMINAL_NAME IP_ADDRESS
---------- --------- ---------- --------------- -------- -------------------- -------------------- ----------------
APPS 16-JUN-08 CREATE TABLE APPS MOHIT LGDBA 10.102.120.118
APPS 16-JUN-08 DROP TABLE APPS MOHIT LGDBA 10.102.120.118

=======================================================================================================================

Monday, September 15, 2008

ORA-27211: Failed to load Media Management Library


RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03009: failure of allocate command on t1 channel at 02/03/2008 19:31:04

ORA-19554: error allocating device, device type: SBT_TAPE, device name:

ORA-27211: Failed to load Media Management Library

Additional information: 2

Solution :

Step 1 :

Check the trace file for more information in udump .

-------------------------------------------------------------------------------------------

/ms10/oracle/9.2.0/admin/lgeil/udump/lgeil_ora_4026994.trc

Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production

With the Partitioning, OLAP and Oracle Data Mining options

JServer Release 9.2.0.8.0 - Production

ORACLE_HOME = /ms10/oracle/9.2.0

System name: AIX

Node name: ilomsdb01

Release: 3

Version: 5

Machine: 00C0657C4C00

Instance name: lgeil

Redo thread mounted by this instance: 1

Oracle process number: 20

Unix process pid: 4026994, image: oracle@ilomsdb01 (TNS V1-V3)

*** SESSION ID:(19.1) 2008-02-03 19:31:04.091

Failed to load SBT library libobk.a(shr.o)

--------------------------------------------------------------------------------------------

libobk.a -> /usr/lib/libobk64.a

-------------------------------------------------------------------------------------------------------------------------

Solution :

Step 1 :

Now go to the locaiton $ORACLE_HOME/lib and check for the file libobk.a . If you won't find this file then contact your OS support team or Backup Team

Step 2 : ( To be peroformed by the unix team )

Now , Go to the location /usr/openv/netbackup/bin and chk for the file libobk.a64 . If this file exist , then run the command given below ( from root as user )

1. ln -s /usr/openv/netbackup/bin/libobk.a64 /usr/lib/libobk64.a

2. ln -s /usr/lib/libobk64.a <$ORACLE_HOME>/lib/libobk.a

ex :

ln -s /usr/lib/libobk64.a /ms10/oracle/9.2.0/lib/libobk.a

Note : In 99% case this will work . If it work for you , Then thats fine .Even after this if you get the error mentioned below .

----------------------------------------------------------------------------------------------------------------

RMAN-03009: failure of backup command on t1 channel at 09/11/2008 19:51:26

ORA-19506: failed to create sequential file, name="al_ORANMES_02jqbjl6_1_1_665177766", parms=""

ORA-27028: skgfqcre: sbtbackup returned error

ORA-19511: Error received from media manager layer, error text:

VxBSACreateObject: Failed with error:

Server Status: Communication with the server has not been iniatated or the server status has not been retrieved from the server.

channel t1 disabled, job failed on it will be run on another channel

released channel: t1

released channel: t2

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03009: failure of backup command on t2 channel at 09/11/2008 19:51:26

ORA-19506: failed to create sequential file, name="al_ORANMES_03jqbjl7_1_1_665177767", parms=""

ORA-27028: skgfqcre: sbtbackup returned error

ORA-19511: Error received from media manager layer, error text:

VxBSACreateObject: Failed with error:

Server Status: Communication with the server has not been iniatated or the server status has not been retrieved from the server.

---------------------------------------------------------------------------------------------------------------

Solution :

Then ask the UNIX ADMIN

--> To take the reboot of VERITAS Services .

--> Also to kill all the process related with VERITAS on the client side