Skip to content
Home » How to Resolve ORA-00372: file cannot be modified at this time

How to Resolve ORA-00372: file cannot be modified at this time

ORA-00372

Tried to update a table, but it failed with ORA-00372 and ORA-01110.

SQL> show user
USER is "HR"
SQL> update employees set first_name = 'Ed' where last_name = 'Chen';
update employees set first_name = 'Ed' where last_name = 'Chen'
       *
ERROR at line 1:
ORA-00372: file 13 cannot be modified at this time
ORA-01110: data file 13:
'/u01/app/oracle/oradata/ORA19C1/ORCLPDB1/example01.dbf'

ORA-00372 means that the data file you want to modified cannot be done in this moment, because the tablespace of the data file is READ ONLY.

Let's see what we found.

SQL> show user
USER is "SYS"
SQL> select tablespace_name, status from dba_tablespaces where tablespace_name = (select name from v$tablespace where ts# = (select ts# from v$datafile where file# = 13));

TABLESPACE_NAME                STATUS
------------------------------ ---------
EXAMPLE                        READ ONLY

Solution

To overcome ORA-00372, you should make the tablespace writable (READ WRITE).

SQL> alter tablespace example read write;

Tablespace altered.

Let's check the status of the tablespace again.

SQL> select tablespace_name, status from dba_tablespaces where tablespace_name = (select name from v$tablespace where ts# = (select ts# from v$datafile where file# = 13));

TABLESPACE_NAME                STATUS
------------------------------ ---------
EXAMPLE                        ONLINE

Now, notify the user to try it again.

SQL> update employees set first_name = 'Ed' where last_name = 'Chen';

1 row updated.

We're good.

Leave a Reply

Your email address will not be published. Required fields are marked *