Read Only Table Partitions

As of Oracle version 12.2, partitions or sub-partitions of a table can be marked as read-only.?It can also be specified during the table creation phase.

It can be specified with the phrase “READ ONLY”.?Its default behavior is “READ WRITE”.

To make current and future partitions in a partitioned table read-only:

SQL>ALTER TABLE my_table READ ONLY;
        

In order for only the partition named part01 in a partitioned table to be read-only:?

SQL>ALTER TABLE my_table MODIFY PARTITION part01 READ ONLY;
        

Commands can be used.

To undo the change made, "READ WRITE" can be written instead of "READ ONLY".

While creating the table, “READ ONLY” statement can be used in the partition that we want to be a read-only partition in the create table statement.

It is possible to create read only sub partitions as follows.

create table my_table
partition by list(x)
subpartition by list(y)
(  partition p1 values (0) READ ONLY
           (       subpartition p1_sp1 values (0) READ ONLY ,
                   subpartition p1_sp2 values (1) ) ,
    partition p2 values (1) READ WRITE
           (   subpartition p2_sp1 values (0) READ ONLY ,
                   subpartition p2_sp2 values (1) ) ,
   partition p3 values (2)
           (       subpartition p3_sp1 values (0) READ ONLY ,
                   subpartition p3_sp2 values (1) )
   )
        

With the following query, we can learn whether sub partitions in a table are read only or read write.

select table_name,partition_name,subpartition_name,read_only
from dba_tab_subpartitions
where table_name ='MY_TABLE'
order by partition_name,subpartition_name;
        

With the following query, we can learn whether partitions in a table are read only or read write.?

?select table_name,partition_name,read_only
from dba_tab_partitions
where table_name ='MY_TABLE'
order by table_name,partition_name        

要查看或添加评论,请登录

Ahmet Duru?z的更多文章

  • Exadata - Disk scrubbing

    Exadata - Disk scrubbing

    Disk scrubbing exists on Exadata cell nodes to automatically repair bad sectors of the disk when the system is idle…

  • How to determine the last modified date of tables in Oracle ?

    How to determine the last modified date of tables in Oracle ?

    For each row in a table, ORA_ROWSCN returns the SCN of the most recent change in the row. This pseudo-column can be…

  • Oracle Data Redaction

    Oracle Data Redaction

    Available with the Oracle Advanced Security license, Oracle Data Redaction allows you to mask (redact) data returned…

  • Active requests on Exadata cell node

    Active requests on Exadata cell node

    An active request represents a client- or application-centric view of I/O requests handled by the cell node. You can…

  • SQL Tuning Health-Check Script (SQLHC)

    SQL Tuning Health-Check Script (SQLHC)

    Also known as SQLHC, this tool is used to check the environment in which a single SQL statement is running, Cost-based…

  • Principle of Least Privilege for Oracle databases

    Principle of Least Privilege for Oracle databases

    An important concept in computer security, the principle of least privilege (POLP) is to limit users' access rights to…

  • Hybrid Columnar Compression

    Hybrid Columnar Compression

    Hybrid Columnar Compression (HCC) is a feature that comes with Oracle Database 11g Release 2 and can be used with…

  • Usefully My Oracle Support (MOS) documentation on Oracle Exadata Database Machine

    Usefully My Oracle Support (MOS) documentation on Oracle Exadata Database Machine

    There are MOS documents on many topics related to Exadata. You can find the most useful of these documents in the list…

社区洞察

其他会员也浏览了