windows系統(tǒng):打開cmd窗口
創(chuàng)新互聯(lián)主要從事網(wǎng)站設(shè)計制作、成都網(wǎng)站制作、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)渦陽,10年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):028-86922220
Linux/Unix系統(tǒng):打開終端
rman target / nocatalog;
sqlplus /nolog
conn / as sysdba;
2、開啟歸檔
sqlplusshutdown immediate;(啟動歸檔前先要停止數(shù)據(jù)庫)
sqlplusstartup mount;(數(shù)據(jù)庫以mount方式啟動)
sqlplusalter database archivelog;(啟動數(shù)據(jù)庫歸檔)
修改成歸檔模式步驟:
關(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;
注意事項:oracle數(shù)據(jù)庫歸檔模式的的修改需要關(guān)閉數(shù)據(jù)庫,所以在生產(chǎn)系統(tǒng)中修改時,需要考慮數(shù)據(jù)庫啟停時間。
如果開啟歸檔,請保證log_archive_start=true開啟自動歸檔,否則只能手工歸檔,如果是關(guān)閉了歸檔,則設(shè)置該參數(shù)為false 注意:如果是OPS/RAC環(huán)境,需要先把parallel_server = true注釋掉,然后執(zhí)行如下步驟,最后用這個參數(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
1.管理員身份連接數(shù)據(jù)庫
C:\Users\Administratorsqlplus sys/sys@prjdb as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Jun 17 23:50:55 2014Copyright (c) 1982, 2010, Oracle. ?All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit ProductionWith 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 ? ? 228Current 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 bytesDatabase Buffers ? ? ? ? 1392508928 bytes
Redo Buffers ? ? ? ? ? ? ? 16007168 bytesDatabase 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 ? ? 228Next log sequence to archive ? 230Current 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 bytesDatabase Buffers ? ? ? ? 1392508928 bytes
Redo Buffers ? ? ? ? ? ? ? 16007168 bytesDatabase 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 ? ? 228Current log sequence ? ? ? ? ? 230SQL