【翻译自mos文章】多租户中的service管理
2017-07-15 13:43
316 查看
来源于:
Service Management For Multitenant (文档 ID 2009500.1)
Oracle Database - Enterprise Edition - Version 12.1.0.1 and later
Information in this document applies to any platform.
This Note is intended to cover the most important point about the management of database services in a Multitenant environment.
An introduction on the topic of database services can be found here.
'...A service name is a logical representation of a service used for client connections.
When a client connects to a listener, it requests a connection to a service. When a database instance starts,
it registers itself with a listener as providing one or more services by name. Thus, the listener acts as a
mediator between the client and instances and routes the connection request to the right place....'
For a Multitenant-specific introduction please check here and here.
Services are an integral part of the management for Multitenant , esp. as there is
always a service created when a PDB is created or plugged in. The PDB and the
Service always have the same name and therefore you should never create any
services manually which have the same names as a PDB you intend to plug in.
SQL*Plus: Release 12.1.0.2.0 Production on Mi Mai 13 10:20:44 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter user-name: / as sysdba
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options
SQL> select service_id, name,enabled ,pdb from cdb_services order by 1;
SERVICE_ID NAME ENA PDB
---------- ------------------------------ --- --------------------
1 SYS$BACKGROUND NO CDB$ROOT
2 SYS$USERS NO CDB$ROOT
3 o12cXDB NO CDB$ROOT
4 o12c NO CDB$ROOT
SQL> alter pluggable database pdb1 open read write;
Pluggable database altered.
SQL> select service_id, name,enabled ,pdb from cdb_services order by 1;
SERVICE_ID NAME ENA PDB
---------- ------------------------------ --- --------------------
1 SYS$BACKGROUND NO CDB$ROOT
2 SYS$USERS NO CDB$ROOT
3 o12cXDB NO CDB$ROOT
4 o12c NO CDB$ROOT
7 pdb1 NO PDB1
It is important to note that the service only becomes active when the PDB is started.
There are two ways to create a database service:
1. The DBMS_SERVICES package provides an interface to the creation and management of services.
This is also what is used to create the services for the PDB's.
To see a list of currently active services, please run as SYS in the CDB:
SQL> select service_id, name,enabled ,pdb from cdb_services order by 1;
When you need to create or delete a service, then you need to switch to the container listed under 'PDB' using:
SQL> alter session set container = <pdb name>;
and then run the required procedure of the DBMS_SERVICE package
2. There is a utility called srvctl that is mostly used in a RAC environment but it also works in a non-RAC setup.
This is described here for RAC and in Note 1260134.1 for
a stand-alone environment.
In order to see a list of the services managed by srvctl, you need to run
$ srvctl status service -db <cdb name> -v
You can use this to make sure that there are no conflicts when you plan to plug in a database.
A complete reference and examples for this can be found here.
Service Management For Multitenant (文档 ID 2009500.1)
APPLIES TO:
Oracle Database - Enterprise Edition - Version 12.1.0.1 and laterInformation in this document applies to any platform.
GOAL
This Note is intended to cover the most important point about the management of database services in a Multitenant environment.
SOLUTION
An introduction on the topic of database services can be found here.'...A service name is a logical representation of a service used for client connections.
When a client connects to a listener, it requests a connection to a service. When a database instance starts,
it registers itself with a listener as providing one or more services by name. Thus, the listener acts as a
mediator between the client and instances and routes the connection request to the right place....'
For a Multitenant-specific introduction please check here and here.
Services are an integral part of the management for Multitenant , esp. as there is
always a service created when a PDB is created or plugged in. The PDB and the
Service always have the same name and therefore you should never create any
services manually which have the same names as a PDB you intend to plug in.
SQL*Plus: Release 12.1.0.2.0 Production on Mi Mai 13 10:20:44 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter user-name: / as sysdba
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Advanced Analytics
and Real Application Testing options
SQL> select service_id, name,enabled ,pdb from cdb_services order by 1;
SERVICE_ID NAME ENA PDB
---------- ------------------------------ --- --------------------
1 SYS$BACKGROUND NO CDB$ROOT
2 SYS$USERS NO CDB$ROOT
3 o12cXDB NO CDB$ROOT
4 o12c NO CDB$ROOT
SQL> alter pluggable database pdb1 open read write;
Pluggable database altered.
SQL> select service_id, name,enabled ,pdb from cdb_services order by 1;
SERVICE_ID NAME ENA PDB
---------- ------------------------------ --- --------------------
1 SYS$BACKGROUND NO CDB$ROOT
2 SYS$USERS NO CDB$ROOT
3 o12cXDB NO CDB$ROOT
4 o12c NO CDB$ROOT
7 pdb1 NO PDB1
It is important to note that the service only becomes active when the PDB is started.
There are two ways to create a database service:
1. The DBMS_SERVICES package provides an interface to the creation and management of services.
This is also what is used to create the services for the PDB's.
To see a list of currently active services, please run as SYS in the CDB:
SQL> select service_id, name,enabled ,pdb from cdb_services order by 1;
When you need to create or delete a service, then you need to switch to the container listed under 'PDB' using:
SQL> alter session set container = <pdb name>;
and then run the required procedure of the DBMS_SERVICE package
2. There is a utility called srvctl that is mostly used in a RAC environment but it also works in a non-RAC setup.
This is described here for RAC and in Note 1260134.1 for
a stand-alone environment.
In order to see a list of the services managed by srvctl, you need to run
$ srvctl status service -db <cdb name> -v
You can use this to make sure that there are no conflicts when you plan to plug in a database.
A complete reference and examples for this can be found here.
相关文章推荐
- 【翻译自mos文章】多租户中的service管理
- [翻译自mos文章]Oracle多租户选项-12c,FAQ
- 【翻译自mos文章】在网络流量变大(比如rman duplicat 一个active database)之后,由于脑裂导致节点重启
- 【翻译自mos文章】怎么检查Oracle Advanced Security Option 是否被安装上?
- 翻译mos文章11gR2 RAC Service Not Failing Over To Other Node When Instance Is Shut Down (文档 ID 1324574.1)
- 【翻译自mos文章】当控制文件的备份丢失时,怎么restore database
- 【翻译自mos文章】shutdown normal 挂起 在ora_j00X进程上
- 【翻译自mos文章】Main Note - ogg的 Supplemental Logging and TRANDATA
- 【翻译自mos文章】控制OGG Director 中Repository Table 保留几天记录的参数
- 【翻译自mos文章】在不同操作系统下的UNIX命令
- 【从翻译mos文章】SGA_TARGET与SHMMAX关系
- 【翻译自mos文章】oracle支持在RDBMS HOME 下的 符号链接( Symbolic Links)吗?
- 【翻译自mos文章】当点击完 finish按钮后,dbca 或者dbua hang住
- 【翻译自mos文章】怎么检查服务器主板BIOS支持的最大内存大小?
- 【翻译自mos文章】注意: ASMB process exiting due to lack of ASM file activity
- 【翻译自mos文章】当 使用DCD 和TCPS时,rman duplicate hang住
- 【翻译自mos文章】DBA_JOBS 和 DBA_JOBS_RUNNING 不同的结果的解释
- 翻译mos文章rac脑裂导致节点的驱逐
- 【翻译自mos文章】为什么在备份过程中rman不使用unused block 压缩功能
- 【翻译自mos文章】怎么样kill 一个被挂起的自动物化视图刷新job?