隨筆-314  評論-209  文章-0  trackbacks-0
          [摘要] 在實際的應用中,有時候工作數據庫需要重新啟動。本文介紹了一個特別實用的操作步驟,希望對大家有所幫助。
          [關鍵字] Oracle 重啟
            在實際的應用中,有時候工作數據庫需要重新啟動。本文介紹了一個特別實用的操作步驟,希望對大家有所幫助。

            1. 停應用層的各種程序

            2. 停Oralce的監聽進程

            $ lsnrctl stop

            3. 在獨占的系統用戶下,備份控制文件:

            $ sqlplus "/as sysdba"

            SQL> alter database backup controlfile to trace;

            4. 在獨占的系統用戶下,手工切換重作日志文件,確保當前已修改過的數據存入文件:

            SQL> alter system switch logfile;

            5. 在獨占的系統用戶下,運行下面SQL語句,生成殺數據庫用戶連接的kill_all_session.sql文件:

            SQL> set head off;

            SQL> set feedback off;

            SQL> set newpage none;

            SQL> spool ./kill_session.sql

            SQL> select 'alter system kill session '''  sid  ','  serial#  ''';' from v$session where username is not null;

            SQL> spool off;

            6. 在獨占的系統用戶下,執行殺數據庫用戶連接的kill_session.sql文件

            SQL> @./kill_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.啟動應用層的各種程序
          posted on 2011-01-04 10:10 xzc 閱讀(760) 評論(3)  編輯  收藏 所屬分類: Oracle

          評論:
          # re: 快速掌握重啟Oracle數據庫的操作步驟 2011-01-04 10:11 | xzc
          --在服務器上執行
          sqlplus "/as sysdba"
          SQL>alter system checkpoint;
          SQL>shutdown immediate
          SQL>startup;
            回復  更多評論
            
          # re: 快速掌握重啟Oracle數據庫的操作步驟 2011-01-04 10:14 | xzc
          nmyz2$[/oracle]sqlplus "/as sysdba"

          SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jan 4 09:39:52 2011

          Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


          Connected to:
          Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
          With the Partitioning, OLAP, Data Mining and Real Application Testing options

          SQL> alter system checkpoint;

          System altered.

          SQL> shutdown immediate
          Database closed.
          Database dismounted.


          ORACLE instance shut down.
          SQL> SQL> SQL> startup;
          ORACLE instance started.

          Total System Global Area 1.9327E+10 bytes
          Fixed Size 2103520 bytes
          Variable Size 2298480416 bytes
          Database Buffers 1.7012E+10 bytes
          Redo Buffers 14671872 bytes
          Database mounted.
          Database opened.
          SQL> exit
          Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
          With the Partitioning, OLAP, Data Mining and Real Application Testing options
          you have mail in /var/mail/oracle
          nmyz2$[/oracle]  回復  更多評論
            
          # 快速掌握重啟Oracle數據庫的操作步驟[未登錄] 2011-03-23 09:06 | 林海
          謝謝了!寫的條理清晰,不錯!  回復  更多評論
            
          主站蜘蛛池模板: 忻州市| 饶平县| 蛟河市| 通州市| 中宁县| 宜章县| 蓬安县| 勐海县| 新绛县| 青冈县| 铜山县| 大洼县| 黑龙江省| 临高县| 钟祥市| 顺昌县| 汤原县| 红桥区| 子洲县| 汝州市| 白城市| 关岭| 贵港市| 鞍山市| 兴文县| 宿州市| 武功县| 枣庄市| 泽普县| 淄博市| 浪卡子县| 武平县| 饶平县| 霍城县| 土默特左旗| 香格里拉县| 沿河| 乐东| 格尔木市| 赤峰市| 杨浦区|