[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. ...
随机推荐
- 读入图片显示scipy.misc module has no attribute imread?
>>> import scipy >>> scipy.misc <module 'scipy.misc' from 'C:\Python27\lib\site ...
- LVS十种调度算法介绍
1.轮叫调度(Round Robin)(简称rr) 轮叫调度(Round Robin Scheduling)算法就是以轮叫的方式依次将请求调度不同的服务器,即每次调度执行i = (i + 1) mod ...
- java exception 异常错误记录
//异常:Could not obtain transaction-synchronized Session for current thread 做定时器的时候用ApplicationContext ...
- 一款APP的开发设计是如何从0到1一步一步设计的
目前在行业里,关于APP界面设计规范也是层次不齐,很多都还停留在6的设备和ios 9的系统之上,而现在最新的是iphone 7和iOS 10了(更新换代真的很快),我这里说的是最新的iOS 界面设计规 ...
- Splash Screen(短时间弹出框,信息显示一次)
原文引自codeproject site, http://www.codeproject.com/Articles/6511/Transparent-Splash-Screen 1.A splash ...
- 解决启动httpd报: apr_sockaddr_info_get() failed for错误
我测试库里 service httpd start 时报 下面错误 httpd: apr_sockaddr_info_get() failed for fengxin.wzjzt.centoshttp ...
- 开启RxSwift之旅——开篇
开启RxSwift之旅——开篇 RxSwift 是 ReactiveX 在 Swift 下的实现.ReactiveX 是一个通过使用可观察序列来组合异步和基于事件的程序的库. 很多地方通常把 Reac ...
- 图片放大不失真软件PhotoZoom的工具栏
PhotoZoom是一款极其简单的图片无损放大工具,简单几即可渲染出完美的放大照片,呈现无与伦比的画质效果.虽然简单,菜单和面板的功能很少,但却是设计师的必备神器,因为其简单易用性,它的软件菜单命令和 ...
- bootstrap中container 类和container-fluid类的区别container类所谓的自适应也是通过margin的改变来完成,container-fluid类的百分百宽度是指在固有的15px的padding前提下宽度总是当前视口的宽度。
container 类和container-fluid类的区别体现在是否有随视口宽度改变的margin存在. container类所谓的自适应也是通过margin的改变来完成,container-fl ...
- Java中成员变量和局部变量区别
在类中的位置不同 重点 成员变量:类中,方法外 局部变量:方法中或者方法声明上(形式参数) 作用范围不一样 重点 成员变量:类中 局部变量:方法中 初始化值的不同 重点 成员变量:有默认值 局部变量: ...