ORA-01123: cannot start online backup; media recovery not enabled

问题描述

当使用SQL进行备份操作时,出现下面的错误,提示不能启动在线备份,具体错误信息如下:
SYS@orcl _SQL>alter tablespace users begin backup;
alter tablespace users begin backup
*
ERROR at line 1:
ORA-01123: cannot start online backup; media recovery not enabled

解决办法

出现此种问题的原因是数据库处于非归档模式,不能在线进行备份,只能在数据库处于归档模式时,方可执行在线SQL备份,具体演示如下:
SYS@orcl _SQL>archive log list;
Database log mode	       No Archive Mode----->数据库处于非归档模式
Automatic archival	       Disabled
Archive destination	       USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     106
Current log sequence	       108
SYS@orcl _SQL>shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@orcl _SQL>startup mount
ORACLE instance started.

Total System Global Area  778387456 bytes
Fixed Size		    1374808 bytes
Variable Size		  520095144 bytes
Database Buffers	  251658240 bytes
Redo Buffers		    5259264 bytes
Database mounted.
SYS@orcl _SQL>alter database archivelog;---->启用数据库归档模式

Database altered.

SYS@orcl _SQL>alter database open;

Database altered.

SYS@orcl _SQL>alter tablespace users begin backup;

Tablespace altered.

SYS@orcl _SQL>host copy E:APPALEN.LIUORADATAORCLUSERS01.DBF e:USERS01.DBF
已复制         1 个文件。

SYS@orcl _SQL>alter tablespace users end backup;

Tablespace altered.

SYS@orcl _SQL>



原文地址:https://www.cnblogs.com/alen-liu-sz/p/12975710.html