Oracle資料庫的十種重新啟動步驟
來源:互聯網
上載者:User
1. 停應用程式層的各種程式。
2. 停oralce的監聽進程:
$lsnrctl stop
3. 在獨佔的系統使用者下,備份控制檔案:
SQL>alter database backup controlfile to trace;
4. 在獨佔的系統使用者下,手工切換重作記錄檔,確保當前已修改過的資料存入檔案:
SQL>alter system switch logfile;
5. 在獨佔的系統使用者下,運行下面SQL語句,產生殺資料庫使用者串連的kill_all_session.sql檔案:
set head off;
set feedback off;
set newpage none;
spool /oracle_backup/bin/kill_all_session.sql
select 'alter system kill session '''||sid||',
'||serial#||''';' from v$session where username is not null;
spool off;
6. 在獨佔的系統使用者下,執行殺資料庫使用者串連的kill_all_session.sql檔案:
SQL>@/oracle_backup/bin/kill_all_session.sql
7. 在獨佔的系統使用者下,用immediate方式關閉資料庫:
SQL>shutdown immediate;
或者
SVRMGRL>shutdown immediate;
8. 啟動oralce的監聽進程:
$lsnrctl start
9. 進入獨佔的系統使用者下,啟動oralce資料庫:
$sqlplus /nolog
SQL>connect / as sysdba
SQL>startup;
或者:
$svrmgrl
SVRMGRL>connect internal;
SVRMGRL>startup;
10.啟動應用程式層的各種程式。