更改Oracle数据库到归档模式


[Oracle@localhost oracle]$ sqlplus / as sysdba

SQL*Plus: Release 11.1.0.6.0 - Production on Thu Dec 3 17:10:02 2009

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


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

SQL> select log_mode from v$database;

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

SQL> alter database archivelog on;
alter database archivelog on
                          *
ERROR at line 1:
ORA-00933: SQL command not properly ended


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.
SQL> startup mount
ORACLE instance started.

Total System Global Area 389189632 bytes
Fixed Size                  1300128 bytes
Variable Size             276826464 bytes
Database Buffers          104857600 bytes
Redo Buffers                6205440 bytes
Database mounted.
SQL> alter database archivelog on;
alter database archivelog on
                          *
ERROR at line 1:
ORA-00933: SQL command not properly ended


SQL> alter database archivelog;

Database altered.

SQL> select log_mode from v$database;

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

SQL> alter database open;

Database altered.

SQL>

相关内容