使用xlauch远程操作Oracle,经常进入界面的时候,提示sqlplus这个命令不识别,这说明,我们配置的环境变量没有生效。
[oracle@localhost ~]$ vi .bash_profile
Oracle用户中的.bash_profile中存放着这些环境变量,所以我们需要重新执行以下。
[oracle@localhost ~]$source .bash_profile我们重新执行以下,
[oracle@localhost ~]$sqlplus 此时该命令被识别
SQL*Plus: Release 11.1.0.6.0 -Production on Thu Sep 3 15:26:50 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
[oracle@localhost ~]$ sqlplussystem/hope@orcl
SQL*Plus: Release 11.1.0.6.0 -Production on Thu Sep 3 15:27:07 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
ERROR:
ORA-12541: TNS:nolistener
此时,还是不让登陆,我们可以采用以下方法来完成
[oracle@localhost ~]$sqlplus /nolog
SQL*Plus: Release 11.1.0.6.0 -Production on Thu Sep 3 15:28:09 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
SQL> connect /assysdba
Connected to an idleinstance.
SQL> startup 启动Oracle的实例
ORACLEinstance started.
Total System Global Area 849530880 bytes
Fixed Size 1303216 bytes
Variable Size 603983184 bytes
Database Buffers 239075328 bytes
Redo Buffers 5169152 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 11gEnterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, DataMining and Real Application Testing options
[oracle@localhost ~]$lsnrctl Oracle监听进程
LSNRCTL for Linux: Version 11.1.0.6.0- Production on 03-SEP-2009 15:44:02
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" forinformation.
LSNRCTL> start 启动Oracle的监听进程
Starting/home/oracle/app/oracle/product/11.1.0/db/bin/tnslsnr: pleasewait...
TNSLSNR for Linux: Version 11.1.0.6.0- Production
System parameter file is/home/oracle/app/oracle/product/11.1.0/db/network/admin/listener.ora
Log messages written to/home/oracle/app/oracle/product/11.1.0/db/log/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on:(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Connecting to(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version11.1.0.6.0 - Production
Start Date 03-SEP-2009 15:44:07
Uptime 0 days 0 hr. 0 min. 0sec
Trace Level off
Security ON: Local OSAuthentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/11.1.0/db/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/product/11.1.0/db/log/diag/tnslsnr/localhost/listener/alert/log.xml
Listening EndpointsSummary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
The listener supports noservices
The command completedsuccessfully
LSNRCTL>
做到这里就可以了,现在,可以操作Oracle,并且可以从客户端操作Oracle了!