Bo's Oracle Station

【博客文章2022】真实环境下创建pdb、在两个cdb之间迁移pdb和创建proxy pdb的操作汇总系列1

2022-2-23 16:36| 发布者: admin| 查看: 133| 评论: 0|原作者: Bo Tang

摘要: 真实环境下创建pdb、在两个cdb之间迁移pdb以及创建proxy pdb的操作汇总系列1
真实环境下创建pdb、在两个cdb之间迁移pdb和创建proxy pdb的操作汇总系列1

Author: Bo Tang

1. 两个CDB实验环境介绍(符合OU教材的知识点):

    使用SQL命令的方式创建cdb1,使其成为一个空的container database,处于非归档状态:
    1) 创建了/u01/app/oracle/admin/cdb1/adump目录;创建了口令文件orapwd  file=orapwcdb1  password=cloud_4U;编辑了/u01/app/oracle/product/19.3.0/dbhome_1/dbs/initcdb1.ora如下:

control_files            = '+DATA','+FRA'
audit_file_dest          = '/u01/app/oracle/admin/cdb1/adump'
db_name                  = "cdb1"
remote_login_passwordfile= "EXCLUSIVE"
processes                = 300
memory_target               = 4G
db_block_size            = 8192
compatible               = "19.0.0"
undo_tablespace          = "UNDOTBS1"
audit_trail              = "OS"
open_cursors             = 300
db_recovery_file_dest = '+FRA'
db_recovery_file_dest_size=35G
db_create_file_dest='+DATA'
enable_pluggable_database = true


    2)create database 的脚本:

CREATE DATABASE cdb1
USER SYS IDENTIFIED BY "cloud_4U" USER SYSTEM IDENTIFIED BY "cloud_4U"
logfile group 1 ('+data','+fra') size 500M,
        group 2 ('+data','+fra') size 500M,
        group 3 ('+data','+fra') size 500M
CHARACTER SET AL32UTF8 NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL datafile size 800M AUTOEXTEND ON NEXT  10240K MAXSIZE UNLIMITED
sysaux datafile size 700M AUTOEXTEND ON NEXT  10240K MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE temp
UNDO TABLESPACE undotbs1
DEFAULT TABLESPACE users
ENABLE PLUGGABLE DATABASE local undo on;


    3)运行完create database脚本之后,执行了/u01/app/oracle/product/19.3.0/dbhome_1/rdbms/admin/catcdb.sql创建数据字典,执行过程略。


    使用dbca以模版建库的方式创建cdb2,使其成为一个空的container database,处于非归档状态:
    

  











    Step 11of 15的密码设置为:cloud_4U:







2. 在cdb1中从pdb$seed创建pdb1_1(符合OU教材的知识点):

 create pluggable database pdb1_1  admin user pdb1_1_admin identified by clould_4U roles=(connect);


    所创建的pdb1_1是有临时表空间的:


select f.con_id, t.name, f.name from
 v$tempfile f, v$tablespace t
 where f.con_id=t.con_id and f.ts#=t.ts#
 order by f.con_id;
------------------------------------------------------------------------------------------------------------------------------------------
1    TEMP    +DATA/CDB1/TEMPFILE/temp.283.1097854527
2    TEMP    +DATA/CDB1/D9101563218F95ABE0535501A8C0D887/TEMPFILE/temp.284.1097854527
3    TEMP    +DATA/CDB1/D9101563222B95ABE0535501A8C0D887/TEMPFILE/temp.265.1097859527







路过

雷人

握手

鲜花

鸡蛋

QQ|手机版|Bo's Oracle Station   

GMT+8, 2022-3-22 11:42 , Processed in 0.041471 second(s), 21 queries .

返回顶部