Showing posts with label Connection. Show all posts
Showing posts with label Connection. Show all posts

Sunday, September 26, 2010

ORA-12532: TNS:invalid argument

Problem Description
While connecting to oracle database it fails with ORA-12532: TNS:invalid argument like below.
$ sqlplus system@bddip

SQL*Plus: Release 11.1.0.6.0 - Production on Sun Sep 26 13:18:56 2010

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

Enter password:
ERROR:
ORA-12532: TNS:invalid argument
Cause of the Problem
If you look for the Oracle error message for ORA-12532 you will see,
ORA-12532:TNS:invalid argument
Cause: An internal function received an invalid parameter.
Action: Not normally visible to the user. For further details, turn on tracing and reexecute the operation. If error persists, contact Oracle Customer Support.
It sounds like oracle bug. If you do tnsping it also fails like below,
$tnsping ddip
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = 192.168.100.1)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = bddip.com)))
TNS-12532: TNS:invalid argument
If you enable client tracing you will see,
ntt2err: soc  error - operation=1, ntresnt[0]=502, ntresnt[1]=113, ntresnt[2]=0 
ntt2err: exit
nttcni: exit
nttcon: exit
nserror: entry
nserror: nsres: id=0, op=65, ns=12532, ns2=12560; nt[0]=502, nt[1]=113, nt[2]=0; ora[0]=0, ora[1]=0, ora[2]=0
nsopen: unable to open transport
The OS error 113 indicates that there is no route to host in Linux platform.

Based on tracing we can say the problem happened due to firewall settings or there is a network issue.

Note that the problem can also happened due to bad password definition for user that you are using connect. For example in the password there is '@' symbol.

Solution of the Problem
Ensure that firewall is not blocking the connection. You can easily test it from client machine by using telnet.
$ telnet {database server IP} {listener port}

If your database server IP address is 192.168.100.1 and listener port is 1521 then issue,

$ telnet 192.168.100.1 1521

You would get a blank screen with blinking cursor. It will fail to connect if there is either firewall or network transport issue.

Remove underlying firewall.

Also if you have '@' character with the password field then remove the character.

Thursday, January 7, 2010

Service Names Using LDAP Fails With TNS-03505 and ORA-12154

Problem Description
It is used LDAP, sqlnet.ora entry is NAMES.DIRECTORY_PATH = (LDAP) and Tnsping fails with TNS-03505: Failed to resolve name or TNS-12154 / ORA-12154: TNS:could not resolve service name.

Problem Symptom
- Service name is registered in Internet Directory tree.
- Internet Directory tree is configured for service name resolution.
- If we look at sqlnet.ora trace file we will see the text 'Directory server type is 4096'.

Cause of the Problem
In LDAP, the problem occurs if oracle cannot locate the ldap.ora file. Directory server type 4096 stands for "unknown", which indicates that the client is not able to pickup the ldap.ora file.

Solution of the Problem
If you use TNSNAMES.ORA then for the solution of this problem look at http://arjudba.blogspot.com/2010/01/troubleshoot-ora-12154-tns-12154-tns.html.

In case of LDAP configuration,
On windows, ensure that there is a correctly configured ldap.ora file on the client in the ORACLE_HOME\network\admin directory.

On Unix, ensure that ldap.ora file on the client exist on $ORACLE_HOME/network/admin
directory.
In some types of installations on unix, there may be an ldap.ora file in ORACLE_HOME\ldap\admin directory.

On Oracle9i the ldap.ora file can also be placed in the directory defined by the TNS_ADMIN environment variable.

Following is an example of ldap.ora:
DEFAULT_ADMIN_CONTEXT = "dc=no,dc=oracle,dc=com"
DIRECTORY_SERVERS= (hostname:389:636)
DIRECTORY_SERVER_TYPE = OID
Related Documents 
ORA-12560: TNS:protocol adapter error on windows machine while starting oracle 
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor 
Startup fails with oracle error ORA-00119, ORA-00132
http://arjudba.blogspot.com/2010/01/troubleshoot-ora-12154-tns-12154-tns.html

Troubleshoot ORA-12154 TNS-12154 TNS-03505: Failed to resolve name

In this document I will discuss step by step solutions for ORA-12154, TNS-12154 and TNS-03505. About ORA-12154 it is already discussed in Troubleshoot ORA-12154. This post will be applicable to troubleshoot for both ORA-12154, TNS-12154 and TNS-03505.

What Oracle Says about the Problem
If you open http://arjudba.blogspot.com/2008/06/how-to-get-oracle-error-message-from.html you will see about the description of TNS-12154 or ORA-12154 they are telling same like below.
Oracle Error : TNS-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.

Action:
- If you are using local naming (TNSNAMES.ORA file):

- Make sure that "TNSNAMES" is listed as one of the values of the NAMES.DIRECTORY_PATH parameter in the Oracle Net profile (SQLNET.ORA)

- Verify that a TNSNAMES.ORA file exists and is in the proper directory and is accessible.

- Check that the net service name used as the connect identifier exists in the TNSNAMES.ORA file.

- Make sure there are no syntax errors anywhere in the TNSNAMES.ORA file. Look for unmatched parentheses or stray characters. Errors in a TNSNAMES.ORA file may make it unusable.

- If you are using directory naming:

- Verify that "LDAP" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).

- Verify that the LDAP directory server is up and that it is accessible.

- Verify that the net service name or database name used as the connect identifier is configured in the directory.

- Verify that the default context being used is correct by specifying a fully qualified net service name or a full LDAP DN as the connect identifier

- If you are using easy connect naming:

- Verify that "EZCONNECT" is listed as one of the values of the NAMES.DIRETORY_PATH parameter in the Oracle Net profile (SQLNET.ORA).

- Make sure the host, port and service name specified are correct.

- Try enclosing the connect identifier in quote marks. See the Oracle Net Services Administrators Guide or the Oracle operating system specific guide for more information on naming.

For case TNS-03505: it says
TNS-03505: Failed to resolve name
Cause: The service name you provided could not be found in TNSNAMES.ORA, an Oracle Names server, or a native naming service.
Action: Verify that you entered the service name correctly. You may need to ensure that the name was entered correctly into the network configuration.

which indicates for both ORA-12154, TNS-12154 and TNS-03505 we will have a generic solution.


Step 01: Overview of the Problem
Both ORA-12154, TNS-12154 and TNS-03505 indicates that SQL*Net could not find the alias specified for a connection in the TNSNAMES.ORA file or other naming adapter.

As the problem is regarding TNSNAMES.ORA and SQLNET.ORA so in order to dig into solution it is important to print out or a view of both the TNSNAMES.ORA and the SQLNET.ORA files. Looking at these files at the same time is helpful since references will be made to both.

Step 02: Identify the location of TNSNAMES.ORA and SQLNET.ORA
It is necessary to locate the location of TNSNAMES.ORA and SQLNET.ORA. If you simply use tnsping dummy it will say the location of SQLNET.ORA and there TNSNAMES.ORA should be in the same location.
E:\Documents and Settings\Arju>tnsping dummy

TNS Ping Utility for 32-bit Windows: Version 11.1.0.6.0 - Production on 08-JAN-2010 11:00:46

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

Used parameter files:
D:\app\Arju\product\11.1.0\db_1\network\admin\sqlnet.ora
TNS-03505: Failed to resolve name
From the above output we see both of these files are located in the path D:\app\Arju\product\11.1.0\db_1\network\admin\.

Through above ways we can determine current path of these two files. However it is important to know the default path of these files. Based on the operating system default path are mentioned below.

i)Windows 3.x client
ORAWIN\NETWORK\ADMIN directory

ii)Windows 95/98 client
SQL*Net 2.x - ORAWIN95\NETWORK\ADMIN
Net8 - ORAWIN95\NET80\admin
Net8i - ORACLE\ORA81\NETWORK\ADMIN

iii)Windows NT client
SQL*Net 2.x - ORANT\NETWORK\ADMIN
Net8 - ORANT\NET80\ADMIN
Net8i - ORACLE\ORA81\NETWORK\ADMIN

iv)UNIX Client
$ORACLE_HOME/NETWORK/ADMIN
or /etc
or /var/opt/oracle

Step 03: Print out or View both TNSNAMES.ORA and SQLNET.ORA.
Following is the correct TNSNAMES.ORA from my system
# tnsnames.ora Network Configuration File: D:\app\Arju\product\11.1.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

A =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ARJU)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = a)
)
)
Following is the correct SQLNET.ORA from my system.
# sqlnet.ora Network Configuration File: D:\app\Arju\product\11.1.0\db_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.

# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)


Step 04: Check several factors one by one.
To Troubleshoot problem let's start with some complex TNSNAMES.ORA and SQLNET.ORA.
TNSNAMES.ORA Experimental Sample
DEV.WORLD = 
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = 10.1.1.1)
(Port = 1521)
)
)
(CONNECT_DATA = (SID = ORCL)
)
)
SQLNET.ORA Experimental Sample
TRACE_LEVEL_CLIENT = OFF 
SQLNET.AUTHENTICATION_SERVICES = (NONE)
NAMES.DIRECTORY_PATH = (TNSNAMES)
AUTOMATIC_IPC = OFF
i) Determine which tns entry you used to connect. For example if you used dummy then issue a tnsping dummy and ensure that the entry DUMMY must exist in the TNSNAMES.ORA.

For example, my "tnsping a" worked because in my TNSNAMES.ORA I have an entry regarding alias A which I have pasted my TNSNAMES.ORA above.
E:\Documents and Settings\Arju>tnsping a

TNS Ping Utility for 32-bit Windows: Version 11.1.0.6.0 - Production on 08-JAN-2010 11:00:34

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

Used parameter files:
D:\app\Arju\product\11.1.0\db_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ARJU)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = a)))
OK (330 msec)

tnsping dummy will fail because there is no entry in my TNSNAMES.ORA with name dummy and also connection with dummy will fail too.
Make sure by using IP Address entry instead of hostname inside TNSNAMES.ORA. So use HOST=192.168.1.1 something like that instead of HOST=ARJU.

ii) Check both file again and ensure that there is no CTRL-A (^A) or CTRL-C (^C) characters inserted at the ends of any lines.

iii) If both are fine check the TNSNAMES.ORA alias. Here in our experimental sample it is DEV.WORLD which means .WORLD is our domain and it should be specified it our SQLNET.ORA. So add the parameter NAMES.DEFAULT_DOMAIN = world anywhere in the SQLNET.ORA file. Save the file, and try the connection again.

iv) If within the TNSNAMES.ORA there is no default domain in the alias*(for example it is simply DEV but not DEV.WORLD) then remove NAMES.DEFAULT_DOMAIN = world from the SQLNET.ORA file if there existed. After removing the parameter, save the SQLNET.ORA file, and try connecting again.

v) If the parameter NAMES.DIRECTORY_PATH exists in the SQLNET.ORA file, make sure the value in parenthesis lists TNSNAMES. For example following two examples are valid entry.
NAMES.DIRECTORY_PATH=(TNSNAMES) 
NAMES.DIRECTORY_PATH=(TNSNAMES, HOSTNAME)
Though NAMES.DIRECTORY_PATH parameter is not needed, but if it exists then it should look ok. After removing it you can try connecting again.

vi) At this phase the configuration files are most likely technically accurate.
Now you have to ensure that your TNSNAMES.ORA is in the correct location and you have used correct TNS entry while connecting. The TNS location can be set by TNS_ASMIN environmental variable.

On your Unix environment,
% echo $TNS_ADMIN

If nothing is returned, try setting the TNS_ADMIN environment variable to explicitly point to the location of the TNSNAMES.ORA file.

In C Shell, the syntax is:
% setenv TNS_ADMIN full_path_to_tnsnames.ora_file

In K Shell, the syntax is:
% TNS_ADMIN=full_path_to_tnsnames.ora_file; export TNS_ADMIN

After setting try the connection/tnsping again.

In case of Windows 3.x,
- TNS_ADMIN is set in the ORACLE.INI.

- Look in the C:\WINDOWS directory for the ORACLE.INI file. Look for the parameter TNS_ADMIN. TNS_ADMIN is a parameter that can be set to have SQL*Net point to an alternate location for the configuration files.
- Search for duplicate TNSNAMES.ORA and SQLNET.ORA files.
- Make sure none exist.
- Once you are sure try the connection/tnsping again.

In case of Windows 95/98,
- Open the file ORACLE_HOME\bin\oracle.key.
- Search for Registry under the location specified by the .key file, such as HKEY_LOCAL_MACHINE\Software\Oracle\Home1 for a parameter called TNS_ADMIN.
- TNS_ADMIN is a parameter that can be set to have SQL*Net point to an alternate location for the configuration files.
- Search for duplicate TNSNAMES.ORA and SQLNET.ORA files.
- Make sure none exist.
- Once you are sure try the connection/tnsping again.

In case of Windows XP,
- Make sure TNS_ADMIN environemental points to correct location. Ensure that there must not exist both user variable or system variable environmental variable. If nothing exist you can add one user variable. To set user/system variable,
-- Right click on My computer
-- Click Properties.
-- Click Advanced Tab.
-- Click Environemental Variables.
-- You can have both User and System Variables there.
You can add, edit or delete variables. You can simply add TNS_ADMIN and its location in the user variable section. Note that Variable Name would be "TNS_ADMIN" and variable would be "The location of the TNSNAMES.ORA in your client environement."

- After you set try connection again.

Your problem would be resolved.
Related Documents
ORA-12560: TNS:protocol adapter error on windows machine while starting oracle
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Startup fails with oracle error ORA-00119, ORA-00132

Monday, October 13, 2008

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

Error Description
This problem occurs on windows machine. Whenever you login as a user of windows domain group then in the database all connections both local and remote, including SYSDBA, fail with an ORA-28547.

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

Cause of the Problem
Oracle Native Authentication Services is failing.

Solution of the Problem
Way 1:
Disable Oracle Native Authentication Services. In the server machine inside sqlnet.ora change the parameter value of SQLNET.AUTHENTICATION_SERVICES from (NTS) to (NONE).

Way 2:
Change the database service to run as a user who is a member of the Domain Admin group. Because in order to connect using native authentication service oracle Log on user must be a privileged user to allow it to correctly authenticate the client user for Native Authentication.

To do so,
1.Go to Services. Right click on My computer>Select Manage>Select Services and Application> Select Services> On the right side From a list Scroll to your OracleService$ORACLE_SID
You will search for your database name instead of $ORACLE_SID of OracleService$ORACLE_SID.

2. Right click on the service and click the properties of the database service, select the LogOn tab.

3. Select "This Account" and add you domain admin account details and Ok

4. Shutdown the database

5. Stop and restart the service

Tuesday, June 24, 2008

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

Problem Description:
--------------------------------------------

Whenever you try to connect your database it returns error ORA-12154.
SQL> conn prod/prod@jupi
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

Cause of The Problem:
------------------------------------

The cause of the problem is depends on the which naming method you are using. Suppose if you use tnsnames.ora for naming method then there might be problem in it. I look for oerr command on my unix machine and got,

-bash-3.00$ oerr ora 12154
12154, 00000, "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.
// *Action:
// - If you are using local naming (TNSNAMES.ORA file):
// - Make sure that "TNSNAMES" is listed as one of the values of the
// NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA)
// - Verify that a TNSNAMES.ORA file exists and is in the proper
// directory and is accessible.
// - Check that the net service name used as the connect identifier
// exists in the TNSNAMES.ORA file.
// - Make sure there are no syntax errors anywhere in the TNSNAMES.ORA
// file. Look for unmatched parentheses or stray characters. Errors
// in a TNSNAMES.ORA file may make it unusable.
// - If you are using directory naming:
// - Verify that "LDAP" is listed as one of the values of the
// NAMES.DIRETORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA).
// - Verify that the LDAP directory server is up and that it is
// accessible.
// - Verify that the net service name or database name used as the
// connect identifier is configured in the directory.
// - Verify that the default context being used is correct by
// specifying a fully qualified net service name or a full LDAP DN
// as the connect identifier
// - If you are using easy connect naming:
// - Verify that "EZCONNECT" is listed as one of the values of the
// NAMES.DIRETORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA).
// - Make sure the host, port and service name specified
// are correct.
// - Try enclosing the connect identifier in quote marks.
//
// See the Oracle Net Services Administrators Guide or the Oracle
// operating system specific guide for more information on naming.

Solution of The Problem:
-----------------------------------------------

Actually above solution already depicted what to do if you get the problem. My suggest after getting ORA-12154 immediately go as the steps mentioned below.

Step 1: Look for tnsnames.ora and sqlnet.ora.
-----------------------------------------------------------------------

Look for your tnsnames.ora and sqlnet.ora file that you are using. On unix the default location is $ORACLE_HOME/network/admin. You better avoid to use tnsnames.ora. By using easy naming service you can easily avoid this error. Easy naming service is discussed on See the solution part of this post

Step 2: Check both file
---------------------------------------------------------------------------

•After locating both file open it with any viewer like on windows with notepad and on unix with less or more or cat.

•Check within the files whether any illegal character or any unnecessary space exists. If have then remove that.

•Check whether the exact entry exist on the tnsnames.ora that you used in connection identifer. Like if you use conn a/a@jupi then within tnsnames.ora search for only jupi alias.

•You can check your whether there is error or not in the tnsnames alias inside tnsnames.ora by using tnsping. In order to check alias jupi we issue,

bash-3.00$ tnsping jupi

TNS Ping Utility for Solaris: Version 10.2.0.1.0 - Production on 12-OCT-2008 03:25:58

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

Used parameter files:
/oracle/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = ((ADDRESS = (PROTOCOL = TCP)(HOST = neptune)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ARJU)))
TNS-12533: TNS:illegal ADDRESS parameters
So there is illegal ADDRESS parameter which we see an extra ( before ADDRESS parameter.

If our tnsalias was good, then it would result below with how many miliseconds.
bash-3.00$ tnsping jupi

TNS Ping Utility for Solaris: Version 10.2.0.1.0 - Production on 12-OCT-2008 03:28:26

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

Used parameter files:
/oracle/app/oracle/product/10.2.0/db_1/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = neptune)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ARJU)))
OK (10 msec)

•Note that with name alias checking tnsnames also tell us which location parameter files it used. Here the location is /oracle/app/oracle/product/10.2.0/db_1/network/admin. So /oracle/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora location is used in order to resolve name. However if your tnsnames.ora is in other location then you have to set TNS_ADMIN variable.

•If you see tnsnames.ora is most likely accurate, echo the TNS_ADMIN environment variable.

% echo $TNS_ADMIN

•If nothing is returned, try to set the TNS_ADMIN environment variable to explicitly point to the location of the TNSNAMES.ORA file.

In C Shell, the syntax is:
% setenv TNS_ADMIN full_path_of_tnsnames.ora_file

In K Shell or bash, the syntax is:
% export TNS_ADMIN=full_path_of_tnsnames.ora_file

In windows the syntax is:
set TNS_ADMIN=full_path_of_tnsnames.ora_file

•Now try and see whether error remains. If still you get error then in the SQLNET.ORA file, add the parameter AUTOMATIC_IPC = OFF. If AUTOMATIC_IPC is already set to ON, then change the value to OFF. And try to connect. If still you get error then check the permission of tnsnames.ora and sqlnet.ora. For workaround you can set chmod 777 of these files and try to connect. At this point it is expected you have solved your problem.

Related Documents
ORA-12560: TNS:protocol adapter error on windows machine while starting oracle
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
Startup fails with oracle error ORA-00119, ORA-00132

Wednesday, May 28, 2008

How to find the User who is connected to Oracle

To know about the list of users that is now connected and the time when they connect to database issue the following query.

SQL> SELECT s.username, s.program, s.logon_time
FROM v$session s, v$process p, sys.v_$sess_io si
WHERE s.paddr = p.addr(+)
AND si.sid(+) = s.sid
AND s.type = 'USER';

USERNAME PROGRAM LOGON_TIM
---------- ------------------------------------------------ ---------
ARJU sqlplus@neptune (TNS V1-V3) 28-MAY-08
oracle@neptune (J000) 28-MAY-08

To know only the current session user name you can issue the following query,

SQL> SELECT USERNAME from v$session where audsid = sys_context('userenv','sessionid');
USERNAME
------------------------------
ARJU

To know about on which schema you are connecting issue following query.

SQL> SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual;
SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
--------------------------------------------------------------------------------
ARJU

To know about the connected user user for the current session issue,
SQL> SELECT sys_context('USERENV', 'SESSION_USER') FROM dual;
SYS_CONTEXT('USERENV','SESSION_USER')
--------------------------------------------------------------------------------
ARJU

If you use SQL*plus then simply issue,
SQL> SHOW USER;
USER is "ARJU"

Related Documents
Get IP Address from hostname within Oracle Database
How to find current session ID
How to know which objects are being accessed by a user

Thursday, May 1, 2008

ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

Symtompts of the Problem:
---------------------------

Whenever you try to conenct to database by providing SYS user name and password it retuens error.
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

Cause of The Problem:
--------------------

This is because of the parameter O7_DICTIONARY_ACCESSIBILITY settings to FALSE.

Access to dictionary objects is restricted to the users with the system privileges SYSDBA and SYSOPER. Connecting as SYSDBA gives a user unrestricted privileges to perform any operation on a database or the objects within a database. Data dictionary objects is under SYS schema and is protected by O7_DICTIONARY_ACCESSIBILITY to FALSE settings.

Workaround Example:
---------------------

1)Try to connect by user sys without sysdba privilege.

SQL> conn sys/a
ERROR:
ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

Warning: You are no longer connected to ORACLE.

2)Connect as sysdba and change O7_DICTIONARY_ACCESSIBILITY
SQL> conn / as sysdba
Connected.

SQL> SHOW PARAMETER O7_DICTIONARY_ACCESSIBILITY
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
O7_DICTIONARY_ACCESSIBILITY boolean FALSE

SQL> ALTER SYSTEM SET O7_DICTIONARY_ACCESSIBILITY=TRUE scope=spfile;
System altered.


3)Since O7_DICTIONARY_ACCESSIBILITY is static parameter restart is necessary.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup

ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 2019288 bytes
Variable Size 109051944 bytes
Database Buffers 50331648 bytes
Redo Buffers 6369280 bytes
Database mounted.
Database opened.

4)Now connect as sys with only password.

SQL> conn sys/a
Connected.

SQL> show parameter O7_DICTIONARY_ACCESSIBILITY
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
O7_DICTIONARY_ACCESSIBILITY boolean TRUE

5)Though you are SYS user but you have not currently have SYSDBA privilege. So, you can't do SYSDBA privilege tasks.

SQL> shutdown immediate;
ORA-01031: insufficient privileges

SQL> show user
USER is "SYS"



Caution:
-----------

Oracle Strongly recommends not to use O7_DICTIONARY_ACCESSIBILITY to TRUE.

Related Documents:
-------------------

What is O7_DICTIONARY_ACCESSIBILITY

Sunday, April 6, 2008

Troubleshooting ORA-2085 "database link %s connects to %s"

When the source database initialization parameter GLOBAL_NAMES is set to true, the database link name must match the target database global name as it exists in the GLOBAL_NAME view in the data dictionary.

This error have two solutions.

A)Create database link with the name as of source database global database name.
B)Change GLOBAL_NAMES to false if it is not required.

(A)Create database link with the name as of source database global database name.
------------------------------

One thing you should remember when you do not specify the domain portion of the dblink name in the create statement, Oracle automatically qualifies the link name with the domain of the SOURCE database global name view.

Check the contents of ALL_DB_LINKS for the fully qualified link name.

To know the global name of the source database,
SQL>Select * from global_name;
TEST.WORLD.COM

Now according to output you can make database link in your destination database, like

SQL>Create public database link TEST.WORLD.COM connect to userid identified by password using 'test';

Or , you can make it by
SQL>create database link ARJU.JUPITER.ARJU.NET connect to web_key identified by web_key using '(DESCRIPTION=(ADDRESS = (PROTOCOL = TCP)(HOST = jupiter)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ARJU.JUPITER.ARJU.NET)
))';


Where in the database where I like to connect after invoking lsnrctl status I got the HOST = jupiter and PORT = 1522 and SERVICE_NAME = ARJU.JUPITER.ARJU.NET.

(B)Change GLOBAL_NAMES to false if it is not required.
----------------


SQL> alter system set global_names=FALSE;
System altered.

Related Documents
How to Import data without Dumpfile-Network Mode Import with use of database link

Tuesday, April 1, 2008

What is Connection Pooling?

Connection pooling in the JDBC 2.0 extension API is a framework for caching database connections. This allows reuse of physical connections and reduced overhead for your application. Connection pooling functionality minimizes expensive operations in the creation and closing of sessions.

a pooled connection instance represents a single physical connection to a database, remaining open during use by a series of logical connection instances.

A logical connection instance is a simple connection instance (such as a standard Connection instance or an OracleConnection instance) returned by a pooled connection instance.