• 番外:克隆本地PDB中其他参数和子句的说明


    基于版本:19c (12.2.0.3) AskScuti

    创建方法:克隆本地PDB(从本地其他PDB创建新的PDB)

    对应路径:Creating a PDB --> Cloning --> Locally

    具体请参考《在多租户(容器)数据库中如何创建PDB:方法2

    1. 内容总览

    2. 设置 PDB_FILE_NAME_CONVERT

    3. 使用 FILE_NAME_CONVERT 本地克隆

    4. 使用 CREATE_FILE_DEST 本地克隆

    1. 内容总览

    接--克隆本地PDB一文中的其他参数设置。

    2. 设置 PDB_FILE_NAME_CONVERT

    SQL> !mkdir /u01/app/oracle/oradata/CDB1/pdb3
    
    SQL> show parameter pdb_file
    
    SQL> alter system set pdb_file_name_convert='/u01/app/oracle/oradata/CDB1/pdb1','/u01/app/oracle/oradata/CDB1/pdb3';
    
    System altered.

    创建PDB3

    SQL> alter pluggable database pdb1 close;
    
    Pluggable database altered.
    
    SQL> alter pluggable database pdb1 open read only;
    
    Pluggable database altered.
    
    SQL> create pluggable database pdb3 from pdb1;
    
    Pluggable database created.
    
    SQL> show pdbs
    
        CON_ID CON_NAME  OPEN MODE  RESTRICTED
    ---------- --------- ---------- ----------
         2 PDB$SEED      READ ONLY  NO
         3 PDB1          READ ONLY  NO
         4 PDB2          READ WRITE NO
         5 PDB3          MOUNTED

    开启PDB3

    SQL> alter pluggable database pdb3 open;
    
    Pluggable database altered.

    3. 使用 FILE_NAME_CONVERT 本地克隆

    使用 FILE_NAME_CONVERT 子句创建

    SQL> !mkdir /u01/app/oracle/oradata/CDB1/pdb4
    
    SQL> create pluggable database pdb4 from pdb1 file_name_convert=('/u01/app/oracle/oradata/CDB1/pdb1','/u01/app/oracle/oradata/CDB1/pdb4');
    
    Pluggable database created.

    注意:被克隆的PDB1要处于只读状态。

    SQL> alter pluggable database pdb4 open;
    
    Pluggable database altered.
    
    SQL> show pdbs
    
        CON_ID CON_NAME  OPEN MODE  RESTRICTED
    ---------- --------- ---------- ----------
         2 PDB$SEED      READ ONLY  NO
         3 PDB1          READ ONLY  NO
         4 PDB2          READ WRITE NO
         5 PDB3          READ WRITE NO
         6 PDB4          READ WRITE NO

    4. 使用 CREATE_FILE_DEST 本地克隆

    使用 CREATE_FILE_DEST 子句创建

    SQL> !mkdir /u01/app/oracle/oradata/CDB1/pdb5
    
    SQL> create pluggable database pdb5 from pdb1 create_file_dest='/u01/app/oracle/oradata/CDB1/pdb5';
    
    Pluggable database created.

    注意:被克隆的PDB1要处于只读状态。

    SQL> alter pluggable database pdb5 open;
    
    Pluggable database altered.
    
    SQL> show pdbs
    
        CON_ID CON_NAME  OPEN MODE  RESTRICTED
    ---------- --------- ---------- ----------
         2 PDB$SEED      READ ONLY  NO
         3 PDB1          READ ONLY  NO
         4 PDB2          READ WRITE NO
         5 PDB3          READ WRITE NO
         6 PDB4          READ WRITE NO
         7 PDB5          READ WRITE NO
  • 相关阅读:
    云谷分布式端口扫描与代理验证系统(一)简介
    Linux 共享库:LD_LIBRARY_PATH 与ld.so.conf_爱过了就好_新浪博客
    分享:QT QJson库编译心得
    分享:Zed Attack Proxy 2.0 发布,Web 渗透测试
    LIBTOOL is undefined 解决方法
    linux下.a/.so/.la目标库区别
    LDAmath文本建模
    分享:SchemaCrawler 9.4 发布,数据库结构输出
    JQ也要面向对象~在JQ中扩展静态方法和实例方法
    将不确定变为确定~Flag特性的枚举是否可以得到Description信息
  • 原文地址:https://www.cnblogs.com/askscuti/p/11338580.html
Copyright © 2020-2023  润新知