12c通过service 连接pdb


<roidb01:cdb1:/home/oracle>$lsnrctl service

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 06-MAR-2018 06:52:45

Copyright (c) 1991, 2014, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl)(PORT=1521)))
Services Summary...
Service "cdb1" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "cdb1XDB" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: roidb01, pid: 2787>
(ADDRESS=(PROTOCOL=tcp)(HOST=roidb01)(PORT=17408))
Service "pdb11" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully
<roidb01:cdb1:/home/oracle>$

SQL> set line 120
SQL> select name,network_name,pdb from v$services;

NAME NETWORK_NAME PDB
------------------------------ ------------------------------ ------------------------------
sales sales1 PDB11
pdb11 pdb11 PDB11
cdb1XDB cdb1XDB CDB$ROOT
cdb1 cdb1 CDB$ROOT
SYS$BACKGROUND CDB$ROOT
SYS$USERS CDB$ROOT

6 rows selected.

SQL>

SQL> alter session set container=pdb11;

Session altered.

SQL> select name,network_name,pdb from v$services;

NAME NETWORK_NAME PDB
------------------------------ ------------------------------ ------------------------------
sales sales1 PDB11 ##手动创建的服务
pdb11 pdb11 PDB11

SQL> exec dbms_service.start_service(‘sales‘); ##启动服务

PL/SQL procedure successfully completed.

SQL>

<roidb01:cdb1:/u01/app/oracle/product/12.1.0/dbhome_1/network/admin>$lsnrctl service;

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 06-MAR-2018 06:58:04

Copyright (c) 1991, 2014, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=orcl)(PORT=1521)))
Services Summary...
Service "cdb1" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "cdb1XDB" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: roidb01, pid: 2787>
(ADDRESS=(PROTOCOL=tcp)(HOST=roidb01)(PORT=17408))
Service "pdb11" has 1 instance(s).
Instance "cdb1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "sales1" has 1 instance(s). ##服务已经通过pmon注册
Instance "cdb1", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
The command completed successfully
<roidb01:cdb1:/u01/app/oracle/product/12.1.0/dbhome_1/network/admin>$

<roidb01:cdb1:/u01/app/oracle/product/12.1.0/dbhome_1/network/admin>$sqlplus sys/[email protected]:1521/sales1 as sysdba ##通过服务名连接pdb

SQL*Plus: Release 12.1.0.2.0 Production on Tue Mar 6 06:58:39 2018

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
3 PDB11 READ WRITE NO
SQL>

##创建、启动、关闭服务的相关命令,重启后服务丢失,大家可以自己测试
SQL> exec dbms_service.start_service(‘sales‘);

PL/SQL procedure successfully completed.

SQL>
SQL> exec dbms_service.stop_service(‘sales‘);

PL/SQL procedure successfully completed.

SQL> exec dbms_service.delete_service(‘sales‘);

PL/SQL procedure successfully completed.

SQL> exec dbms_service.create_service(‘sales‘,‘sales1‘);

PL/SQL procedure successfully completed.

原文地址:http://blog.51cto.com/roidba/2083260

时间: 2024-10-15 21:39:14

12c通过service 连接pdb的相关文章

Oracle 12C 创建用户连接pdb

测试环境: C:\ora12c\product\12.1.0\dbhome_1\BIN>sqlplus.exe /nolog SQL*Plus: Release 12.1.0.1.0 Production on 星期二 9月 20 03:50:23 2016 Copyright (c) 1982, 2013, Oracle. All rights reserved. SQL> conn /as sysdba 已连接. SQL> show pdbs; CON_ID CON_NAME OPE

Oracle 12c JDBC方式连接PDB数据库

1.配置监听 这里假定CDB数据库名为ORCL,PDB在CDB下面名称为PDBORCLlistener.ora添加(#后面为注释,不要添加进去) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = ORCL) (SID_NAME = ORCL) #这里是SID名 ) (SID_DESC = (GLOBAL_DBNAME = PDBORCL)#这里是PDB数据库名 (SID_NAME = ORCL) #这里是SID名 ) ) t

oracle 12c连接pdb

12c中,如何连接pluggable database: 使用默认的service连接pdb,创建pdb之后,在监听中自动添加已pdb为名的service: 用户在cluster中创建service,用户使用srvctl命令创建一个service并且关系到pdb上: 使用命令alter session set container=pdb: 使用Enterprise Manager Express.  1. 使用默认service连接pdb: 当创建pdb之后,使用lsnrctl status命令

12C 启用客户端通过SID 连接PDB,防止ORA-12545

12C 通过SID 连接PDB 报ora-12545 通过在监听listener.ora 加上配置: USE_SID_AS_SERVICE_listener name=ON 在重新配置TNS: 测试连接: 参考文档:文档 ID 1644355.1 APPLIES TO:Oracle Net Services - Version 12.1.0.1 and later Information in this document applies to any platform. SYMPTOMS Cli

12c连接pdb的两种方法

连接可插拔数据库的两种方法 <roidb01:cdb:/home/oracle>$sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 20 17:59:56 2018 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1

oracle 12c jdbc连接pdb报错的问题

有同学发来消息说,oracle数据库使用jdbc连接会后报ora-12505错误. 下意识地回复说查看jdbc连接串中的数据库sid/服务名是否写错了. 对方反馈说没错.然后让他以下面的方式连接是可以正常连接的: sqlplus scott/[email protected]:1521/pdborcl 然后让他把jdbc的格式改成如下所示后连接成功! Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhos

Oracle 12C -- clone a remote pdb

Connect to the remote CDB and prepare the remote PDB for cloning. SQL> select con_id,dbid,name,open_mode from v$pdbs; CON_ID DBID NAME OPEN_MODE ---------- ---------- ------------------------------ ---------- 2 1258043702 PDB$SEED READ ONLY 3 3749525

跟我学Windows Azure 五 使用Cloub Service连接Blob Service完成图片的上传

首先,我们创建一个云服务项目,用来演示我们的blob存储 下来我们修改我们我们云服务的名字 我们需要添加一个空的WebForm的项目 点击完成,我们可以看到我们的解决方案已经添加完成 下来我们需要添加一个实体类,用来存储文件的信息. 下面是我们实体类的 using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace BlobWebRole { public class I

sql server anaylsis service 连接字符串的两种方式

本地连接: string strConnect = "Provider=MSOLAP; Data Source=localhost;Initial Catalog=Analysis Services Tutorial;Integrated Security=SSPI;"; 网络连接方式: string strConnect = "Provider=MSOLAP;Initial Catalog=Analysis Services Tutorial;Data Source=htt