24周年

財(cái)稅實(shí)務(wù) 高薪就業(yè) 學(xué)歷教育
APP下載
APP下載新用戶掃碼下載
立享專屬優(yōu)惠

安卓版本:8.7.20 蘋果版本:8.7.20

開發(fā)者:北京正保會(huì)計(jì)科技有限公司

應(yīng)用涉及權(quán)限:查看權(quán)限>

APP隱私政策:查看政策>

HD版本上線:點(diǎn)擊下載>

如何啟動(dòng)或關(guān)閉數(shù)據(jù)庫的歸檔模式

來源: 比特網(wǎng) 編輯: 2010/01/11 08:44:43  字體:

  Oracle數(shù)據(jù)庫可以運(yùn)行在2種模式:歸檔模式(archivelog)和非歸檔模式(noarchivelog)歸檔模式可以提高Oracle數(shù)據(jù)庫的可恢復(fù)性,生產(chǎn)數(shù)據(jù)庫都應(yīng)該運(yùn)行在此模式下,歸檔模式應(yīng)該和相應(yīng)的備份策略相結(jié)合,只有歸檔模式?jīng)]有相應(yīng)的備份策略只會(huì)帶來麻煩。 Oracle數(shù)據(jù)庫可以運(yùn)行在2種模式:歸檔模式(archivelog)和非歸檔模式(noarchivelog)歸檔模式可以提高Oracle數(shù)據(jù)庫的可恢復(fù)性,生產(chǎn)數(shù)據(jù)庫都應(yīng)該運(yùn)行在此模式下,歸檔模式應(yīng)該和相應(yīng)的備份策略相結(jié)合,只有歸檔模式?jīng)]有相應(yīng)的備份策略只會(huì)帶來麻煩。

  下面為大家簡(jiǎn)單介紹如何啟用和關(guān)閉數(shù)據(jù)庫的歸檔模式。

  1.shutdown normal或shutdown immediate關(guān)閉數(shù)據(jù)庫

  [oracle@jumper oracle]$ sqlplus "/ as sysdba"

  SQL*Plus:Release 9.2.0.4.0 - Production on Sat Oct 15 15:48:36 2005

  Copyright(c)1982,2002,Oracle Corporation. All rights reserved.

  Connected to:

  Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production

  With the Partitioning option

  JServer Release 9.2.0.4.0 - Production

  SQL> shutdown immediate;

  Database closed.

  Database dismounted.

  ORACLE instance shut down.

  2.啟動(dòng)數(shù)據(jù)庫到mount狀態(tài)

  SQL> startup mount;

  ORACLE instance started.

  Total System Global Area 101782828 bytes

  Fixed Size 451884 bytes

  Variable Size 37748736 bytes

  Database Buffers 62914560 bytes

  Redo Buffers 667648 bytes

  Database mounted.

  3.啟用或停止歸檔模式

  如果要啟用歸檔模式,此處使用

  alter database archivelog 命令。

  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 /opt/oracle/oradata/conner/archive

  Oldest online log sequence 148

  Next log sequence to archive 151

  Current log sequence 151如果需要停止歸檔模式,此處使用:

  alter database noarchivelog 命令。

  SQL> shutdown immediate;

  Database closed.

  Database dismounted.

  ORACLE instance shut down.

  SQL> startup mount;

  ORACLE instance started.

  Total System Global Area 101782828 bytes

  Fixed Size 451884 bytes

  Variable Size 37748736 bytes

  Database Buffers 62914560 bytes

  Redo Buffers 667648 bytes

  Database mounted.

  SQL> alter database noarchivelog;

  Database altered.

  SQL> alter database open;

  Database altered.

  SQL> archive log list;

  Database log mode No Archive Mode

  Automatic archival Enabled

  Archive destination /opt/oracle/oradata/conner/archive

  Oldest online log sequence 149

  Current log sequence 152

  4.修改相應(yīng)的初始化參數(shù)

  Oracle10g之前,你還需要修改初始化參數(shù)使數(shù)據(jù)庫處于自動(dòng)歸檔模式。

  在pfile/spfile中設(shè)置如下參數(shù):

  log_archive_start = true

  重啟數(shù)據(jù)庫此參數(shù)生效,此時(shí)數(shù)據(jù)庫處于自動(dòng)歸檔模式。

  也可以在數(shù)據(jù)庫啟動(dòng)過程中,手工執(zhí)行:

  archive log start

  使數(shù)據(jù)庫啟用自動(dòng)歸檔,但是重啟后數(shù)據(jù)庫仍然處于手工歸檔模式。

責(zé)任編輯:zoe
回到頂部
折疊
網(wǎng)站地圖

Copyright © 2000 - galtzs.cn All Rights Reserved. 北京正保會(huì)計(jì)科技有限公司 版權(quán)所有

京B2-20200959 京ICP備20012371號(hào)-7 出版物經(jīng)營許可證 京公網(wǎng)安備 11010802044457號(hào)