oracle数据库常用工具是sqlplus 、em、isqlplus
启动的时候一般遵循以下顺序:
监听》》》》数据库》》》》em,isqlplus
关闭的时候一般遵循以下顺序:
em,isqlplus》》》》监听》》》数据库
--------------------------------关闭-------------------------------------------------
启动的时候一般遵循以下顺序:
监听》》》》数据库》》》》em,isqlplus
¥¥¥¥¥iqlplus的关闭¥¥¥¥¥¥¥
isqlplus的关闭要用到命令isqlplusctl,在命令行直接键入这个命令会显示其参数:如下:
[oracle@redhat4 ~]$ isqlplusctl
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Invalid arguments
Unknown command option
Usage::
isqlplusctl start| stop
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Invalid arguments
Unknown command option
Usage::
isqlplusctl start| stop
通过一下命令可以查看是否是开启的:
[oracle@redhat4 ~]$ netstat -tulnp|grep 5560
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:5560 0.0.0.0:* LISTEN 13491/java
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:5560 0.0.0.0:* LISTEN 13491/java
显示有5560 这个端口号 说明在开启着,下面我们来关闭:
[oracle@redhat4 ~]$ isqlplusctl stop
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Stopping iSQL*Plus ...
iSQL*Plus stopped.
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Stopping iSQL*Plus ...
iSQL*Plus stopped.
再查看端口号:
[oracle@redhat4 ~]$ netstat -tulnp|grep 5560
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)---与开启状态明显不同
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)---与开启状态明显不同
到此,成功关闭isqlplus。
¥¥¥¥¥em的关闭¥¥¥
em的关闭要用到命令是emctl:
[oracle@redhat4 ~]$ emctl
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Invalid arguments
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Invalid arguments
Unknown command option
Usage::
Oracle Enterprise Manager 10g Database Control commands:
Usage::
Oracle Enterprise Manager 10g Database Control commands:
emctl start| stop| status| setpasswd dbconsole
emctl secure
emctl set ssl test|off|on em
emctl set ldap
emctl blackout options can be listed by typing "emctl blackout"
emctl config options can be listed by typing "emctl config"
emctl secure options can be listed by typing "emctl secure"
emctl ilint options can be listed by typing "emctl ilint"
emctl deploy options can be listed by typing "emctl deploy"
emctl set ldap
emctl blackout options can be listed by typing "emctl blackout"
emctl config options can be listed by typing "emctl config"
emctl secure options can be listed by typing "emctl secure"
emctl ilint options can be listed by typing "emctl ilint"
emctl deploy options can be listed by typing "emctl deploy"
首先查看em状态:
&&&&方法一:emctl status dbconsole
[oracle@redhat4 ~]$ emctl status dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://redhat4:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.(em在启动着)
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/redhat4_jiagulun/sysman/log
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://redhat4:1158/em/console/aboutApplication
Oracle Enterprise Manager 10g is running.(em在启动着)
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/redhat4_jiagulun/sysman/log
方法二:netstat -tulnp|grep 1158
[oracle@redhat4 ~]$ netstat -tulnp|grep 1158
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:1158 0.0.0.0:* LISTEN 9076/java
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:1158 0.0.0.0:* LISTEN 9076/java
然后我们去关闭:emctl stop dbconsole
[oracle@redhat4 ~]$ emctl stop dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://redhat4:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped.
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://redhat4:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
... Stopped.
[oracle@redhat4 ~]$ netstat -tulnp|grep 1158
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
如果在ie打开em并且登录的状态下去执行emctl stop dbconsole命令,则不能正常关闭,会返回以下信息。
[oracle@redhat4 ~]$ emctl stop dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://redhat4:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
--- Failed to shutdown DBConsole Gracefully ---
failed.
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://redhat4:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
--- Failed to shutdown DBConsole Gracefully ---
failed.
¥¥¥¥监听的关闭¥¥
[oracle@redhat4 ~]$ lsnrctl stop
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 26-APR-2013 18:05:39
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=redhat4)(PORT=1521)))
The command completed successfully
查看端口情况
The command completed successfully
查看端口情况
[oracle@redhat4 ~]$ netstat -tulnp|grep 1521
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
em、isqlplus、监听都关了,执行命令w看一下目前有没有用户连接到oracle:
[oracle@redhat4 ~]$ w
18:08:29 up 54 min, 2 users, load average: 0.08, 0.09, 0.08
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root 192.168. 192.168.0.1 17:16 0.00s 0.00s 0.37s /usr/bin/gnome-
root pts/1 192.168.0.1:0.0 17:18 0.00s 4.74s 0.01s w
18:08:29 up 54 min, 2 users, load average: 0.08, 0.09, 0.08
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root 192.168. 192.168.0.1 17:16 0.00s 0.00s 0.37s /usr/bin/gnome-
root pts/1 192.168.0.1:0.0 17:18 0.00s 4.74s 0.01s w
发现没有用户连到oracle,可在sqlplus中用shutdown immediate命令关闭数据库:
[oracle@redhat4 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Apr 26 18:10:04 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
Database closed.
Database dismounted.
ORACLE instance shut down.
到此为止关闭完了:我们退出sqlplus,查看进程情况ps -ef|grep ora。
-------------------------------------------启动-----------------------------------
启动的时候一般遵循以下顺序:
监听》》》》数据库》》》》em,isqlplus
¥¥¥¥监听的启动¥¥¥¥¥
[oracle@redhat4 ~]$ lsnrctl start
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 26-APR-2013 18:21:24
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat4)(PORT=1521)))
System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat4)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=redhat4)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 26-APR-2013 18:21:24
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/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat4)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
由于现在数据库还没有启动 ,所以还没有监听到我们的数据库
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 26-APR-2013 18:21:24
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/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat4)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
由于现在数据库还没有启动 ,所以还没有监听到我们的数据库
¥¥¥¥数据库的启动¥¥¥¥
[oracle@redhat4 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Apr 26 18:22:31 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 2020192 bytes
Variable Size 125832352 bytes
Database Buffers 150994944 bytes
Redo Buffers 6365184 bytes
Database mounted.
Database opened.
Fixed Size 2020192 bytes
Variable Size 125832352 bytes
Database Buffers 150994944 bytes
Redo Buffers 6365184 bytes
Database mounted.
Database opened.
在查看监听状体:
[oracle@redhat4 ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 26-APR-2013 18:24:51
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=redhat4)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 26-APR-2013 18:21:24
Uptime 0 days 0 hr. 3 min. 27 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat4)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "jiagulun" has 1 instance(s).
Instance "jiagulun", status READY, has 1 handler(s) for this service...
Service "jiagulunXDB" has 1 instance(s).
Instance "jiagulun", status READY, has 1 handler(s) for this service...
Service "jiagulun_XPT" has 1 instance(s).
Instance "jiagulun", status READY, has 1 handler(s) for this service...
The command completed successfully
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 26-APR-2013 18:21:24
Uptime 0 days 0 hr. 3 min. 27 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=redhat4)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "jiagulun" has 1 instance(s).
Instance "jiagulun", status READY, has 1 handler(s) for this service...
Service "jiagulunXDB" has 1 instance(s).
Instance "jiagulun", status READY, has 1 handler(s) for this service...
Service "jiagulun_XPT" has 1 instance(s).
Instance "jiagulun", status READY, has 1 handler(s) for this service...
The command completed successfully
¥¥¥¥em、isqlplus的启动¥¥
[oracle@redhat4 ~]$ isqlplusctl start
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights reserved.
getnameinfo failed
getnameinfo failed
Starting iSQL*Plus ...
iSQL*Plus started.
iSQL*Plus 10.2.0.1.0
Copyright (c) 2003, 2005, Oracle. All rights reserved.
getnameinfo failed
getnameinfo failed
Starting iSQL*Plus ...
iSQL*Plus started.
查看那端口情况
[oracle@redhat4 ~]$ netstat -tulnp|grep 5560
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:5560 0.0.0.0:* LISTEN 20401/java
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:5560 0.0.0.0:* LISTEN 20401/java
em一旦建立就不要轻易改变linux服务器的名字,启动
[oracle@redhat4 ~]$ emctl start dbconsole
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://redhat4:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ................................ started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/redhat4_jiagulun/sysman/log
TZ set to PRC
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
http://redhat4:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 10g Database Control ................................ started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/redhat4_jiagulun/sysman/log
查看端口号
[oracle@redhat4 ~]$ netstat -tulnp|grep 1158
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:1158 0.0.0.0:* LISTEN 21071/java
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:1158 0.0.0.0:* LISTEN 21071/java
到此为止,启动成功
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/28811724/viewspace-759424/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/28811724/viewspace-759424/