linux下oracle用户环境变量,【Linux】Solaris10下安装后Oracle11g的环境变量配置,实现oracle用户下支持sqlplus,lsnrctl等命令...

Solaris10下安装后Oracle11g的环境变量配置,实现oracle用户下支持sqlplus,lsnrctl等命令

1. root用户下——修改oracle用户的配置文件.profile

文件路径为:/export/home/oracle/.profile

文件内容为:

#       This is the default standard profile provided to a user.

#       They are expected to edit it to meet their own needs.

MAIL=/usr/mail/${LOGNAME:?}

TMP=/tmp; export TMP

TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/export/home/oracle/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_2; export ORACLE_HOME

ORACLE_SID=easy; export ORACLE_SID

PATH=$PATH:$ORACLE_HOME/bin;export PATH

umask 022

注意事项:修改时候需要确保ORACLE_HOME的路径是实际存在的,这个路径的设置是需要根据你自己的安装路径来确定,不一定是固定不变的。

比如:我这里oracle数据库的bin文件夹的路径就是/export/home/oracle/app/oracle/product/11.2.0/dbhome_2/,因此我的ORACLE_HOME就是:配置到dbhome_2这层。

否则的话,如果这里配置的不准确,将会导致访问不到bin路径下,那么就无法直接在命令行使用sqlplus,lsnrctl等常用的oracle数据库操作命令。

2.root用户下——让刚刚的配置生效

bash-3.00# . /export/home/oracle/.profile

3.切换到oracle用户下——验证配置是否确实生效

经过验证,确实生效了,而且常用的数据库操作命令可以正常使用。

bash-3.00# su - oracle

Oracle Corporation      SunOS 5.10      Generic Patch   January 2005

-bash-3.00$ env

HZ=100

SHELL=/usr/bin/bash

TERM=ansi

TMPDIR=/tmp

ORACLE_SID=easy

ORACLE_BASE=/export/home/oracle/app/oracle

MAIL=/usr/mail/oracle

PATH=/usr/bin::/export/home/oracle/app/oracle/product/11.2.0/dbhome_2/bin

PWD=/export/home/oracle

LANG=zh

TZ=PRC

SHLVL=1

HOME=/export/home/oracle

TMP=/tmp

LOGNAME=oracle

ORACLE_HOME=/export/home/oracle/app/oracle/product/11.2.0/dbhome_2

_=/usr/bin/env

-bash-3.00$ lsnrctl

LSNRCTL for Solaris: Version 11.2.0.3.0 - Production on 17-JAN-2015 22:36:25

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Welcome to LSNRCTL, type "help" for information.

LSNRCTL> exit

-bash-3.00$ cat /export/home/oracle/.profile #       This is the default standard profile provided to a user. #       They are expected to edit it to meet their own needs. MAIL=/usr/mail/${LOGNAME:?} TMP=/tmp; export TMP TMPDIR=$TMP; export TMPDIR ORACLE_BASE=/export/home/oracle/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_2; export ORACLE_HOME ORACLE_SID=easy; export ORACLE_SID PATH=$PATH:$ORACLE_HOME/bin;export PATH umask 022 -bash-3.00$

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值