Common Problems and Oracle Connectivity Issues
Common Problems and Oracle Connectivity Issues
Connectivity issues
Submitted by inforadar on Thu, 06/03/2010 - 22:33
Tags:
Databases
Possible Solution:
1. Identify the oracle client versions installed in your computer. The installation paths are
usually in c:\oracle or D:\Oracle with sub-directory name as Oracle client version.
2. Go to Start –>Settings –>Control Panel–>Administrative Tools –> Services and look for
the service names starting with Oracle and stop these services (Right Click on service
name and you get a menu item to stop the service).
3. Go Start –>Program Files–>{Identify the Program Name starting with Oracle}–>Oracle
Installation Products –> Universal Installer–> Select ‘Deinstall Products’ and select the
Oracle Home to start deinstall process.
4. Delete all the sub-directories under c:\oracle or d:\oracle whichever is appropriate in your
case.
5. Delete the directory called “Inventory” under c:\Program Files\Oracle\.
6. Start a fresh Oracle Client Installation. Set up TNS_ADMIN environment variable and
test the installation.
7. After Installation is done, please test the connectivity as mentioned in the “How to test
Connectivity to Oracle Database?” section.
1. On your windows computer, click on Start –> Run, type cmd and click OK to start the
command Prompt.
2. On the command Prompt, enter tnsping <DB Name>
If you get an error “TNS COULD NOT RESOLVE SERVICE NAME” or similar error
message, then verify that you have tnsnames.ora and sqlnet.ora in
<ORACLE_HOME>/NETWORK/ADMIN
If you get error while running sqlplus or tnsping command from command prompt as
“Command Not recognized” or similar, please refer to “Steps to modify the PATH
variable”
Example:
’sqlplus’ is not recognized as an internal or external command, operable program or batch file.
If you have problem with the Oracle ODBC connectivity, you need to ensure that you have
the following things verified:
1. Follow the instructions under “How to Test Connectivity to the Oracle Database” to test
the simple sqlplus connectivity to the database.
2. When you created the System or User DSN, select the Oracle ODBC driver “Oracle in
xxxxxxxx” instead of “Microsoft ODBC for Oracle”.
3. On the next screen, enter your username and password and the TNS Service Name in the
Database name. ex. DSSC or DSST , hit “Test” button to test the connectivity. If you
receive any error, note the error message as it would help the Oracle DBA to resolve the
issue faster.
Some times if the Oracle Client directory is not included in your PATH variable, you may
get errors such as “Sqlplus/tnsping” is not recognized as an internal or external command. In
this Case, we can make sure that the Path to Oracle client binaries in included in the path
variable. The typical bin directory path can be : c or d :\orcle\<oracle client version>\bin
To view/modify the PATH variable follow these instructions: (Assumption: We have the 9i
client and path is c:\oracle\920\bin)
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: You might be using a local tnsnames.ora which is not updated automatically with any
configuration changes. You can replace this file with the latest tnsnames.ora file from shared
drive (Z:\CARES\Databases\tnsnames) or point your TNS_ADMIN variable to the shared drive
and try connecting to the database again. If the problem persists, contact Oracle DBA.
ORA-12541:TNS:no listener
Cause: The connection request could not be completed because the listener is not running.
Action: Check with your DBAs if they are working on the server. If its is not down due to some
maintenance activity, page/call DBA to investigate further on this issue.
ORA-12545: Connect failed because target host or object does not exist
ORA-12505: TNS: listener could not resolve SID given in connection description.
Cause: Oracle suggest that this error indicates that the address specified (in the alias definition)
is not valid.
Action: You might be using a local tnsnames.ora which is not updated automatically with any
configuration changes. You can replace this file with the latest tnsnames.ora file from shared
drive (Z:\CARES\Databases\tnsnames) or point your TNS_ADMIN variable to the shared drive
and try connecting to the database again. If the problem persists, contact Oracle Primary.
Cause: More shared memory is needed than was allocated. SGA private memory has been
exhausted. Fragmentation of shared pool memory is a common problem and ORA-04031 is
commonly a result of such fragmentation. Application programmers usually get this error while
attempting to load a big package or while executing a very large procedure and there is not
sufficient contiguous free memory available in the shared pool. This may be due to
fragmentation of the shared pool memory or insufficient memory in the shared pool.
Action: Notify the Oracle DBA as soon as possible. Work with application Development team to
re-estimate the SGA parameters.
Possible Causes:
The SGA requires more space than was allocated for it.
Action:
You might be using a local tnsnames.ora which is not updated automatically with any
configuration changes. You can replace this file with the latest tnsnames.ora file from shared
drive (Z:\CARES\Databases\tnsnames) or point your TNS_ADMIN variable to the shared drive
and try connecting to the database again. If the problem persists, contact Oracle DBA.
Cause: You are entering incorrect username and password for that database.
Action: Contact Oracle DBA and ask them to reset your password or unlock your account.
Tags:
Databases
1. Identify the oracle client versions installed in your computer. The installation paths are
usually in c:\oracle or D:\Oracle with sub-directory name as Oracle client version.
2. Go to Start –>Settings –>Control Panel–>Administrative Tools –> Services and look for
the service names starting with Oracle and stop these services (Right Click on service
name and you get a menu item to stop the service).
3. Go Start –>Program Files–>{Identify the Program Name starting with Oracle}–>Oracle
Installation Products –> Universal Installer–> Select ‘Deinstall Products’ and select the
Oracle Home to start deinstall process.
4. Delete all the sub-directories under c:\oracle or d:\oracle whichever is appropriate in your
case.
5. Delete the directory called “Inventory” under c:\Program Files\Oracle\.
6. Start a fresh Oracle Client Installation. Set up TNS_ADMIN environment variable and
test the installation.
7. After Installation is done, please test the connectivity as mentioned in the “How to test
Connectivity to Oracle Database?” section.
1. On your windows computer, click on Start –> Run, type cmd and click OK to start the
command Prompt.
2. On the command Prompt, enter tnsping <DB Name>
If you get an error “TNS COULD NOT RESOLVE SERVICE NAME” or similar error
message, then verify that you have tnsnames.ora and sqlnet.ora in
<ORACLE_HOME>/NETWORK/ADMIN
If you get error while running sqlplus or tnsping command from command prompt as
“Command Not recognized” or similar, please refer to “Steps to modify the PATH
variable”
Example:
’sqlplus’ is not recognized as an internal or external command, operable program or batch file.
If you have problem with the Oracle ODBC connectivity, you need to ensure that you have
the following things verified:
1. Follow the instructions under “How to Test Connectivity to the Oracle Database” to test
the simple sqlplus connectivity to the database.
2. When you created the System or User DSN, select the Oracle ODBC driver “Oracle in
xxxxxxxx” instead of “Microsoft ODBC for Oracle”.
3. On the next screen, enter your username and password and the TNS Service Name in the
Database name. ex. DSSC or DSST , hit “Test” button to test the connectivity. If you
receive any error, note the error message as it would help the Oracle DBA to resolve the
issue faster.
Some times if the Oracle Client directory is not included in your PATH variable, you may
get errors such as “Sqlplus/tnsping” is not recognized as an internal or external command. In
this Case, we can make sure that the Path to Oracle client binaries in included in the path
variable. The typical bin directory path can be : c or d :\orcle\<oracle client version>\bin
To view/modify the PATH variable follow these instructions: (Assumption: We have the 9i
client and path is c:\oracle\920\bin)
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: You might be using a local tnsnames.ora which is not updated automatically with any
configuration changes. You can replace this file with the latest tnsnames.ora file from shared
drive (Z:\CARES\Databases\tnsnames) or point your TNS_ADMIN variable to the shared drive
and try connecting to the database again. If the problem persists, contact Oracle DBA.
ORA-12541:TNS:no listener
Cause: The connection request could not be completed because the listener is not running.
Action: Check with your DBAs if they are working on the server. If its is not down due to some
maintenance activity, page/call DBA to investigate further on this issue.
ORA-12545: Connect failed because target host or object does not exist
ORA-12505: TNS: listener could not resolve SID given in connection description.
Cause: Oracle suggest that this error indicates that the address specified (in the alias definition)
is not valid.
Action: You might be using a local tnsnames.ora which is not updated automatically with any
configuration changes. You can replace this file with the latest tnsnames.ora file from shared
drive (Z:\CARES\Databases\tnsnames) or point your TNS_ADMIN variable to the shared drive
and try connecting to the database again. If the problem persists, contact Oracle Primary.
Cause: More shared memory is needed than was allocated. SGA private memory has been
exhausted. Fragmentation of shared pool memory is a common problem and ORA-04031 is
commonly a result of such fragmentation. Application programmers usually get this error while
attempting to load a big package or while executing a very large procedure and there is not
sufficient contiguous free memory available in the shared pool. This may be due to
fragmentation of the shared pool memory or insufficient memory in the shared pool.
Action: Notify the Oracle DBA as soon as possible. Work with application Development team to
re-estimate the SGA parameters.
Possible Causes:
The SGA requires more space than was allocated for it.
Action:
You might be using a local tnsnames.ora which is not updated automatically with any
configuration changes. You can replace this file with the latest tnsnames.ora file from shared
drive (Z:\CARES\Databases\tnsnames) or point your TNS_ADMIN variable to the shared drive
and try connecting to the database again. If the problem persists, contact Oracle DBA.
Action: Contact Oracle DBA and ask them to reset your password or unlock your account.
Tags:
Databases
declare
cursor c1 is select tablespace_name
from dba_tablespaces
where tablespace_name not in
(’SYSTEM’,'SYSAUX’,'UNDOTBS’,'UNDO’,'TOOLS’,'USERS’)
and contents=’PERMANENT’
and tablespace_name=nvl(upper(’&tbsnm’),tablespace_name)
union
select tablespace_name
from dba_segments
where tablespace_name not in
(’SYSTEM’,'SYSAUX’,'UNDOTBS’,'UNDO’,'TOOLS’,'USERS’)
and tablespace_name=nvl(upper(’&&tbsnm’),tablespace_name);
c3rec c3%rowtype;
tbspctfree number(5,2) := 0;
dbblksize number(7,7) := 0;
totspred number(15,2) := 0;
targetsize number(15,2) := 0;
newtarget number(15,2) := 0;
lasttotspred number(15,2) := 0;
spacereduz number(15,2) := 0;
begin
for tbsp in c1 loop
end if;
/* get db_block_size */
select value/1024/1024 into dbblksize
from v$parameter
where name = ‘db_block_size’;
else
dbms_output.put_line(’alter database datafile ”’||dtfreeup.file_name||”’ resize ‘||spacereduz||’M;
—allocated is ‘||dtfreeup.kbytes_alloc);
lasttotspred := totspred;
end if;
/* dbms_output.put_line(’spacereduz b4 if is: ‘||spacereduz||’totspred is ‘||totspred); */
exit when (totspred >= targetsize);
if totspred < targetsize then /* if targetsize hasn’t been reached, then try to reduce space on
datafiles with contents */
for dtreduce in c2(tbsp.tablespace_name) loop
newtarget := dtreduce.total_size-(targetsize-lasttotspred);
/* dbms_output.put_line(’new target size is ‘||newtarget); */
totspred := lasttotspred+(dtreduce.total_size-newtarget);
/* dbms_output.put_line(’totspred + newtarget: ‘||totspred); */
dbms_output.put_line(’alter database datafile ”’||dtreduce.file_name||”’ resize ‘||
ceil(newtarget)||’M; —allocated is ‘||dtreduce.total_size);
else
end if;
end if;
close c3;
end;
/