以oracle用户登录系统,如果是root用户,使用su - oracle切换用户
以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
以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>
以sysdba连接数据库,如下SQL> conn /as sysdba
启动数据库实例,如下SQL> startup;
等待片刻,等到database opened就是打开数据库实例成功了。
使用命令shutdown abort ;或者 shutdown immediate ; 关闭数据库
退出数据库连接,如下: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
以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]$
启动数据库监听服务,如下:[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
如果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 to exit Vim 1,1 All