After the Oracle tablespace is set to the backup mode, you can copy and back up the data files in the table space online at the file system level, because modifications to the table space are recorded in the redo log file of the database during this period.
Therefore, if the database is not in archive mode, the tablespace backup mode must not be earlier than the time when online logs are overwritten to ensure that the data modification will not be lost.
So how does Oracle determine this situation?
The experiment shows that Oracle does not allow you to enable the tablespace backup mode in non-archive mode.
The following error is reported: ORA-01123: cannot start online backup; media recovery not enabled
Experiment verification: Environment: RHEL 6.4 + Oracle 11.2.0.3
1. You can enable the tablespace backup mode in archive mode.
SQL> alter tablespace TT begin backup;Tablespace altered.SQL> host cp /home/oradata/JYZHAO/datafile/tt.dbf /tmp/SQL> alter tablespace TT end backup;Tablespace altered.SQL> !ls -lh /tmp |grep tt-rw-r-----. 1 oracle oinstall 11M Sep 17 17:06 tt.dbfSQL> archive log listDatabase log mode Archive ModeAutomatic archival EnabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 1876Next log sequence to archive 1879Current log sequence 1879
2. If the database is modified to non-archive mode, it is not allowed to enable the tablespace backup mode.
SQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> startup mountORACLE instance started.Total System Global Area 413372416 bytesFixed Size 2228904 bytesVariable Size 356519256 bytesDatabase Buffers 46137344 bytesRedo Buffers 8486912 bytesDatabase mounted.SQL> alter database noarchivelog;Database altered.SQL> archive log listDatabase log mode No Archive ModeAutomatic archival DisabledArchive destination USE_DB_RECOVERY_FILE_DESTOldest online log sequence 1876Current log sequence 1879SQL> alter database open;Database altered.SQL> alter tablespace TT begin backup;alter tablespace TT begin backup*ERROR at line 1:ORA-01123: cannot start online backup; media recovery not enabled
In non-archive mode, you cannot change the tablespace to the backup mode.