10G設定歸檔

jolly10發表於2007-11-21
10G設定歸檔和9i有所不同,在這裡記錄一下[@more@]

ORACLE10G FROM noarchive mode to archive mode

在init.ora中增加:
log_archive_max_processes=3
log_archive_dest_1='location=/oradata/orcl01/archive/'
log_archive_format="%T%S%r.ARC"

乾淨關閉資料庫:
SQL>shutdown immediate;

用pfile啟動到mount狀態
SQL>startup mount pfile='/oracle/app/admin/orcl01/pfile/init.ora'

啟用archivelog
SQL> alter database archivelog;

開啟資料庫,檢視狀態:
SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oradata/orcl01/archive/
Oldest online log sequence 3
Next log sequence to archive 5
Current log sequence 5

重建SPFILE
SQL> create spfile from pfile='/oracle/app/admin/orcl01/pfile/init.ora';

測試一下:
SQL> alter system switch logfile;

System altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oradata/orcl01/archive/
Oldest online log sequence 4
Next log sequence to archive 5
Current log sequence 6

OK!
--------------------------------------
ORACLE10G FROM archive mode to noarchive mode

SQL> shutdown immediate;
SQL> startup mount pfile='/oracle/app/admin/orcl01/pfile/init.ora'
SQL> alter database noarchivelog;
SQL> alter database open;

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

相關文章