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 3749525766 PDB1                           READ ONLY
         4 2192587015 P4                             MOUNTED
         5  255759235 PDB_TEST                       READ WRITE

Create a user in the remote database for use with the database link. In this case, we will use a local user in the remote PDB.

SQL> alter session set container=p4;
SQL> alter pluggable database p4 open;
SQL> create user remote_clone_user identified by remote_clone_user ;
SQL> grant create session,create pluggable database to remote_clone_user;

Open the remote PDB in read-only mode.

SQL> alter pluggable database p4 close;
SQL> alter pluggable database p4 open read only;

Connect to the local database to initiate the clone.

SQL> select con_id,dbid,name,open_mode from v$pdbs;

    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 3671494824 PDB$SEED                       READ ONLY

Create a database link in the local database, pointing to the remote database.

SQL> create database link clone_link connect to remote_clone_user identified by remote_clone_user using ‘p4‘;

Create a new PDB in the local database by cloning the remote PDB.

SQL> create pluggable database p4 from [email protected]_link create_file_dest=‘/u12/app/oracle/oradata/p4‘;

The PDB is opened in read-write mode to complete the process.

SQL>  select con_id,dbid,name,open_mode from v$pdbs;

    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 3671494824 PDB$SEED                       READ ONLY
         3 2880590083 P4                             MOUNTED

SQL> alter pluggable database p4 open;
SQL> select con_id,dbid,name,open_mode from v$pdbs;

    CON_ID       DBID NAME                           OPEN_MODE
---------- ---------- ------------------------------ ----------
         2 3671494824 PDB$SEED                       READ ONLY
         3 2880590083 P4                             READ WRITE

SQL> 
时间: 2024-10-17 16:06:55

Oracle 12C -- clone a remote pdb的相关文章

Oracle 12C -- clone a non-cdb as a pdb

将non-CDB置为只读模式: $ sqlplus '/as sysdba' SQL> select name, decode(cdb, 'YES', 'Multitenant Option enabled', 'Regular 12c Database: ') "Multitenant Option" , open_mode, con_id from v$database; NAME Multitenant Option OPEN_MODE CON_ID --------- -

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 用户创建、角色、权限

一.创建用户 创建用户默认的是container=all,在cdb中只能创建全局用户(c##开头),会在cdb和所有的pdb中创建该用户(但是pdb中的全局用户需要另外授权才能够在pdb中访问).在pdb中只能创建的用户为本地用户 SQL> show con_name; CON_NAME ------------------------------ CDB$ROOT SQL> create user user1 identified by user1; create user user1 id

Oracle 12c 多租户 CDB 与 PDB之 shared undo 与 Local undo 切换

undo 在12C R1版本中只支持Global Shared Undo模式, 所有container共享一个UNDO表空间, 目前保留这种模式只是为了升级过渡, 在12C R2引入了PDB Local UNDO模式,每个container都有自己的UNDO 表空间, 对于RAC是每个实例每个container都有自己的UNDO表空间, 这也正是推荐的.在DBCA时会有local undo选项,且默认勾选. local undo 模式的好处:1.减少undo表空间的争用,同时方便拔插 2.只有使

oracle 12c 学习之三 pdb 的可拔插测试

DECLARE l_result BOOLEAN; BEGIN l_result := DBMS_PDB.check_plug_compatibility( pdb_descr_file => '/u02/pdb/pdb3.xml', pdb_name => 'pdb3'); IF l_result THEN DBMS_OUTPUT.PUT_LINE('compatible'); ELSE DBMS_OUTPUT.PUT_LINE('incompatible'); END IF; END; /

ORACLE 12C PDB 维护基础介绍

CDB和PDB是ORACLE 12C一个很亮的新特性,由于他们的引入导致传统的ORACLE数据库管理理念不少发生了改变,这里列举了部分最基本的cdb和pdb管理方式 cdb和pdb关系图 ORACLE 12C版本 SQL> select * from v$version; BANNER CON_ID -------------------------------------------------------------------------------- ---------- Oracle

浅谈oracle 12C的新特性-CDB和PDB

最近看到好多人都在尝试oracle中的12C新特性-容器数据库,今年3月orcle退出了Release2版本,可以算是一个稳定版本了.下午着手尝试了一下,还是蛮不错得 1.前言 CDB与PDB是Oracle 12C引入的新特性,在ORACLE 12C数据库引入的多租用户环境(Multitenant Environment)中,允许一个数据库容器(CDB)承载多个可插拔数据库(PDB).CDB全称为ContainerDatabase,中文翻译为数据库容器,PDB全称为Pluggable Datab

Oracle 12c在SQL Devolper中添加cdb和pdb连接

Oracle 12c如果按默认流程安装的话会有一个叫orcl的cdb容器和一个叫pdborcld的pdb容器 一.连接名为orcl的cdb容器 连接名:localorcl 用户名:SYS 口令:Oracle12csys 连接类型:基本 角色:DBA 主机名:localhost 端口:1521 SID:orcl 点击测试,状态为成功即可连接 二.连接名为pdborcld的pdb容器(预先配置好了L/H这个用户) 连接名:localpdb 用户名:L 口令:H 连接类型:基本 角色:默认 主机名:l