【步驟1】管理員身份連接數(shù)據(jù)庫(kù)
創(chuàng)新互聯(lián)公司2013年開創(chuàng)至今,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都網(wǎng)站制作、網(wǎng)站設(shè)計(jì)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元潤(rùn)州做網(wǎng)站,已為上家服務(wù),為潤(rùn)州各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:18980820575
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ù)庫(kù)
SQL shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
【步驟4】啟動(dòng)數(shù)據(jù)庫(kù)到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】啟動(dòng)歸檔模式
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】啟動(dòng)數(shù)據(jù)庫(kù)
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
如果開啟歸檔,請(qǐng)保證log_archive_start=true開啟自動(dòng)歸檔,否則只能手工歸檔,如果是關(guān)閉了歸檔,則設(shè)置該參數(shù)為false 注意:如果是OPS/RAC環(huán)境,需要先把parallel_server = true注釋掉,然后執(zhí)行如下步驟,最后用這個(gè)參數(shù)重新啟動(dòng) 1、開啟歸檔 a. 關(guān)閉數(shù)據(jù)庫(kù)shutdown immediate b. startup mount c. alter database archivelog d. alter database opne 2、禁止歸檔 a. 關(guān)閉數(shù)據(jù)庫(kù)shutdown immediate b. startup mount c. alter database noarchivelog d. alter database open 歸檔信息可以通過(guò)如下語(yǔ)句查看 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
開啟/關(guān)閉歸檔: (1)關(guān)閉數(shù)據(jù)庫(kù) shutdown immediate; (2)啟動(dòng)數(shù)據(jù)庫(kù)到mount狀態(tài) startup mount; (3)開啟/關(guān)閉歸檔 開啟:alter database archivelog; 關(guān)閉:alter database noarchivelog; (4)打開數(shù)據(jù)庫(kù) alter database open;