---
title: "betadmin 赋予oracle用户的权限"
author: "csh081"
date: "2014-10-28T22:43:54Z"
tags: []
categories: ["编程语言"]
slug: "betadmin-oracle"
draft: false
lastmod: "2015-10-21T15:08:00Z"
id: 2149016
url: "https://csh081.iteye.com/blog/2149016"
---

普通用户赋予oracle的用户的权限

1.ORACLE\_HOME路径的执行权限赋予该用户（将该用户添加到oracle的用户组）

usermod -a -G groupA user

(FC4: usermod -G groupA,groupB,groupC user)  
\-a 代表 append， 也就是 将自己添加到 用户组groupA 中，而不必离开 其他用户组。

（groups user）--用户所属分组

2.把Oracle\_HOME/bin加入到path环境变量里

 a.在/etc/profile文件末尾添加：

以下路径通过oracle  输入 echo $ORACLE\_HOME 得到

export ORACLE\_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome\_1

export PATH=$ORACLE\_HOME/bin:$PATH          

source /etc/profile使修改生效，不必重启系统

b.修改主目录下的隐藏文件./bashrc

修改方式与修改/etc/profile文件相同

source .bashrc使修改生效

 3.在profile里设置好ORACLE\_SID

a.在/etc/profile文件末尾添加：

ORACLE\_SID通过oracle  输入 echo $ORACLE\_SID 得到

export ORACLE\_SID=orcl      

source /etc/profile使修改生效，不必重启系统

b.修改主目录下的隐藏文件./bashrc

修改方式与修改/etc/profile文件相同

source .bashrc使修改生效

4.用户输入sudo -u oracle 不用输入密码

在/etc/sudoers添加下列行即可：

username  ALL=(ALL)       NOPASSWD:ALL

或者oracle组修改

dba      ALL=(ALL)       ALL:ALL