文章目錄
一、Oracle監聽
1.1. 查看Oracle監聽運行狀態
1.2. 啟動Oracle監聽
1.3. 關閉監聽器
二、Oracle 服務
2.1. 以SYS用戶身份登錄Oracle
2.2. 切換用戶至sys
2.3. 啟動Oracle實例
2.4. 停止Oeacle實例運行
一、Oracle監聽
操作聲明:登錄服務器,切換到oracle用戶,或者以oracle用戶登錄
#切換oracle用戶
[root@localhost ~]$ su - oracle
密碼:
[oracle@localhost ~]$
1.1. 查看Oracle監聽運行狀態
[oracle@localhost ~]$ lsnrctl status
1
從圖中可以看到oracle監聽沒有運行
在這里插入圖片描述
1.2. 啟動Oracle監聽
[oracle@localhost ~]$ lsnrctl start
1
在這里插入圖片描述
在這里插入圖片描述
在這里插入圖片描述
再次查看Oracle監聽運行狀態
[oracle@localhost ~]$ lsnrctl status
1
從圖中可以看到oracle監聽已經運行
在這里插入圖片描述
1.3. 關閉監聽器
二、Oracle 服務
2.1. 以SYS用戶身份登錄Oracle
[oracle@localhost ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Sat May 16 15:43:46 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
1
2
3
4
5
6
7
8
2.2. 切換用戶至sys
切換用戶:
CONN 用戶名/密碼 [AS SYSDBA],如果是sys用戶一定要寫上AS SYSDBA
sqlplus /nolog
conn /as sysdba
1
2
在這里插入圖片描述
2.3. 啟動Oracle實例
SQL> startup
ORACLE instance started.
Total System Global Area 8551575552 bytes
Fixed Size 2270360 bytes
Variable Size 4244638568 bytes
Database Buffers 4294967296 bytes
Redo Buffers 9699328 bytes
Database mounted.
Database opened.
1
2
3
4
5
6
7
8
9
10
在這里插入圖片描述
2.4. 停止Oeacle實例運行
SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> quit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
1
2
3
4
5
6
7
操作日志如下;
Last login: Sat Jun 20 18:03:14 2020 from 192.168.6.188
[root@sonar ~]# su - oracle
ORACLE_BASE=/u01/oracle
ORACLE_HOME=/u01/oracle/product/11.2.0/db_1
ORACLE_SID=sonar
[oracle@sonar ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 20-JUN-2020 18:31:19
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sonar)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@sonar ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 20-JUN-2020 18:31:32
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /u01/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/oracle/diag/tnslsnr/sonar/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sonar)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sonar)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 20-JUN-2020 18:31:34
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/oracle/diag/tnslsnr/sonar/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sonar)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@sonar ~]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 20-JUN-2020 18:31:47
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sonar)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 20-JUN-2020 18:31:34
Uptime 0 days 0 hr. 0 min. 13 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/oracle/diag/tnslsnr/sonar/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=sonar)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully
[oracle@sonar ~]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.4.0 Production on Sat Jun 20 18:32:56 2020
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 8551575552 bytes
Fixed Size 2270360 bytes
Variable Size 4244638568 bytes
Database Buffers 4294967296 bytes
Redo Buffers 9699328 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@sonar ~]$
————————————————
版權聲明:本文為CSDN博主「gblfy」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/weixin_40816738/article/details/106160298