11g資料庫設定歸檔模式

yindi002發表於2012-12-03

 

文件目的:將11.2資料庫設定為歸檔模式,並觀察歸檔日誌的產生。 

[oracle@rac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Mon Nov 26 06:51:13 2012
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              No Archive Mode
Automatic archival             Disabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     31
Current log sequence           33

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

SQL> startup mount;
ORACLE instance started.
Total System Global Area  497995776 bytes
Fixed Size                  1337464 bytes
Variable Size             369100680 bytes
Database Buffers          121634816 bytes
Redo Buffers                5922816 bytes
Database mounted. 

SQL> alter database archivelog;
Database altered. 

SQL> alter database open;
Database altered. 

SQL> alter system set log_archive_dest_1='location=/u01/app/oracle/flash_recovery_area/';
System altered. 

SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/flash_recovery_area/
Oldest online log sequence     31
Next log sequence to archive   33
Current log sequence           33 

SQL> select name from v$archived_log;
no rows selected 

SQL> alter system archive log current;
System altered. 

SQL> select name from v$archived_log;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/flash_recovery_area/1_33_797441403.dbf 

SQL> alter system switch logfile;
System altered. 

SQL> select name from v$archived_log;
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/flash_recovery_area/1_33_797441403.dbf
/u01/app/oracle/flash_recovery_area/1_34_797441403.dbf

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9529380/viewspace-750419/,如需轉載,請註明出處,否則將追究法律責任。

相關文章