linux下oracle11g R2的启动与关闭监听、数据库
2014-04-07 12:38
411 查看
一、启动监听与数据库
1、启动监听:
说明:
su后面追加 -,-l,--login,表示切换用户时,使环境变量(home,shell,user,logname,path等)和欲切换的用户相同、
结果如下,则启动成功:
2、启动数据库:
连接到sqlplus
结果如下:
以sysdba登陆,并执行命令startup
结果如下:
二、关闭数据库、监听
1、关闭数据库
sysdba登陆:
关闭数据库:
关闭数据库后,若执行查询命令, 则会报如下错误:
退出sqlplus:
2、关闭监听:
1、启动监听:
[root@JTWF oracle]# su - oracle bash-4.1$ lsnrctl start
说明:
su后面追加 -,-l,--login,表示切换用户时,使环境变量(home,shell,user,logname,path等)和欲切换的用户相同、
结果如下,则启动成功:
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 04-APR-2014 16:15:25 Copyright (c) 1991, 2009, Oracle. All rights reserved. Starting /home/oracle/product/11.2/db_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.2.0.1.0 - Production System parameter file is /home/oracle/product/11.2/db_1/network/admin/listener.ora Log messages written to /home/oracle/diag/tnslsnr/JTWF/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=JTWF)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=JTWF)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 04-APR-2014 16:15:25 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /home/oracle/product/11.2/db_1/network/admin/listener.ora Listener Log File /home/oracle/diag/tnslsnr/JTWF/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=JTWF)(PORT=1521))) The listener supports no services The command completed successfully
2、启动数据库:
连接到sqlplus
su oracle bash-4.1$ sqlplus /nolog
结果如下:
SQL*Plus: Release 11.2.0.1.0 Production on Fri Apr 4 16:15:52 2014 Copyright (c) 1982, 2009, Oracle. All rights reserved. SQL>
以sysdba登陆,并执行命令startup
SQL> conn /as sysdba Connected to an idle instance. SQL> startup
结果如下:
ORACLE instance started. Total System Global Area 839282688 bytes Fixed Size 2217992 bytes Variable Size 578815992 bytes Database Buffers 251658240 bytes Redo Buffers 6590464 bytes Database mounted. Database opened. SQL>
二、关闭数据库、监听
1、关闭数据库
su - oracle登陆sqlplus,结果如下:
[root@JTWF oracle]# su oracle bash-4.1$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Fri Apr 4 15:10:59 2014 Copyright (c) 1982, 2009, Oracle. All rights reserved. SQL>
sysdba登陆:
SQL>conn /as sysdba Connected.
关闭数据库:
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down.
关闭数据库后,若执行查询命令, 则会报如下错误:
SQL> select * from vio_business_request; select * from vio_business_request * ERROR at line 1: ORA-01034: ORACLE not available Process ID: 14138 Session ID: 75 Serial number: 503 SQL>
退出sqlplus:
SQL> exit 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
2、关闭监听:
bash-4.1$ lsnrctl stop // oracle用户下执行 LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 04-APR-2014 15:17:00 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=JTWF)(PORT=1521))) The command completed successfullybash-4.1$ lsnrctl stop LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 04-APR-2014 15:17:00 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=JTWF)(PORT=1521))) The command completed successfully
相关文章推荐
- linux下oracle11g R2的启动与关闭监听、数据库
- Linux Oracle 数据库和监听 的启动 关闭
- Centos下oracle11g R2的启动与关闭监听、数据库
- Linux下启动Oracle11g数据库监听问题的解决
- Linux下oracle启动/关闭监听(bash:lsnrctl:command not found)
- linux oracle 设置随系统自动启动数据库实例和监听
- Oracle 监听/数据库 启动/关闭
- Linux下oracle启动/关闭监听(bash:lsnrctl:command not found)
- 虚拟机centos7服务器下,启动oracle11g数据库和关闭数据库
- Linux下启动和关闭Oracle服务和监听程序
- oracle 10G R2 RAC 数据库的关闭与启动
- linux下oralce数据库实例创建启动以及关闭
- Oracle11g 启动数据库实例、关闭数据库实例
- 安装最后一步:linux设置oracle数据库和监听开机自动启动
- X86_64平台下Oracle 11g R2 X64 for Linux的软件安装、数据库安装、服务配置、数据库启动和停止、SQLPLus使用
- Linux 下Oracle11g 自动启动和关闭
- Linux下启动关闭数据库
- linux下设置自动启动和关闭oracle实例、监听
- linux/Aix启动、关闭Oracle及监听
- Linux下oracle启动/关闭监听(bash:lsnrctl:command not found)