linux下oracle11g R2的啟動與關閉監聽、資料庫

來源:互聯網
上載者:User

標籤:結果   star   bytes   evel   copy   opened   message   level   11.2   

一、啟動監聽與資料庫

1、啟動監聽:

[html] view plain copy
  1. [[email protected] oracle]# su - oracle  
  2. bash-4.1$ lsnrctl start  

說明:

su後面追加 -,-l,--login,表示切換使用者時,使環境變數(home,shell,user,logname,path等)和欲切換的使用者相同、

結果如下,則啟動成功:

[html] view plain copy
  1. LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 04-APR-2014 16:15:25  
  2.   
  3. Copyright (c) 1991, 2009, Oracle.  All rights reserved.  
  4.   
  5. Starting /home/oracle/product/11.2/db_1/bin/tnslsnr: please wait...  
  6.   
  7. TNSLSNR for Linux: Version 11.2.0.1.0 - Production  
  8. System parameter file is /home/oracle/product/11.2/db_1/network/admin/listener.ora  
  9. Log messages written to /home/oracle/diag/tnslsnr/JTWF/listener/alert/log.xml  
  10. Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=JTWF)(PORT=1521)))  
  11.   
  12. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=JTWF)(PORT=1521)))  
  13. STATUS of the LISTENER  
  14. ------------------------  
  15. Alias                     LISTENER  
  16. Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production  
  17. Start Date                04-APR-2014 16:15:25  
  18. Uptime                    0 days 0 hr. 0 min. 0 sec  
  19. Trace Level               off  
  20. Security                  ON: Local OS Authentication  
  21. SNMP                      OFF  
  22. Listener Parameter File   /home/oracle/product/11.2/db_1/network/admin/listener.ora  
  23. Listener Log File         /home/oracle/diag/tnslsnr/JTWF/listener/alert/log.xml  
  24. Listening Endpoints Summary...  
  25.   (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=JTWF)(PORT=1521)))  
  26. The listener supports no services  
  27. The command completed successfully  


2、啟動資料庫:

串連到sqlplus

[html] view plain copy
  1. su oracle  
  2. bash-4.1$ sqlplus /nolog  


結果如下:


[html] view plain copy
  1. SQL*Plus: Release 11.2.0.1.0 Production on Fri Apr 4 16:15:52 2014  
  2.   
  3. Copyright (c) 1982, 2009, Oracle.  All rights reserved.  
  4.   
  5. SQL>  

以sysdba登陸,並執行命令startup

[html] view plain copy
  1. SQL> conn /as sysdba  
  2. Connected to an idle instance.  
  3. SQL> startup      

結果如下:

[html] view plain copy
  1. ORACLE instance started.  
  2. Total System Global Area  839282688 bytes  
  3. Fixed Size            2217992 bytes  
  4. Variable Size          578815992 bytes  
  5. Database Buffers      251658240 bytes  
  6. Redo Buffers            6590464 bytes  
  7. Database mounted.  
  8. Database opened.  
  9. SQL>  


二、關閉資料庫、監聽

1、關閉資料庫

[html] view plain copy
  1. su - oracle  
  2. [[email protected] oracle]# su oracle  
  3. bash-4.1$ sqlplus /nolog  

登陸sqlplus,結果如下:

[html] view plain copy
  1. SQL*Plus: Release 11.2.0.1.0 Production on Fri Apr 4 15:10:59 2014  
  2.   
  3. Copyright (c) 1982, 2009, Oracle.  All rights reserved.  
  4.   
  5. SQL>  


sysdba登陸:

[html] view plain copy
  1. SQL>conn /as sysdba  
  2. Connected.   


關閉資料庫:

[html] view plain copy
  1. SQL> shutdown immediate  
  2. Database closed.  
  3. Database dismounted.  
  4. ORACLE instance shut down.  


關閉資料庫後,若執行查詢命令, 則會報如下錯誤:

[html] view plain copy
  1. SQL> select * from vio_business_request;  
  2. select * from vio_business_request  
  3. *  
  4. ERROR at line 1:  
  5. ORA-01034: ORACLE not available  
  6. Process ID: 14138  
  7. Session ID: 75 Serial number: 503  
  8. SQL>  



退出sqlplus:

[html] view plain copy
  1. SQL> exit     
  2. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production  
  3. With the Partitioning, OLAP, Data Mining and Real Application Testing options  


2、關閉監聽:


[html] view plain copy
    1. bash-4.1$ lsnrctl stop   // oracle使用者下執行  
    2.   
    3. LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 04-APR-2014 15:17:00  
    4.   
    5. Copyright (c) 1991, 2009, Oracle.  All rights reserved.  
    6.   
    7. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=JTWF)(PORT=1521)))  
    8. The command completed successfullybash-4.1$ lsnrctl stop  
    9.   
    10. LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 04-APR-2014 15:17:00  
    11.   
    12. Copyright (c) 1991, 2009, Oracle.  All rights reserved.  
    13.   
    14. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=JTWF)(PORT=1521)))  
    15. The command completed successfully 

linux下oracle11g R2的啟動與關閉監聽、資料庫

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.