来源于:

Defining a Database Service with a Stand Alone Database (文档 ID 1260134.1)

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.2.0.5 to 11.2.0.3 [Release 10.2 to 11.2]

Information in this document applies to any platform.

GOAL

The DBMS_SERVICE package allows the creation, deletion, starting and stopping of services in both RAC and a single instance. Additionally it provides the ability to disconnect all sessions which connect to the instance
with a service name when RAC removes that service name from the instance.

SOLUTION

The DBMS_SERVICE package lets you create, delete, activate and deactivate services for a single instance.



- Functions :

  • dbms_service.CREATE_SERVICE , Example:
SQL> exec dbms_service.CREATE_SERVICE(SERVICE_NAME=>'orderentry', NETWORK_NAME=>'db11g')
  • dbms_service.MODIFY_SERVICE , Example:
SQL> exec DBMS_SERVICE.MODIFY_SERVICE( -

> service_name => 'o11gr1', -

> goal => DBMS_SERVICE.GOAL_THROUGHPUT, -

> failover_method => DBMS_SERVICE.FAILOVER_METHOD_BASIC, -

> failover_type => DBMS_SERVICE.FAILOVER_TYPE_SELECT, -

> failover_retries => 10, -

> failover_delay => 1, -

> clb_goal => DBMS_SERVICE.CLB_GOAL_LONG);
  • dbms_service.START_SERVICE , Example:
SQL> exec dbms_service.START_SERVICE('orderentry')

SQL> show parameter service

It Recommended to have the LOCAL_LISTENER (Database) parameter set for the Database :

If You are using the default local address of TCP/IP, port 1521 :

alter system set LOCAL_LISTENER = '(ADDRESS=(PROTOCOL=TCP)(HOST=HOSTNAME or IP Add)(PORT=1521))' scope=spfile;

If You are using non default local address of TCP/IP, port other than 1521 :

alter system set LOCAL_LISTENER = '(ADDRESS=(PROTOCOL=TCP)(HOST=HOSTNAME or IP Add)(PORT=1522))' scope=spfile;

References:

http://docs.oracle.com/cd/E11882_01/network.112/e41945/listenercfg.htm#CHDCCHIC

  • dbms_service.STOP_SERVICE , Example:
SQL> exec dbms_service.STOP_SERVICE('orderentry')
  • dbms_service.DELETE_SERVICE , Example:
SQL> exec dbms_service.DELETE_SERVICE('orderentry')

-Monitoring



Use the following dictionary views to monitor services:



* dba_services - All defined services

* gv$active_services - All active (started) services



To see what service a session is connected to:

SELECT username, program, machine, service_name FROM gv$session;

最新文章

  1. llinux 查看自己的公网ip
  2. 关于Java项目打包
  3. 阿里前CEO卫哲用自己10余年经历,倾诉B2B的三差、四率、两大坑
  4. SQL学习笔记:选取第N条记录
  5. 转载 jQuery validation
  6. javascript的prototype原理理解
  7. iOS UISearchBar学习笔记
  8. Windows Azure 上 Linux VM 中的交换空间 – 第 2 部分
  9. mysql 用户权限设置
  10. SSH第一篇【整合SSH步骤、OpenSessionInView】
  11. 关于python 使用腾讯云OCR 通用印刷体识别
  12. mariadb安装
  13. Yii2框架GridView自带导出功能最佳实践
  14. C和C指针小记(十二)-函数的可变参数表
  15. 『计算机视觉』各种Normalization层辨析
  16. Atitit Loading 动画效果
  17. MongoDB(五)-- 副本集(replica Set)
  18. 峰值因子,峰均比,Reference Level
  19. learn go defer
  20. 【转】odoo学习之:Environment

热门文章

  1. 怎样简单编写一个html网页
  2. solr 启动过程分析
  3. 详解nginx、php-fpm和mysql用户权限
  4. Redis数据类型的常用API以及使用场景
  5. 以前在win7上死活安装不上的pymssql,现在可以安装了
  6. jQuery 立即执行
  7. QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as /usr/lib/i386-linux-gnu but ...
  8. golang笔记:cookie
  9. POJ1861 Network(Kruskal)(并查集)
  10. ASP.NET Core 2.2 基础知识(十五) Swagger