Oracle Linux下启动Oracle服务和监听程序
介绍在Oracle Linux 6中启动oracle实例和监听服务
操作方法
- 01
以oracle用户登录系统,如果是root用户,使用su - oracle切换用户
- 02
以oracle用户cd到oracle的bin目录, cd $ORACLE_HOME/bin,如下: [oracle@localhost ~]$ cd $ORACLE_HOME/bin [oracle@localhost bin]$ pwd /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin [oracle@localhost bin]$
- 03
以nolog方式运行sqlplus,如下 [oracle@localhost bin]$ sqlplus /nolog SQL*Plus: Release 11.2.0.1.0 Production on Thu Nov 26 14:02:52 2015 Copyright (c) 1982, 2009, Oracle. All rights reserved. SQL>
- 04
以sysdba连接数据库,如下 SQL> conn /as sysdba
- 05
输入用户名sys 和密码
- 06
启动数据库实例,如下 SQL> startup; 等待片刻,等到database opened就是打开数据库实例成功了。
- 07
使用命令shutdown abort ;或者 shutdown immediate ; 关闭数据库
- 08
退出数据库连接,如下: 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
- 09
以oracle用户cd到oracle的bin目录, cd $ORACLE_HOME/bin,如下: [oracle@localhost ~]$ cd $ORACLE_HOME/bin [oracle@localhost bin]$ pwd /home/oracle/app/oracle/product/11.2.0/dbhome_1/bin [oracle@localhost bin]$
- 10
启动数据库监听服务,如下: [oracle@localhost bin]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 26-NOV-2015 14:07:10 Copyright (c) 1991, 2009, Oracle. All rights reserved. TNS-01106: Listener using listener name LISTENER has already been started
- 11
如果oracle用户的环境变量没有配置,[oracle@localhost ~]$ vi .bash_profile,添加如下内容: .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs umask 022 ORACLE_BASE=/home/oracle/app/oracle/ export ORACLE_BASE ORACLE_HOEM=/home/oracle/app/oracle/product/11.2.0/dbhome_1/ export ORACLE_HOME ORACLE_SID=orcl export ORACLE_SID LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/lib:/usr/lib export PATH DISPLAY=localhost:0.0 ~ ~ ~ ~ Type :quit<Enter> to exit Vim 1,1 All