1.登陸狀況:sql
[oracle@localhost ~]$ sqlplus / as sysdba數據庫
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 1 09:15:35 2019bash
Copyright (c) 1982, 2011, Oracle. All rights reserved.oracle
Connected to an idle instance.app
2.鏈接到空閒實例,多是數據庫監聽未啓動,或者數據庫未啓動,先啓監聽,再啓數據庫。tcp
先查看監聽狀態spa
[oracle@localhost ~]$ lsnrctl statusxml
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 01-JUL-2019 09:15:55ip
Copyright (c) 1991, 2011, Oracle. All rights reserved.it
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(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
3.監聽未啓動,則先啓動
[oracle@localhost ~]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 01-JUL-2019 09:16:01
Copyright (c) 1991, 2011, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date 01-JUL-2019 09:16:02
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully.
4.登陸數據庫,若此處登陸不上,先查看.bash_profile 中ORACLE_SID是否配置正確
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Mon Jul 1 09:16:05 2019
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
5.登錄後仍然是空閒實例,可能數據庫未啓動,啓動數據庫
SQL> startup
ORACLE instance started.
Total System Global Area 764121088 bytes
Fixed Size 2232272 bytes
Variable Size 494927920 bytes
Database Buffers 264241152 bytes
Redo Buffers 2719744 bytes
Database mounted.
Database opened.
6.啓動成功,查詢操做
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
7.結束。