【步驟1】管理員身份連接數(shù)據(jù)庫
為牡丹江等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計(jì)制作服務(wù),及牡丹江網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都網(wǎng)站制作、做網(wǎng)站、牡丹江網(wǎng)站設(shè)計(jì),以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠(yuǎn)!
C:\Users\Administratorsqlplus sys/sys@prjdb as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jun 17 23:50:55 2014
Copyright (c) 1982, 2010, 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
【步驟2】查看當(dāng)前歸檔模式,是歸檔還是非歸檔
SQL archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 228
Current log sequence 230
【步驟3】關(guān)閉數(shù)據(jù)庫
SQL shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
【步驟4】啟動數(shù)據(jù)庫到mount狀態(tài)
SQL startup mount;
ORACLE instance started.
Total System Global Area 3423965184 bytes
Fixed Size 2180544 bytes
Variable Size 2013268544 bytes
Database Buffers 1392508928 bytes
Redo Buffers 16007168 bytes
Database mounted.
【步驟5】啟動歸檔模式
SQL alter database archivelog;
Database altered.
SQL archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 228
Next log sequence to archive 230
Current log sequence 230
【步驟6】啟動數(shù)據(jù)庫
SQL alter database open;
Database altered.
【步驟7】關(guān)閉歸檔模式
SQL shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL startup mount;
ORACLE instance started.
Total System Global Area 3423965184 bytes
Fixed Size 2180544 bytes
Variable Size 2013268544 bytes
Database Buffers 1392508928 bytes
Redo Buffers 16007168 bytes
Database mounted.
SQL alter database noarchivelog;
Database altered.
SQL archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 228
Current log sequence 230
SQL
修改成歸檔模式步驟:
關(guān)閉數(shù)據(jù)庫
SQL shutdown immediate
啟動數(shù)據(jù)庫到mount
SQLstartup mount;
修改成歸檔模式
SQL alter database archivelog;
打開數(shù)據(jù)庫
SQL alter database open;
修改成非歸檔模式:
步驟基本如上,只是將第三步中的命令改成如下:
SQL alter database noarchivelog;
注意事項(xiàng):oracle數(shù)據(jù)庫歸檔模式的的修改需要關(guān)閉數(shù)據(jù)庫,所以在生產(chǎn)系統(tǒng)中修改時(shí),需要考慮數(shù)據(jù)庫啟停時(shí)間。
如果開啟歸檔,請保證log_archive_start=true開啟自動歸檔,否則只能手工歸檔,如果是關(guān)閉了歸檔,則設(shè)置該參數(shù)為false 注意:如果是OPS/RAC環(huán)境,需要先把parallel_server = true注釋掉,然后執(zhí)行如下步驟,最后用這個(gè)參數(shù)重新啟動 1、開啟歸檔 a. 關(guān)閉數(shù)據(jù)庫shutdown immediate b. startup mount c. alter database archivelog d. alter database opne 2、禁止歸檔 a. 關(guān)閉數(shù)據(jù)庫shutdown immediate b. startup mount c. alter database noarchivelog d. alter database open 歸檔信息可以通過如下語句查看 SQL archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination E:\oracle\ora92\database\archive Oldest online log sequence 131 Next log sequence to archive 133 Current log sequence 133