[oracle] How to find Oracle Service Name

I have an Oracle database on my network which I am able to connect to with Oracle SQL Developer, using hostname, port, username, password and the SID.

I need to connect another application (Quantum Gis), however it uses the Service Name instead of the SID.

Is there any way for me to determine the SERVICE_NAME of the database when I am connected in SQL Developer via the SID?

I do not have access to the server and have no local tnsnames.ora or similar.

This question is related to oracle

The answer is


TO FIND ORACLE_SID USE $. oraenv


Check the service name of a database by

sql> show parameter service;


Connect to the server as "system" using SID. Execute this query:

select value from v$parameter where name like '%service_name%';

It worked for me.


With SQL Developer you should also find it without writing any query. Right click on your Connection/Propriety.

You should see the name on the left under something like "connection details" and should look like "Connectionname@servicename", or on the right, under the connection's details.


Thanks to this thread (https://community.oracle.com/thread/473276)

select sys_context('userenv','service_name') from dual;

It can be executed with a regular user account, no need for sysdba rights


Found here, no DBA : Checking oracle sid and database name

select * from global_name;

Connect to the database with the "system" user, and execute the following command:

show parameter service_name