来源于:

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;

【翻译自mos文章】在Oracle单机数据库中定义database service的更多相关文章

  1. 【翻译自mos文章】在12c数据库中,哪种audit trail 受到支持?

    在12c数据库中,哪种audit trail 受到支持? 来源于:What Audit Trail Types Are Supported For A 12c Database? (文档 ID 198 ...

  2. 【翻译自mos文章】oracle db 中的用户账户被锁--查看oracle用户的尝试次数

    參考原文: Users Accounts Getting Locked. (Doc ID 791037.1) 事实上这个文章是为oracle 别的软件产品写的,只是涉及到user 锁定问题.那还是跟d ...

  3. 【翻译自mos文章】oracle支持在RDBMS HOME 下的 符号链接( Symbolic Links)吗?

    oracle支持在RDBMS HOME 下的 符号链接( Symbolic Links)吗? 參考原文: Does Oracle support Symbolic Links in the RDBMS ...

  4. 【翻译自mos文章】Oracle GoldenGate 怎么在源头的传输进程和目的端的server/collector进程之间分配 port?

    Oracle GoldenGate 怎么在源头的传输进程和目的端的server/collector进程之间分配 port? 来源于: How Does GoldenGate Allocates Por ...

  5. 【翻译自mos文章】11.2.0.4及更高版本号的asm实例中MEMORY_TARGET 和 MEMORY_MAX_TARGET的默认值和最小值

    [翻译自mos文章]11.2.0.4及更高版本号的asm实例中MEMORY_TARGET 和 MEMORY_MAX_TARGET的默认值和最小值 来源于: Default and Minimum ME ...

  6. 14.翻译系列:从已经存在的数据库中生成上下文类和实体类【EF 6 Code-First系列】

    原文链接:https://www.entityframeworktutorial.net/code-first/code-first-from-existing-database.aspx EF 6 ...

  7. Oracle 18c 数据库中scott用户不存在的解决方法

    Oracle 18c 数据库中scott用户不存在的解决方法 注:该文为转载 上面标题可直接跳转 原文地址:http://www.cnblogs.com/zangdalei/p/5482732.htm ...

  8. Oracle查询数据库中所有表的记录数

    1.Oracle查询数据库中所有表的记录数,但是有可能不准建议用第二种方式进行查询 select t.table_name,t.num_rows from user_tables t 2.创建orac ...

  9. 【翻译自mos文章】使用asm来部署 超大数据库(10TB到PB 范围)--针对oracle 10G

    使用asm来部署 超大数据库(10TB到PB 范围) 參考原文: Deployment of very large databases (10TB to PB range) with Automati ...

随机推荐

  1. Solidity 文档--第二章:安装 Solidity

    安装Solidity 基于浏览器的Solidity 如果你只是想尝试一个使用Solidity的小合约,你不需要安装任何东西,只要访问基于浏览器的Solidity. 如果你想离线使用,你可以保存页面到本 ...

  2. Laravel5.5配置使用redis

    1.安装redis linux上redis的安装与配置 2.安装redis客户端 composer require predis/predis或者安装 PhpRedis PHP 扩展brew inst ...

  3. APP中常见上下循环滚动通知的简单实现,点击可进入详情

    APP中常见上下循环滚动通知的简单实现,点击可进入详情 关注finddreams博客,一起分享一起进步!http://blog.csdn.net/finddreams/article/details/ ...

  4. 前端读者 | 分分钟让你理解HTTPS

    本文来自@Keely袁庆玲:来源:https://juejin.im/post/5ad6ad575188255c272273c4 目前来看大多数网站都从HTTP转向HTTPS,不在支持HTTP,所以了 ...

  5. docker 与 yarn

    有时我们的项目是使用yarn去发布的,当需要使用docker发布这个项目时,安装yarn是必须的,但是平时使用的npm install -g yarn此时却不可用 从网站上找到解决的方法 地址:htt ...

  6. 【转.解析清晰】你真明白 Python 装饰器么?

      原文出处: 武沛齐    装饰器是程序开发中经常会用到的一个功能,用好了装饰器,开发效率如虎添翼,所以这也是Python面试中必问的问题,但对于好多小白来讲,这个功能 有点绕,自学时直接绕过去了, ...

  7. Django CRM查询(一对多,多对多以及相关的反查)

    Customer模型: class Customer(models.Model): name = models.CharField(max_length=32) qq = models.CharFie ...

  8. pyinstaller对多进程程序的打包

    在使用python的第三方库pyinstaller对多进程程序进行打包时,程序不能正常的运行,但是后台却有多个进程一直在使用资源. 解决方法很简单,在if __name__ == '__main__' ...

  9. 【DFS】【最短路】【spfa】【BFS】洛谷P2296 NOIP2014提高组 day2 T2 寻找道路

    存反图,从终点dfs一遍,记录下无法到达的点. 然后枚举这些记录的点,把他们的出边所连的点也全部记录. 以上这些点都是无法在最短路中出现的. 所以把两个端点都没被记录的边加进图里,跑spfa.BFS什 ...

  10. Java高级架构师(一)第24节:加入ehcache,把工程加入到Git

    ehcache的maven配置: <!-- ehcache的jar --> <dependency> <groupId>net.sf.ehcache</gro ...