Search notes:

Oracle: Immutable tables

create immutable table tq84_immutable_table (
   txt  varchar2(20),
   dat  date
)
no drop   until 16 days idle
no delete until 20 days after insert;
Without records, the table can be dropped:
drop table tq84_immutable_table;
Recreae the table and insert a record:
create immutable table tq84_immutable_table (
   txt  varchar2(20),
   dat  date
)
no drop   until 16 days idle
no delete until 20 days after insert;

begin
   insert into tq84_immutable_table values ('first record', sysdate);
   commit;
end;
/
The table cannot be dropped anymore, the following statement throws ORA-05723: dropping TQ84_IMMUTABLE_TABLE, which is a non-empty blockchain or immutable table, is not allowed:
drop table tq84_immutable_table;

Hidden columns

An immutable table creates the following hidden columns:
select
   internal_column_id,
   column_name,
   data_type,
   data_length,
   hidden_column
from
   user_tab_cols       
where
   table_name = 'TQ84_IMMUTABLE_TABLE'  and
   column_name not in (select column_name from user_immutable_table_columns where table_name = 'TQ84_IMMUTABLE_TABLE')
order by
   internal_column_id;

SYS.ORABCTAB_IMMUTABLE_COLS

sys.orabctab_immutable_cols is a table SQL macro.
When connected as user SYS:
select
   col.col_name,
   col.col_pos,
   col.col_id,
   col.data_type
from
   dba_objects obj, 
   sys.orabctab_immutable_cols(obj.object_id) col
where
   obj.object_name = 'TQ84_IMMUTABLE_TABLE' and
   obj.owner       = 'RENE'
;

See also

Tables
ORA-05741: invalid retention time outside the range of … and …
sys.blockchain_table$
dba_immutable_tables
dba_immutable_row_version_history
dba_immutable_row_version_cols
dba_immutable_table_columns;
dbms_immutable_table

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758193860, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/objects/tables/immutable/index(134): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78