时间:2021-07-01 10:21:17 帮助过:4人阅读
SQL> show parameter pdb_file_name_convert; #设置初始化参数
SQL> alter system set db_create_file_dest=‘/home/oracle/u01/app/oracle/oradata/orcl‘;
SQL> alter session set pdb_file_name_convert=‘ORCLPDB‘,‘PDB5‘;
SQL> create pluggable database PDB5 from ORCLPDB;
报错:ORA-65005: 文件缺少文件名模式或其文件名模式无效,未设置DB_CREATE_FILE_DEST参数
b)使用file_name_convert创建
SQL> create pluggable database PDB4 from ORCLPDB file_name_convert=(
‘/home/oracle/u01/app/oracle/oradata/orcl/orclpdb‘,‘/home/oracle/u01/app/oracle/oradata/orcl/pdb4‘);
SQL> alter pluggable database pdb4 open;
3. 克隆异地PDB
源端
SQL> create user c##sonny identified by sonny container=all;
SQL> grant dba to c##sonny container=all;
目标端
create database link clonepdb connect to c##sonny identified by sonny using ‘(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.208)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ORCLPDB)))‘;
SQL> create pluggable database sonnypdb from ORCLPDB@clonepdb;
$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql脚本
二、删除PDB
PDB需要处于MOUNTED状态才可以删除
SQL> alter pluggable database pdb5 close immediate;
SQL> drop pluggable database pdb5 including datafiles;
SQL> show pdbs;
至此PDB的创建与删除就完成了,下面为PDB的开启与关闭操作:
SQL>alter pluggable database orclpdb open; #启动单个PDB
SQL>alter pluggable database all open; #启动所有PDB
SQL>alter pluggable database orclpdb close immediate; #关闭单个PDB
SQL>alter pluggable database all close immediate; #关闭所有PDB
自动启动所有PDB
数据库启动的时候所有的PDB的状态为MOUNTED,以下设置自动启动(CDB级别操作):
create or replace trigger sys.pdb_startup
after startup on database
begin
execute immediate ‘alter pluggable database all open‘;
end pdb_startup;
/
克隆pdb文章
https://www.cnblogs.com/andy6/p/6867240.html
切换shared undo/local undo文章
https://blog.csdn.net/zhang123456456/article/details/71374528
Oracle12c创建及删除PDB
标签:打开 parameter bsp 归档 cat media use pdb tail