重慶分公司,新征程啟航
為企業提供網站建設、域名注冊、服務器等服務
為企業提供網站建設、域名注冊、服務器等服務
【步驟1】管理員身份連接數據庫
創新互聯公司2013年開創至今,是專業互聯網技術服務公司,擁有項目成都網站制作、網站設計網站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元潤州做網站,已為上家服務,為潤州各地企業和個人服務,聯系電話: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】查看當前歸檔模式,是歸檔還是非歸檔
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】關閉數據庫
SQL shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
【步驟4】啟動數據庫到mount狀態
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】啟動數據庫
SQL alter database open;
Database altered.
【步驟7】關閉歸檔模式
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
如果開啟歸檔,請保證log_archive_start=true開啟自動歸檔,否則只能手工歸檔,如果是關閉了歸檔,則設置該參數為false 注意:如果是OPS/RAC環境,需要先把parallel_server = true注釋掉,然后執行如下步驟,最后用這個參數重新啟動 1、開啟歸檔 a. 關閉數據庫shutdown immediate b. startup mount c. alter database archivelog d. alter database opne 2、禁止歸檔 a. 關閉數據庫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)關閉數據庫 shutdown immediate; (2)啟動數據庫到mount狀態 startup mount; (3)開啟/關閉歸檔 開啟:alter database archivelog; 關閉:alter database noarchivelog; (4)打開數據庫 alter database open;