首页 > 解决方案 > 如何知道谁以及如何在 Oracle 自治事务处理中使用了预定义的数据库服务名称

问题描述

根据本文档, https://docs.oracle.com/en/cloud/paas/atp-cloud/atpug/connect-predefined.html#GUID-9747539B-FD46-44F1-8FF8-F5AC650F15BE

自治事务处理提供 5 个预定义的数据库服务名称;

我想知道这些服务名称是如何使用的,包括数量连接以及资源是如何消耗的。

标签: oracledatabase-administrationoracle-cloud-infrastructureoracle19c

解决方案


您可以尝试使用一些 SQL 语句来查询 V$SERVICE_STATS(您需要调整 service_name)。例如:

SQL> select service_name, name, value
  2  from v$service_stats
  3  join v$statname
  4  on v$service_stats.stat_id = v$statname.stat_id
  5  where service_name='SYS$USERS'
  6  order by service_name, name;

SERVICE_NAME         NAME                                     VALUE
-------------------- ----------------------------------- ----------
SYS$USERS            DB time                               26317254
SYS$USERS            application wait time                      379
SYS$USERS            cluster wait time                            0
SYS$USERS            concurrency wait time                 20112125
SYS$USERS            db block changes                          1637
SYS$USERS            execute count                             7221
SYS$USERS            gc cr block receive time                     0
SYS$USERS            gc cr blocks received                        0
SYS$USERS            gc current block receive time                0
SYS$USERS            gc current blocks received                   0
SYS$USERS            logons cumulative                          108

SERVICE_NAME         NAME                                     VALUE
-------------------- ----------------------------------- ----------
SYS$USERS            opened cursors cumulative                11078
SYS$USERS            parse count (total)                       1488
SYS$USERS            parse time elapsed                    13400006
SYS$USERS            physical reads                            3643
SYS$USERS            physical writes                              0
SYS$USERS            redo size                               248932
SYS$USERS            session cursor cache hits                10309
SYS$USERS            session logical reads                    56879
SYS$USERS            user I/O wait time                    65219837
SYS$USERS            user calls                                 293
SYS$USERS            user commits                                 7

SERVICE_NAME         NAME                                     VALUE
-------------------- ----------------------------------- ----------
SYS$USERS            user rollbacks                               1
SYS$USERS            workarea executions - multipass              0
SYS$USERS            workarea executions - onepass                0
SYS$USERS            workarea executions - optimal             2557

26 rows selected.

推荐阅读