Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3494669
  • 博文数量: 738
  • 博客积分: 1860
  • 博客等级: 上尉
  • 技术积分: 7745
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-07 08:51
个人简介

偶尔有空上来看看

文章分类

全部博文(738)

文章存档

2023年(75)

2022年(134)

2021年(238)

2020年(115)

2019年(11)

2018年(9)

2017年(9)

2016年(17)

2015年(7)

2014年(4)

2013年(1)

2012年(11)

2011年(27)

2010年(35)

2009年(11)

2008年(11)

最近访客

分类: Oracle

2021-01-27 10:36:23

看当前的
SQL> show pdbs

    CON_ID CON_NAME           OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           MOUNTED
         4 PDB2                           MOUNTED
SQL> !free -m
              total        used        free      shared  buff/cache   available
Mem:           4372         927         222        2649        3222         566
Swap:          6143         144        5999

SQL> create pluggable database PDBESB
  2  admin user adm identified by pwd
  3  file_name_convert=('pdbseed','pdbesb');

Pluggable database created.

SQL> show pdbs

    CON_ID CON_NAME          OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           MOUNTED
         4 PDB2                           MOUNTED
         5 PDBESB                         MOUNTED



从本地克隆
create pluggable database PDB2 from PDB1

file_name_convert=('pdb1','pdb2')

parallel 8;

创建完毕后新pdb是mount状态,需要open一下
alter pluggable database pdb2 open;

通过Database Link从远程克隆

create pluggable database PDB1 from PDB1@dblink_to_cdb1 file_name_convert=('CDB1','CDB2');


创建快照pdb
alter system set clonedb=true scope=spfile;
startup force
alter pluggable database pdb1 open read only;
create pluggable database pdbsnap1 from pdb1 snapshot copy file_name_convert('pdb1','pdbsnap');
alter pluggable database pdbsnap open;
--记得把pdb1设置为read write状态

删除旧的pdb
alter pluggable database pdb1 close;
drop pluggable database pdb1 including datafiles;

pdb改名
conn / as sysdba
sho pdbs
alter pluggable database &1 close immediate;
alter pluggable database &1 open restricted;
alter pluggable database &1 rename global_name to &2;
alter pluggable database &2 close immediate;
alter pluggable database &2 open;
sho pdbs
建议将上述脚本存为 renpdb.sql ,执行时:
SQL> @renpdb pdb1 pdbnew
阅读(5582) | 评论(0) | 转发(0) |
0

上一篇:JDBC对照表

下一篇:expdp 分区表很慢

给主人留下些什么吧!~~