$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Thu Dec 10 13:38:57 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> startup;
ORACLE instance started.
Total System Global Area 5016387584 bytes
Fixed Size                  2027744 bytes
Variable Size             922750752 bytes
Database Buffers         4076863488 bytes
Redo Buffers               14745600 bytes
Database mounted.
Database opened.
SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     62
Current log sequence           64
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 5016387584 bytes
Fixed Size                  2027744 bytes
Variable Size             922750752 bytes
Database Buffers         4076863488 bytes
Redo Buffers               14745600 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> alter system set LOG_ARCHIVE_DEST_1='LOCATION=/ora_data/cpntest/archive';
System altered.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 5016387584 bytes
Fixed Size                  2027744 bytes
Variable Size             922750752 bytes
Database Buffers         4076863488 bytes
Redo Buffers               14745600 bytes
Database mounted.
aDatabase opened.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /ora_data/cpntest/archive
Oldest online log sequence     62
Next log sequence to archive   64
Current log sequence           64
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
注意:
如果是oracle9i,还需要更改如下参数:
alter system set log_archive_start=true scope=spfile;
但是如果在10g中也更改这些参数,数据库重启时会有如下提示:
ORA-32004: obsolete and/or deprecated parameter(s) specified
alter system set log_archive_format='%t_%s.dbf' scope=spfile;
但是如果在10g中也更改这些参数,数据库会不能启动,如下提示:
ORA-32004: obsolete and/or deprecated parameter(s) specified
ORA-19905: log_archive_format must contain %s, %t and %r