Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Oracle Tools for Debugging Problems

DZone's Guide to

Oracle Tools for Debugging Problems

There's a lot of command line tools that come with Oracle (even the local XE version) that can help you check your connection and debug connection issues. Read on to learn more.

· Database Zone ·
Free Resource

Running out of memory? Learn how Redis Enterprise enables large dataset analysis with the highest throughput and lowest latency while reducing costs over 75%! 

There's a lot of command line tools that come with Oracle (even the local XE version) that can help you check your connection and debug connection issues.

You should try to connect with sqlplus and with SQL Developer first. After that, if you are running a Java program make sure it has permissions, in Windows perhaps Admin privileges, and make sure if you are on an IPv4 stack that you have disabled IPv6. Unless, of course, you are using IPv6 in your local network.

-Djava.net.preferIPv4Stack=true

To Check if Oracle is working, first check the Oracle Services:

C:\oraclexe\app\oracle\product\11.2.0\server\bin>LSNRCTL.EXE

LSNRCTL> services

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))

Services Summary...

Service "CLRExtProc" has 1 instance(s).

Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...

Handler(s):

"DEDICATED" established:0 refused:0

LOCAL SERVER

Service "PLSExtProc" has 1 instance(s).

Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...

Handler(s):

"DEDICATED" established:0 refused:0

LOCAL SERVER

Service "XEXDB" has 1 instance(s).

Instance "xe", status READY, has 1 handler(s) for this service...

Handler(s):

"D000" established:0 refused:0 current:0 max:1022 state:ready

DISPATCHER <machine: TSPANN-LAPTOP, pid: 3868>

(ADDRESS=(PROTOCOL=tcp)(HOST=tspann-laptop)(PORT=1040))

Service "xe" has 1 instance(s).

Instance "xe", status READY, has 1 handler(s) for this service...

Handler(s):

"DEDICATED" established:1149 refused:0 state:ready

LOCAL SERVER

The command completed successfully

LSNRCTL> quit

That will give you a list of instances that you can then check to see if something is actually running there.  TNSPing will then let you check to see if the service or database listed is running and listening.

C:\oraclexe\app\oracle\product\11.2.0\server\bin>tnsping xe

TNS Ping Utility for 64-bit Windows: Version 11.2.0.2.0 - Production on 31-DEC-2015 10:58:30

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

Used parameter files:
C:\oraclexe\app\oracle\product\11.2.0\server\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = tspann-laptop)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVI
OK (20 msec)

Checkout this Oracle article for more help.

Running out of memory? Never run out of memory with Redis Enterprise databaseStart your free trial today.

Topics:
oracle ,sql ,debug

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}