来源于:

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. 【SQL】全关系操作

    1.消除重复 - DISTINCT SQL语句中默认的是,重复的元祖可以多次的显示.如果希望消除重复,需要DISTINCT关键字. 注:消除重复需要排序,所以代价高.在需要高效率时要谨慎. SELEC ...

  2. hdu 3870(平面图最小割转最短路)

    Catch the Theves Time Limit: 5000/2000 MS (Java/Others)    Memory Limit: 65768/32768 K (Java/Others) ...

  3. ionic3 学习记录

    1生命周期 ionViewDidLoad(){ console.log("1.0 ionViewDidLoad 当页面加载的时候触发,仅在页面创建的时候触发一次,如果被缓存了,那么下次再打开 ...

  4. [BZOJ2667][cqoi2012]模拟工厂 贪心

    2667: [cqoi2012]模拟工厂 Time Limit: 3 Sec  Memory Limit: 128 MBSubmit: 367  Solved: 184[Submit][Status] ...

  5. 使用threadpool并发测试,报错HTTPConnectionPool Max retires exceeded

    解决方法:和以下答案一致 https://blog.csdn.net/qq_21405949/article/details/79363084 场景: 在做爬虫项目或者是在发送网络请求的时候,一般都会 ...

  6. HDU 1427 速算24点【数值型DFS】

    速算24点 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submi ...

  7. hdu2825(AC 自动机)

    hdu2825 题意 给出一些字符串,要求构造一个长度为 \(n\) 的字符串至少包括其中的 \(k\) 个,问有多少种字符串满足条件. 分析 AC自动机 构造状态转移,然后 状态压缩DP 即可. \ ...

  8. 25、Django实战第25天:讲师详情页

    1.复制teacher-detail.html到templates目录下 2.编辑teacher-detail.html,继承base.html 3.编辑organization.view.py cl ...

  9. CentOS 7.1 中文正式版下载 - 最流行的免费开源企业级 Linux 服务器操作系统

    如果说 Ubuntu 是现今最受桌面用户欢迎的 Linux 操作系统,那么 CentOS 就是最受公司.企业.IDC 喜爱的 Linux 发行版了.得益于极为出色的稳定性,全球范围内无数著名网站均选用 ...

  10. 找出能被5或6整除,但是不能被两者同时整除的数 Exercise05_11

    /** * @author 冰樱梦 * 时间:2018年下半年 * 题目:找出能被5或6整除,但是不能被两者同时整除的数 * */ public class Exercise05_11 { publi ...