- Connect as SYSDBA
> [oracle@oracle10g ~]$ sqlplus '/as sysdba'
Code: Select all
[oracle@oracle10g ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jan 24 20:52:44 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
> SQL> archive log list;
Code: Select all
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/oradata/archivelogs/
Oldest online log sequence 3
Current log sequence 4
SQL>
Code: Select all
SQL> select log_mode from v$database;
LOG_MODE
------------
NOARCHIVELOG
SQL>
> SQL> shutdown immediate;
Code: Select all
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
> SQL> startup mount exclusive;
Code: Select all
SQL> startup mount exclusive;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 79693392 bytes
Database Buffers 201326592 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL>
> SQL> alter database archivelog;
Code: Select all
SQL> alter database archivelog;
Database altered.
SQL>
> SQL> alter database open;
Code: Select all
SQL> alter database open;
Database altered.
SQL>
> SQL> archive log list;
Code: Select all
SQL> alter database archivelog;
Database altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/oradata/archivelogs/
Oldest online log sequence 4
Next log sequence to archive 5
Current log sequence 5
SQL>
Code: Select all
SQL> select log_mode from v$database;
LOG_MODE
------------
ARCHIVELOG
SQL>
- Implement achivelog backup to prevent filling up the archivelogs destination.
-- END
To set an Oracle database to ARCHIVELOG mode, follow the below steps:
- Connect as SYSDBA
> [oracle@oracle10g ~]$ sqlplus '/as sysdba'
Code: Select all
[oracle@oracle10g ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jan 24 21:16:18 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
> SQL> archive log list;
Code: Select all
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/oradata/archivelogs/
Oldest online log sequence 4
Next log sequence to archive 5
Current log sequence 5
SQL>
Code: Select all
SQL> select log_mode from v$database;
LOG_MODE
------------
ARCHIVELOG
SQL>
> SQL> shutdown immediate;
Code: Select all
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
> SQL> startup mount exclusive;
Code: Select all
SQL> startup mount exclusive;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 79693392 bytes
Database Buffers 201326592 bytes
Redo Buffers 2973696 bytes
Database mounted.
> SQL> alter database noarchivelog;
Code: Select all
SQL> alter database noarchivelog;
Database altered.
SQL>
> SQL> alter database open;
Code: Select all
SQL> alter database open;
Database altered.
SQL>
> SQL> archive log list;
Code: Select all
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/oradata/archivelogs/
Oldest online log sequence 4
Current log sequence 5
SQL>
Code: Select all
SQL> select log_mode from v$database;
LOG_MODE
------------
NOARCHIVELOG
SQL>
-- END