Oracle Linux下启动Oracle服务和监听程序

介绍在Oracle Linux 6中启动oracle实例和监听服务.这里注意,启动任务时,需要使用oracle用户,如果不是oracle用户,使用su - oracle命令切换到oracle用户。Oracle Linux 6;红帽6.5;CentOS6.5操作相同。

东西/原料

  • Oracle Linux 6;红帽6.5;CentOS6.5
  • Oracle 11G已经安装完当作
  • PL/SQL developer
  • vi

方式/步调

  1. 1

    以oracle用户登录系统,若是是root用户,利用su - oracle切换用户

  2. 2

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

  3. 3

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

  4. 4

    以sysdba毗连数据库,如下

    SQL> conn /as sysdba

  5. 5

    输入用户名sys 和暗码

  6. 6

    启动数据库实例,如下

    SQL> startup;

    期待半晌,比及database opened就是打开数据库实例当作功了。

  7. 7

    利用号令shutdown abort  ;或者  shutdown immediate ; 封闭数据库

  8. 8

    退出数据库毗连,如下:

    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

  9. 9

    以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. 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. 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

注重事项

  • 利用 source .bash_profile号令,使情况变量设置装备摆设立即生效
  • 发表于 2020-01-06 17:00
  • 阅读 ( 828 )
  • 分类:其他类型

你可能感兴趣的文章

相关问题

0 条评论

请先 登录 后评论
联系我们:uytrv@hotmail.com 问答工具