Enable and Disable Archive Log Mode 10g/11g
Enable Archive Log Mode
============================
http://www.oracledistilled.com/oracle-database/backup-and-recovery/enabledisable-archive-log-mode-10g11g/
https://logic.edchen.org/how-to-set-use_db_recovery_file_dest/
[oracle@ora1 ~]$ sqlplus / as sysdba
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 25
Current log sequence 27
-----------------------------------------------------------------------------------------------
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 3852M
SQL>
--------------------------------------------------------------------------------------------------
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 80G SCOPE=BOTH;
[oracle@ora1 ~]$ sqlplus / as sysdba
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 25
Current log sequence 27
-----------------------------------------------------------------------------------------------
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 3852M
SQL>
--------------------------------------------------------------------------------------------------
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 80G SCOPE=BOTH;
SQL> alter system set db_recovery_file_dest='/u04/fast_recovery_area/' scope=both;
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination DB_RECOVERY_FILE_DEST
Oldest online log sequence 25
Current log sequence 27
---------------------------------------------------------------------------------------------------
SQL> shutdown immediate
.
SQL> startup mount
----------------------------------------------------------------------------------------------
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 DB_RECOVERY_FILE_DEST
Oldest online log sequence 25
Next log sequence to archive 27
Current log sequence 27
-----------------------------------------------------------------------------------------------
SQL> alter system switch logfile;
System altered.
SQL> host
[oracle@ora1 ~]$ ls /u02/app/oracle/oradata/orcl/arch
1_27_711369564.dbf
[oracle@ora1 ~]$ exit
exit
SQL>
--------------END-----------------------
Disable Archive Log Mode
=========================
[oracle@ora1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 8 12:54:05 2010
Copyright (c) 1982, 2009, 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 Archive Mode
Automatic archival Enabled
Archive destination /u02/app/oracle/oradata/orcl/arch
Oldest online log sequence 26
Next log sequence to archive 28
Current log sequence 28
SQL>
----------------------------------------------------------------------------------------------
SQL> shutdown immediate
SQL> startup mount
--------------------------------------------------------------------------------------------
SQL> alter database noarchivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination DB_RECOVERY_FILE_DEST
Oldest online log sequence 26
Current log sequence 28
SQL>
SQL> alter system set log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST' scope=both;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination DB_RECOVERY_FILE_DEST
Oldest online log sequence 25
Current log sequence 27
---------------------------------------------------------------------------------------------------
SQL> shutdown immediate
.
SQL> startup mount
----------------------------------------------------------------------------------------------
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 DB_RECOVERY_FILE_DEST
Oldest online log sequence 25
Next log sequence to archive 27
Current log sequence 27
-----------------------------------------------------------------------------------------------
SQL> alter system switch logfile;
System altered.
SQL> host
[oracle@ora1 ~]$ ls /u02/app/oracle/oradata/orcl/arch
1_27_711369564.dbf
[oracle@ora1 ~]$ exit
exit
SQL>
--------------END-----------------------
Disable Archive Log Mode
=========================
[oracle@ora1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 8 12:54:05 2010
Copyright (c) 1982, 2009, 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 Archive Mode
Automatic archival Enabled
Archive destination /u02/app/oracle/oradata/orcl/arch
Oldest online log sequence 26
Next log sequence to archive 28
Current log sequence 28
SQL>
----------------------------------------------------------------------------------------------
SQL> shutdown immediate
SQL> startup mount
--------------------------------------------------------------------------------------------
SQL> alter database noarchivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination DB_RECOVERY_FILE_DEST
Oldest online log sequence 26
Current log sequence 28
SQL>
No comments:
Post a Comment