[Oracle] - Connect to a PDB of Oracle12c
Story about CDB and PDB
Oracle12c has a new feature and definition of CDB and PDB. If you first use 12c you will get confused like me. So that is necessary to know some basic definitions before you start. Oracle's official document is always the best material.
What is CBD and PDB and why introduce them?
Login a CBD
[oracle@ol65 ~]$ <strong>sqlplus /nolog</strong> SQL*Plus: Release 12.1.0.2.0 Production on Mon Oct 27 23:07:56 2014 Copyright (c) 1982, 2014, Oracle. All rights reserved. SQL> conn sys@orcl as sysdba
Enter password:
Connected.
SQL> sho con_name CON_NAME
------------------------------
CDB$ROOT
SQL>
** sho con_name - show current container name. Root container is always called CDB#ROOT.
How many PDBs in your root container now?
SQL> sho pdbs CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBORCL MOUNTED
SQL>
** PDB$SEED is a seed PDB, as its name Oracle12c will take is
Default status of a new PDB is mounted. It's not running, you have to 'open' it before you start using it.
Open a PDB
SQL> alter pluggable database PDBORCL open; Pluggable database altered. SQL> sho pdbs CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBORCL READ WRITE NO
SQL>
Login a PDB
SQL> sho con_name CON_NAME
------------------------------
CDB$ROOT
SQL> alter session set container=PDBORCL; Session altered. SQL> sho con_name CON_NAME
------------------------------
PDBORCL
SQL>
Now you login a PDB. Now you can create a new user as you operate a Oracle DB before 12c. This user is not common user. It's a user for this PDB. You also can understand PDB as a general DB of the version before 12c.
Login Root Container again and Stop a PDB
SQL> conn sys as sysdba
Enter password:
Connected.
SQL> alter pluggable database PDBORCL close immediate; Pluggable database altered. SQL>
Register a Entry of a PDB
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.localdomain)
)
) PDBORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = pdborcl.localdomain)
)
)
[oracle@ol65 admin]$ sqlplus sys@pdborcl as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Tue Oct 28 00:08:52 2014 Copyright (c) 1982, 2014, Oracle. All rights reserved. Enter password: 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>
And the most importance is that now you are able to remotely connect this PDB!
[Oracle] - Connect to a PDB of Oracle12c的更多相关文章
- Oracle “CONNECT BY” 使用 [转]
Oracle “CONNECT BY”是层次查询子句,一般用于树状或者层次结果集的查询.其语法是: 1 [ START WITH condition ]2 CONNECT BY [ NOCYCLE ] ...
- Oracle “CONNECT BY” 使用
Oracle “CONNECT BY” 使用 功能说明: 语法结构如下: [ START WITH condition ] CONNECT BY [ NOCYCLE ] condition 说明: 1 ...
- Oracle下载与Oracle安装图解(Oracle19c,Oracle18c,Oracle12c,Oracle11g)
Oracle下载与Oracle安装图解(Oracle19c,Oracle18c,Oracle12c,Oracle11g) 1.Oracle下载(Oracle11g) oracle下载方法,请根据以下步 ...
- Oracle “CONNECT BY” (层级递归查询)
Oracle “CONNECT BY”是层次查询子句,一般用于树状或者层次结果集的查询.其语法是: ? 1 2 [ START WITH condition ] CONNECT BY [ NOCYCL ...
- Oracle “CONNECT BY” 用法
Oracle “CONNECT BY”是层次查询子句,一般用于树状或者层次结果集的查询.其语法是: [ START WITH condition ] CONNECT BY [ NOCYCLE ] co ...
- Oracle 12C CDB、PDB常用管理命令
Oracle 12C CDB.PDB常用管理命令 --查看PDB信息(在CDB模式下) show pdbs --查看所有pdbselect name,open_mode from v$pdbs; ...
- 转 Oracle 12C 之 CDB/PDB用户的创建与对象管理
在Oracle 12C中,账号分为两种,一种是公用账号,一种是本地账号(亦可理解为私有账号).共有账号是指在CDB下创建,并在全部PDB中生效的账号,另一种是在PDB中创建的账号. 针对这两种账号的测 ...
- Oracle 12c 如何在 PDB 中添加 SCOTT 模式(手工方式)
Oracle 12c 建库后,没有 scott 模式,本篇使用手工脚本方式,在12c版本中创建 scott 模式及相关表. 目录 1. PDB中创建用户 2. PDB中用户授权 3. PDB中创建表空 ...
- Oracle 12c 如何在 PDB 中添加 SCOTT 模式(数据泵方式)
Oracle 12c 建库后,没有 scott 模式,本篇使用数据泵方式,在12c版本之前数据库中 expdp 导出 scott 模式,并连接 12c 的 pdb 进行 impdp 导入. 目录 1. ...
随机推荐
- 给统计人讲Python(1)_科学计算库-Numpy
本地代码是.ipynb格式的转换到博客上很麻烦,这里展示部分代码,了解更多可以查看我的git-hub:https://github.com/Yangami/Python-for-Statisticia ...
- Map初始化
转载至:http://blog.csdn.net/dujianxiong/article/details/54849079 第一种方法:static块初始化 public class Demo{ pr ...
- [] == ![]为什么是true
我们先来考虑这个问题,console.log([] == false)会打印什么呢? 答案是true.为什么呢? 首先,因为当"=="号两边其中一个是布尔值的话,先把它转换为数字( ...
- JUC集合-BlockingQueue
BlockingQueue 阻塞队列,支持两个附加操作. 1,在队列为空时,获取元素的线程会等待对列变为非空. 2,在队列为满时,存储元素的线程会等待对列可用. 使用场景: 生产者往对列里添加元素 消 ...
- Android ToolBar标题文字居中的方法
在项目的开发中,使用苹果手机的产品,出的界面效果图极有可能(我这里是一定)完全是按照苹果的界面风格来出的,例如界面顶部的title文字位置是水平居中 如图: 那么问题来了,当我们使用ToolBar控件 ...
- Fragment_动态加载
1.新建Fragment的XML布局文件. 2.在activity.xml中添加需要加载Fragment.列如: <?xml version="1.0" encoding=& ...
- SQL Server将数据导出到SQL脚本文件
http://www.studyofnet.com/news/list-8883.2-1-4.html 一.SQL Server 2008将数据导出到SQL脚本文件 1.打开SQL Server200 ...
- Java代码运用及算法思路养成——用*号输出形状
简单的了解了一些循环算法后,尝试用循环算法,输出形状图形 例1矩形与平行四边形的比较(可以看做矩形的每一行在输出前都输出了矩形长度数量-1的空格数量并且依次递减) 例2三角形(三角形可看做半个矩形,考 ...
- offset() 方法 文档偏移量
以前看视频学习听到这个offset()感觉很陌生,没有用过,马上记到笔记里了,今天翻起笔记再次看到,都已经忘记是怎么用的了,所以来到这里狠狠的记下来: offset() 方法返回得或设置元素相对于文档 ...
- 理解Faster-RCNN 中的Anchor
先上图看一下Faster R-CNN操作流程: 图片说明:Faster R-CNN=Fast R-CNN+RPN,其中Fast R-CNN结构不变:RPN负责生成proposals,配合最后一层的f ...