Wednesday, February 5, 2014

Archive Log Mode Oracle 10g/11g Enable and Disable Step

 Archive Log Mode 10g/11g Enable and Disable

[oracle@rnddba ~]$ export ORACLE_SID=eradb11g
[oracle@rnddba ~]$
[oracle@rnddba ~]$
[oracle@rnddba ~]$
[oracle@rnddba ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 5 06:07:24 2014

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

SQL> conn / as sysdba
Connected.

Check The database is archive mode or No Archive mode

SQL> archive log list
Database log mode           No Archive Mode
Automatic archival           Disabled
Archive destination           USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     88
Current log sequence           90

Check the archive log file destination path and size

SQL> show parameter recovery_file_dest

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest             string     /u01/app/oracle/flash_recovery
                         _area
db_recovery_file_dest_size         big integer 8480M

By default, archive logs will be written to the flash recovery area. If you do not want to write archive logs  to the flash recovery area you can set the parameter LOG_ARCHIVE_DEST_n to the location in which you wish to
write archive logs.

[root@rnddba ~]# mkdir /u02/eradb11g/fraeradb11g
[root@rnddba ~]# chown -R oracle:oinstall /u02/eradb11g/fraeradb11g
[root@rnddba ~]# chmod -R 775 /u02/eradb11g/fraeradb11g

SQL> alter system set log_archive_dest_1='LOCATION=/u02/eradb11g/fraeradb11g' scope = both;

SQL> show parameter log_archive_dest

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest             string
log_archive_dest_1             string     LOCATION=/u02/eradb11g/fraerad
                         b11g
SQL> archive log list
Database log mode           No Archive Mode
Automatic archival           Disabled
Archive destination           /u02/eradb11g/fraeradb11g
Oldest online log sequence     88
Current log sequence           90

Before doing Database archive mode please take consistent mode database backup for future recovery purpose.

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

Total System Global Area 3991842816 bytes
Fixed Size            2219512 bytes
Variable Size         2919236104 bytes
Database Buffers     1056964608 bytes
Redo Buffers           13422592 bytes
Database mounted.

SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list
Database log mode           Archive Mode
Automatic archival           Enabled
Archive destination           /u02/eradb11g/fraeradb11g
Oldest online log sequence     88
Next log sequence to archive   90
Current log sequence           90

You can switch to the log file to see that an archive is written to archive log location.
SQL> alter system switch logfile;

Check the archive log file in archive destination location
SQL> host
[oracle@rnddba ~]$ ls /u02/eradb11g/fraeradb11g/
1_90_821585333.dbf
[oracle@rnddba ~]$ exit
exit


Doing Database No Archive Mode
===============================

Note: It is recommended to perform a backup of the database (after a shutdown normal or immediate) prior to changing the archive status of a database.

The following are the steps required to disable archive log mode on an Oracle 10g or 11g database.
[oracle@rnddba ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Wed Feb 5 07:03:53 2014

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


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

SQL> archive log list
Database log mode           Archive Mode
Automatic archival           Enabled
Archive destination           /u02/eradb11g/fraeradb11g
Oldest online log sequence     89
Next log sequence to archive   91
Current log sequence           91

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

SQL> startup mount
ORACLE instance started.

Total System Global Area 3991842816 bytes
Fixed Size            2219512 bytes
Variable Size         2919236104 bytes
Database Buffers     1056964608 bytes
Redo Buffers           13422592 bytes
Database mounted.
SQL> alter database noarchivelog;

Database altered.

SQL> archive log list
Database log mode           No Archive Mode
Automatic archival           Disabled
Archive destination           /u02/eradb11g/fraeradb11g
Oldest online log sequence     89
Current log sequence           91
SQL>

Thanks For Updating....

No comments: