返回顶部
首页 > 资讯 > 数据库 >12c通过service 连接pdb
  • 681
分享到

12c通过service 连接pdb

2024-04-02 19:04:59 681人浏览 泡泡鱼
摘要

<roidb01:cdb1:/home/oracle>$lsnrctl service LSNRCTL for linux: Version 12.1.0.2.0 - Production


<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/oracle@roidb01: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.
您可能感兴趣的文档:

--结束END--

本文标题: 12c通过service 连接pdb

本文链接: https://lsjlt.com/news/41393.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
  • 12c通过service 连接pdb
    <roidb01:cdb1:/home/oracle>$lsnrctl service LSNRCTL for Linux: Version 12.1.0.2.0 - Production ...
    99+
    2024-04-02
  • CDB与PDB的连接
    1.连接sqlplus system/xxxxx@10.8.5.206:1521/pdbtestALTER SESSION SET CONTAINER = PDB$SEED;2.再CDB中切换连接C:\Us...
    99+
    2024-04-02
  • oracle 12c PDB随CDB启动以及链接PDB的方式是什么
    今天就跟大家聊聊有关oracle 12c PDB随CDB启动以及链接PDB的方式是什么,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。本来不知道有这个...
    99+
    2024-04-02
  • Python3 通过 kombu 连接
    【RabbitMQ 服务器】# 在 vhosttest 里面有 exchangetest 和 queuetest 通过 rkeytest 绑定 Broker: 192.168.0.xx virtual host: vhosttest Exc...
    99+
    2023-01-31
    kombu
  • PLSQL通过Oracle 11g客户端连接Oracle 12c服务器错误 ORA-28040
    PLSQL通过Oracle 11g客户端连接Oracle 12c服务器错误 ORA-28040 环境描述: oracle服务器端版本:oracle 12.2.0.1.0 oracle客户端版本:oracle...
    99+
    2024-04-02
  • oracle通过DBlink连接oracle
    1.1赋权(将crh_snp用户赋权具体创建dblink权限) 在sys用户下,把CREATE PUBLIC DATABASE LINK,DROP PUBLIC DATABASE LINK权限授予给...
    99+
    2024-04-02
  • Python3 通过 pika 连接 R
    【RabbitMQ 服务器】# 在 vhosttest 里面有 exchangetest 和 queuetest 通过 rkeytest 绑定 Broker: 192.168.0.xx virtual host: vhosttest Exc...
    99+
    2023-01-31
    pika
  • 通过 plsql 连接远程 Oracle
    方法一:通过 plsql 工具和 oracle client(不是即时客户端 instantclient) 的方式来连接 Oracle 一、 安装 oracle client,(本教程已经下载并解压) 二、 选 择 管 理 员 ...
    99+
    2016-10-20
    通过 plsql 连接远程 Oracle
  • 怎么通过git连接cpu
    在程序开发的过程中,使用版本控制系统可以方便地管理代码的变更和团队协作。而Git作为一款流行的分布式版本控制系统,被广泛地使用。但是,有时候我们需要将Git与本地的CPU连接起来,以便于实现一些特定的功能。下面将介绍如何通过Git连接CPU...
    99+
    2023-10-22
  • c++通过ADO连接数据库
    c++通过ADO连接数据库,具体要求步骤如下:1、要导入连接ADO库文件信息,方法#import "C:\Program Files\Common Files\System\a...
    99+
    2024-04-02
  • 连接12cR2 PDB报错ORA-28040/ORA-01017
    测试环境安装了一套12cR2的数据库,想要通过PL/SQL developer连接上数据库,但是报错ORA-28040: No matching authentication protocol上网查了原因:...
    99+
    2024-04-02
  • 12C EM express https 连接报错
    12C EM express https 连接报错数据库安装的时候建议把EM安装上,方便以后管理。SQL> show parameter dispatchersNAME   &nb...
    99+
    2024-04-02
  • 通过OCILIB连接oracle执行存储过程
    #include <iostream> #include "ocilib.hpp" using namespace std; using nam...
    99+
    2024-04-02
  • 如何在 12.2.0.1 通过 dblink 在线拷贝 PDB
    参考,如何在 12.2.0.1 通过 dblink 在线拷贝  PDB (文档 ID 24726-43.1) 对于数据量小的库而言,这个功能简单,操作方便,可以一试。 ...
    99+
    2024-04-02
  • ftp通过SSH远程连接到Linux
    先在linux中安装ssh,以centos为例 传送门:https:UlXpCA//www.jb51.net/article/232569.htm 下载ftp软件https://www.jb51.net/soft...
    99+
    2022-06-04
    ftp远程连接Linux 远程连接Linux
  • Oracle 无法通过IP连接问题
    1.安装目录:D:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN2.listener.ora(里面的localhost或127.0.0.1改...
    99+
    2024-04-02
  • Oracle通过dblink连接GBase 8a MPP Cluster
    Oracle 通过 dblink 连接 GBase 8a MPP Cluster 源端: Oracle 版本: Oracle 11.2.0.3.0    OS 版本...
    99+
    2024-04-02
  • sqlserverdriver中怎么通过 jdbc连接sqlserver
    这篇文章将为大家详细讲解有关sqlserverdriver中怎么通过 jdbc连接sqlserver,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。一、下载驱...
    99+
    2024-04-02
  • mysql怎么通过局域网连接
    mysql通过局域网连接的方法可以借助Navicat管理工具来进行连接。下载并安装Navicat,打开工具。点击“新建”,选择“新建连接”。输入连接名、ip地址、端口号、用户名及密码即可。...
    99+
    2024-04-02
  • 如何通过crt远程连接ubuntu
    通过crt远程连接ubuntu的方法:打开终端依次执行以下命令:sudo apt-get install openssh-clientsudo apt-get install openssh-server启动ssh服务。sudo /etc/...
    99+
    2024-04-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作