天天看点

linux中oracle重启,Linux下重启Oracle数据库

场景: 由于 部门 多人 并发 使用 同一个 Oracle 服务,导致 Oracle 性能急剧下降,每单个简单的SQL  查询服务 都是 很慢,遂于是 关闭Oracle 重启试试

以oracle 用户登录 Linux 机器

(1) 以oracle身份登录数据库,命令:su – oracle (2) 进入Sqlplus控制台,命令:sqlplus /nolog (3) 以系统管理员登录,命令:connect / as sysdba (4) 启动数据库,命令:startup (5) 如果是关闭数据库,命令:shutdown immediate (6) 退出sqlplus控制台,命令:exit (7) 进入监听器控制台,命令:lsnrctl (8) 启动监听器,命令:start (9) 退出监听器控制台,命令:exit (10) 重启数据库结束

启动Oracle数据库:

第一步:打开Oracle监听

$ lsnrctl start

第二步:进入sqlplus

$ 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>

第三步:使用sysdab角色登录sqlplus

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>

关闭Oracle数据库:

1、关闭数据库

su oracle

[[email protected] oracle]# su oracle

bash-4.1$sqlplus /nolog

登陆sqlplus,结果如下:

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>

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