No Archive Mode <-> Archive Mode

来源:互联网 发布:java反复执行一个任务 编辑:程序博客网 时间:2024/05/01 01:30



C:\Users\TianPan>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Feb 28 10:08:35 2015

Copyright (c) 1982, 2010, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> ARCHIVE LOG LIST
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     83
Current log sequence           85

SQL> select log_mode from v$database;

LOG_MODE
------------
NOARCHIVELOG

SQL> ALTER DATABASE ARCHIVELOG;
ALTER DATABASE ARCHIVELOG
*
ERROR at line 1:
ORA-01126: database must be mounted in this instance and not open in any
instance

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

启动到mount状态:
SQL> startup mount
ORACLE instance started.

Total System Global Area 1071333376 bytes
Fixed Size                  1375792 bytes
Variable Size             637534672 bytes
Database Buffers          427819008 bytes
Redo Buffers                4603904 bytes
Database mounted.
SQL> ALTER DATABASE ARCHIVELOG;

Database altered.

SQL> ARCHIVE LOG LIST
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     84
Next log sequence to archive   86
Current log sequence           86

SQL> ALTER  DATABASE  OPEN;

Database altered.

SQL> SELECT LOG_MODE FROM V$DATABASE;

LOG_MODE
------------
ARCHIVELOG

SQL>

类似的,反向操作(归档模式->非归档模式)的命令是类似的,在mount状态下执行:
ALTER DATABASE NOARCHIVELOG;





0 0
原创粉丝点击