签到成功

知道了

CNDBA社区CNDBA社区

Orcle 12c 新特性---PDB Logging Clause

2017-08-14 09:16 1752 0 原创 Oracle 12C
作者: Expect-乐

 说明

The PDB LOGGING or NOLOGGING clause can be specified in a CREATE or ALTER PLUGGABLE DATABASE statement to set or modify the logging attribute of the pluggable database (PDB). This attribute is used to establish the logging attribute of tablespaces created within the PDB if the LOGGING clause was not specified in the CREATE TABLESPACE statement.

If a PDB LOGGING clause is not specified in the CREATE PLUGGABLE DATABASE statement, the logging attribute of the PDB defaults to LOGGING.http://www.cndba.cn/Expect-le/article/2102

12.1.0.2开始,PDB支持logging子句。可以通过CREATE或者ALTER PLUGGABLE DATABASE语句来设置或修改PDBlogging属性。如果CREATE TABLESPACE没有执行logging属性,那么会继承所在的PDBlogging属性。如果在创建PDB时,没有指定logging子句,那么默认为LOGGING。这个新特性提高了PDB的管理性。

http://www.cndba.cn/Expect-le/article/2102

LOGGING:控制DML操作是否记录到redo日志文件中。

实验

2.1   查看当前PDB LOGGING属性

SQL> col name for a20
SQL> select LOGGING,t.NAME from dba_pdbs s,v$pdbs t
where s.CON_ID=t.CON_ID;
LOGGING    NAME
------------------ --------------------
LOGGING    PDB$SEED
LOGGING    LEI1
LOGGING    LEI2

http://www.cndba.cn/Expect-le/article/2102

2.2   修改PDB

注意:PDB要以restrict模式打开。否则报错:ORA-65045: pluggable database not in a restricted mode

http://www.cndba.cn/Expect-le/article/2102

SQL> shutdown immediate;
Pluggable Database closed.

SQL> startup restrict;
Pluggable Database opened.

SQL> alter pluggable database lei1 NOLOGGING;
Pluggable database altered.

SQL> show pdbs;
    CON_ID CON_NAME	OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
 3 LEI1   READ WRITE YES

SQL> select LOGGING,t.NAME from dba_pdbs s,v$pdbs t
where s.CON_ID=t.CON_ID;  2  
LOGGING    NAME
------------------ --------------------
NOLOGGING	   LEI1

已经修改成功,重启启动PDB,正常方式打开PDB

2.3   创建PDB-NOLOGGING

--创建用于存储PDB数据文件的目录

[oracle@db12CR2 ~]$ mkdir -p /u01/app/oracle/oradata/orcl/sihong

http://www.cndba.cn/Expect-le/article/2102http://www.cndba.cn/Expect-le/article/2102

--通过种子库(PDBSEED)来创建PDB

NOLOGGING创建PDB,因为默认是LOGGING

SQL> create pluggable database sihong admin user cndba identified by cndba
file_name_convert=('/u01/app/oracle/oradata/orcl/pdbseed/','/u01/app/oracle/oradata/orcl/sihong/') NOLOGGING;  2  
Pluggable database created.

http://www.cndba.cn/Expect-le/article/2102

http://www.cndba.cn/Expect-le/article/2102

--查看新建PDBLOGGING属性

http://www.cndba.cn/Expect-le/article/2102

SQL> COL NAME FOR a20
select LOGGING,t.NAME from dba_pdbs s,v$pdbs t
where s.CON_ID=t.CON_ID;
LOGGING    NAME
------------------ --------------------
LOGGING    PDB$SEED
NOLOGGING	   LEI1
LOGGING    LEI2
NOLOGGING SIHONG

http://www.cndba.cn/Expect-le/article/2102

版权声明:本文为博主原创文章,未经博主允许不得转载。

PDB Logging

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
Expect-乐

Expect-乐

关注

Without the continuous bitter cold, there can be no fragrant plum blossom

  • 336
    原创
  • 6
    翻译
  • 100
    转载
  • 41
    评论
  • 访问:1376003次
  • 积分:1957
  • 等级:核心会员
  • 排名:第3名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ