[20171223]grid用户的环境变量问题.txt
[20171223]grid用户的环境变量问题.txt
--//oracle 11G 安装RAC,一般需要建立grid用户,使用这个用户管理asm,群集信息.
--//在安装过程中,同事的疑问实际上也是我以前的疑问.
--//grid用户:
$ id
uid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper)
$ env| egrep "ORACLE_BASE|ORACLE_HOME"
ORACLE_BASE=/u01/app/grid
ORACLE_HOME=/u01/app/11.2.0/grid
--//oracle用户:
$ id
uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)
$ env| egrep "ORACLE_BASE|ORACLE_HOME"
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
--//为什么oracle用户建立ORACLE_HOME在ORACLE_BASE之中,而grid用户建立ORACLE_HOME却没有建立为
--//ORACLE_HOME目录之下,例如:/u01/app/grid/product/11.2.0/dbhome_1
--//我开始一直以为也许是一种约定,按照文档操作就ok了.昨天别人问这个问题,我google:
https://community.oracle.com/message/12310012
For ASM installation of software:
. The directories are located by the operating system environment variables.
-- ORACLE_BASE is the top-level directory for a particular software owner.
-- ORACLE_HOME is used to identify the top-level directory of the Grid Infrastructure software.
. Use a common ORACLE_BASE for all Oracle products owned by the same user.
. Use an isolated ORACLE_HOME location from other Oracle products even if they are the same version.
. Do not place Grid ORACLE_HOME below ORACLE_BASE.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. ORACLE_HOME requires 3 GB to 5 GB of disk space.
--//对方的解答:
The recommendation is correct. GRID_HOME should be separate. The root.sh script for the GRID_HOME changes ownership
and permissions for certain files to rooot so it should be separate.
...
Gridhome must not be a subdirectory of gridbase, because of the permission change to root. It works good in production
and hopefully survives a deinstall of grid base after e.g. an upgrade.
--//按照官方的解析,许多文件目录在按照后修改为root用户.
$ ls -l $ORACLE_HOME |grep " root "
drwxrwxrwt 6 root oinstall 4096 2016-12-24 12:12:53 auth
drwxr-xr-x 2 root oinstall 12288 2016-12-24 12:12:53 bin
drwxr-x--- 4 root oinstall 4096 2016-12-24 12:12:53 crf
drwxr-xr-x 17 root oinstall 4096 2016-12-24 12:12:53 crs
drwxr-xr-x 3 root oinstall 4096 2016-12-24 12:12:53 ctss
drwxr-x--- 3 root oinstall 4096 2016-12-24 12:12:53 gnsd
drwxr-xr-x 3 root oinstall 12288 2016-12-24 12:12:53 lib
drwxr-xr-x 3 root oinstall 4096 2016-12-24 12:12:53 ologgerd
drwxr-xr-x 3 root oinstall 4096 2016-12-24 12:12:53 osysmond
drwxr-xr-x 4 root root 4096 2016-12-24 12:13:13 tfa
$ find /u01/app/11.2.0 -uid 0 -exec ls -ld {} \;
--//能查询到许多目录文件都是root用户.
$ ls -l /u01/app
total 16
drwxr-xr-x. 3 root oinstall 4096 2016-12-18 14:47:35 11.2.0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drwxrwxr-x. 9 grid oinstall 4096 2016-12-30 12:09:18 grid
drwxrwxr-x. 7 oracle oinstall 4096 2016-12-24 12:52:35 oracle
drwxrwx--- 6 grid oinstall 4096 2016-12-24 12:42:52 oraInventory
--//11.2.0 目录的owner=root.我估计安装在子目录下安装也能过去,问题也许更多在取消安装或者升级.
--//实际上有许多帖子是关于grid中文件目录权限的问题.总之按照安装文档要求实施总是有一定道理.
--//实际上最好的方法是保存一份权限目录的文件,必须时查询与用于恢复.
getfacl -R /u01/app/11.2.0/grid > dir_privs.txt
setfact -restore dir_privs.txt
--//注意这样保存的是相对路径.保存绝对路径使用如下命令:
getfacl -R --absolute-names /u01/app/11.2.0/grid > dir_privs.txt
--//grid在安装后还保存一份文件目录的权限在如下目录:
# find /u01 -name "crsconfig_*" -exec ls -l {} + | grep utl
-rw-r--r-- 1 root root 8159 Dec 24 2016 /u01/app/11.2.0/grid/crs/utl/crsconfig_dirs
-rw-r--r-- 1 root root 12877 Dec 24 2016 /u01/app/11.2.0/grid/crs/utl/crsconfig_fileperms
-rw-r--r-- 1 root root 11936 Dec 24 2016 /u01/app/11.2.0/grid/crs/utl/crsconfig_files
[20171223]grid用户的环境变量问题.txt的更多相关文章
- Linux命令之env:显示当前用户的环境变量
Linux系统里的env命令可以显示当前用户的环境变量,还可以用来在指定环境变量下执行其他命令.下面来比较一下set,env和export命令的异同:set命令显示当前shell的变量,包括当前用户的 ...
- 在Windows系统上以C++打印出当前活动用户的环境变量
在Windows系统上以C++打印出当前活动用户的环境变量,代码如下(QT环境): void getEnvironmentVariables() { DWORD sessionId = WTSGetA ...
- Linux设定系统变量和单个用户的环境变量问题
环境为Ubuntu. 设定系统变量意思就是所有用户都可以使用设定的环境变量,而设定用户的单个环境变量意思就是只有设定环境的该用户才可以使用这个环境变量. 这里以java的jdk环境变量JAVA_HOM ...
- Linux为用户设定环境变量
今天在做从将MySQL中的数据同步到ES的时候,当启动脚本程序报错: Exception in thread "main" java.lang.UnsupportedClassVe ...
- mac OS配置用户全局环境变量(设置字符集为UTF8)
mac OS系统跟linux系统一样也是将用户的全局环境变量保存在.bash_profile配置文件中,只是mac OS默认没有此文件. 1.创建.bash_profile文件 vi ~/.bash_ ...
- linux给当前用户添加环境变量
比如当前用户为oracel,则添加环境变量操作为: vim /home/oracel/.bashrc
- sudo如何保持当前用户的环境变量?
现象,我在/etc/profile里设置全局代理,然后使用命令 1.curl http://www.baidu.com 走代理 2.sudo curl http://www.baidu.com 并没 ...
- 在Win7中修改 系统盘中 “系统” - “用户” 的环境变量映射关系
1.在此列表中,选中对应登录帐号 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList 2.将Prof ...
- root用户Linux 环境变量的配置解决(-bash: jps: command not found)有关问题
可以写成:$JAVA_HOME/bin 3. source /root/.bash_profile 发现 jps 等命令运行正常了
随机推荐
- 关于c++11中的thread库
c++11中新支持了thread这个库,常见的创建线程.join.detach都能支持. join是在main函数中等待线程执行完才继续执行main函数,detach则是把该线程分离出来,不管这个线程 ...
- java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.bjsxt.mapper.PeopleMapper
报错信息: Type Exception Report Description The server encountered an unexpected condition that prevente ...
- 在Kubernetes中部署GlusterFS+Heketi
目录 简介 Gluster-Kubernetes 部署 环境准备 下载相关文件 部署glusterfs 部署heketi server端 配置heketi client 简介 在上一篇<独立部署 ...
- 关于JS的一些东西
1.声明Js代码域 1.在head标签中使用script声明js代码域 <head> .... <!--声明js代码域--> ...
- 一款Timer倒计时器
http://files.cnblogs.com/Alandre/Time.zip自己做的哦 欢迎关注
- JS 从斐波那契数列浅谈递归
一.前言 昨晚下班后,经理出于兴趣给我们技术组讲了讲算法相关的东西,全程一脸懵逼的听,中途还给我们出了一道比较有趣的爬楼问题,问题如下: 假设一个人从地面开始爬楼梯,规定一步只能爬一坎或者两坎,人只能 ...
- [SCOI2010] 连续攻击游戏
题目 Description lxhgww最近迷上了一款游戏,在游戏里,他拥有很多的装备,每种装备都有2个属性,这些属性的值用[1,10000]之间的数表示.当他使用某种装备时,他只能使用该装备的某一 ...
- SQL 数据快速查询优化小技巧(仅供参考)
.应尽量避免在where子句中使用!=或<>操作符 .应尽量避免在where子句中使用or来连接条件 如: 可以这样查询 Union all .in 和not in 也要慎用,否则会导致全 ...
- spring cloud config客户端
上篇介绍了spring cloud config服务器,本篇介绍客户端.客户端主要是从config服务器获取配置信息. 代码示例 首先创建一个Maven项目,在pom.xml文件中添加依赖: < ...
- Web Service 与WebAPI 的区别
Web Servise: web service 是一种跨编程语言和跨操作系统平台的远程调用技术. 所谓跨编程语言和跨操作系统平台,就是说服务器端程序采用Java编写,客户端程序则可以采用其他编程语言 ...