如何查找Oracle服务名称 [英] How to find Oracle Service Name

查看:92
本文介绍了如何查找Oracle服务名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网络上有一个Oracle数据库,可以使用主机名,端口,用户名,密码和SID与Oracle SQL Developer连接.

我需要连接另一个应用程序(Quantum Gis),但是它使用服务名而不是SID.

当我通过SID连接到SQL Developer时,有什么方法可以确定数据库的SERVICE_NAME吗?

我无权访问服务器,也没有本地tnsnames.ora或类似名称.

解决方案

所有会话使用的服务概述在SERVICE_NAME列中提供了专有视图v$session(对于RAC数据库为gv$session). >

要将信息限制为已连接的会话,请使用视图V$MYSTAT中的SID:

select SERVICE_NAME from gv$session where sid in (
select sid from V$MYSTAT)

如果名称为 SYS$USERS ,则会话为连接到默认服务,即,在连接字符串中未指定显式的service_name.

要查看数据库中可用的服务,请使用以下查询:

select name from V$SERVICES;
select name from V$ACTIVE_SERVICES;

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.

解决方案

Overview of the services used by all sessions provides the distionary view v$session(or gv$session for RAC databases) in the column SERVICE_NAME.

To limit the information to the connected session use the SID from the view V$MYSTAT:

select SERVICE_NAME from gv$session where sid in (
select sid from V$MYSTAT)

If the name is SYS$USERS the session is connected to a default service, i.e. in the connection string no explicit service_name was specified.

To see what services are available in the database use following queries:

select name from V$SERVICES;
select name from V$ACTIVE_SERVICES;

这篇关于如何查找Oracle服务名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆