[20171223]grid用戶的環境變數問題.txt

来源:http://www.cnblogs.com/lfree/archive/2017/12/22/8084630.html
-Advertisement-
Play Games

[20171223]grid用戶的環境變數問題.txt--//oracle 11G 安裝RAC,一般需要建立grid用戶,使用這個用戶管理asm,群集信息.--//在安裝過程中,同事的疑問實際上也是我以前的疑問.--//grid用戶:$ iduid=1100(grid) gid=1000(oinst ...


[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




您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 有一個表名為tb,欄位段名為name,數據類型nchar(20)。1、假設欄位數據為空,則不管改為什麼欄位類型,可以直接執行:alter table tb modify (name nvarchar2(20));2、假設欄位有數據,則改為nvarchar2(20)可以直接執行:alter table ...
  • Select高級應用,Information_schema說明 ...
  • 最近在獲取數據時,發現程式讀取的欄位中含有\r\n字元,檢查資料庫表中的數據,發現是varchar字元串中包含了換行符。導入數據導致了這一情況出現。 回車換行 不同系統的行結尾符號並不同,如下: linux/unix下的行結尾符號是\n windows中的行結尾符號是\r\n Mac系統下的行結尾符 ...
  • oralce寫法: select WM_CONCAT(A.title) as citys from tmpcity A sql server寫法: select stuff((select ','+A.title from tmpCity A FOR xml PATH('')), 1, 1, '') ...
  • ...
  • 今天遇到這樣一個語句: select * from interface a inner join hosts b on a.hostid=b.hostid inner join items c on c.hostid=a.hostid where a.hostid=10084 and c.key_ ...
  • 一、創建用戶:以root用戶登錄到資料庫進行用戶創建 命令: 例如: note: username——將要創建的用戶名; host——指定該用戶在哪個主機上可以登錄,"localhost"指該用戶只能在本地登錄,不能在另外一臺機器上遠程登錄,如果想遠程登錄,將"localhost"改為"%",表示在 ...
  • 資料庫索引就象書的目錄一樣,如果在欄位上建立了索引,那麼以索引列為查詢條件時可以加快查詢數據的速度。查詢資料庫,按主鍵查詢是最快的,每個表只能有一個主鍵列,但是可以有多個普通索引列,主鍵列要求列的所有內容必須唯一,而普通索引列不要求內容必須唯一。主鍵就類似我們在學校學習時的學好一樣,班級里是唯一的, ...
一周排行
    -Advertisement-
    Play Games
  • 前言 本文介紹一款使用 C# 與 WPF 開發的音頻播放器,其界面簡潔大方,操作體驗流暢。該播放器支持多種音頻格式(如 MP4、WMA、OGG、FLAC 等),並具備標記、實時歌詞顯示等功能。 另外,還支持換膚及多語言(中英文)切換。核心音頻處理採用 FFmpeg 組件,獲得了廣泛認可,目前 Git ...
  • OAuth2.0授權驗證-gitee授權碼模式 本文主要介紹如何筆者自己是如何使用gitee提供的OAuth2.0協議完成授權驗證並登錄到自己的系統,完整模式如圖 1、創建應用 打開gitee個人中心->第三方應用->創建應用 創建應用後在我的應用界面,查看已創建應用的Client ID和Clien ...
  • 解決了這個問題:《winForm下,fastReport.net 從.net framework 升級到.net5遇到的錯誤“Operation is not supported on this platform.”》 本文內容轉載自:https://www.fcnsoft.com/Home/Sho ...
  • 國內文章 WPF 從裸 Win 32 的 WM_Pointer 消息獲取觸摸點繪製筆跡 https://www.cnblogs.com/lindexi/p/18390983 本文將告訴大家如何在 WPF 裡面,接收裸 Win 32 的 WM_Pointer 消息,從消息裡面獲取觸摸點信息,使用觸摸點 ...
  • 前言 給大家推薦一個專為新零售快消行業打造了一套高效的進銷存管理系統。 系統不僅具備強大的庫存管理功能,還集成了高性能的輕量級 POS 解決方案,確保頁面載入速度極快,提供良好的用戶體驗。 項目介紹 Dorisoy.POS 是一款基於 .NET 7 和 Angular 4 開發的新零售快消進銷存管理 ...
  • ABP CLI常用的代碼分享 一、確保環境配置正確 安裝.NET CLI: ABP CLI是基於.NET Core或.NET 5/6/7等更高版本構建的,因此首先需要在你的開發環境中安裝.NET CLI。這可以通過訪問Microsoft官網下載並安裝相應版本的.NET SDK來實現。 安裝ABP ...
  • 問題 問題是這樣的:第三方的webapi,需要先調用登陸介面獲取Cookie,訪問其它介面時攜帶Cookie信息。 但使用HttpClient類調用登陸介面,返回的Headers中沒有找到Cookie信息。 分析 首先,使用Postman測試該登陸介面,正常返回Cookie信息,說明是HttpCli ...
  • 國內文章 關於.NET在中國為什麼工資低的分析 https://www.cnblogs.com/thinkingmore/p/18406244 .NET在中國開發者的薪資偏低,主要因市場需求、技術棧選擇和企業文化等因素所致。歷史上,.NET曾因微軟的閉源策略發展受限,儘管後來推出了跨平臺的.NET ...
  • 在WPF開發應用中,動畫不僅可以引起用戶的註意與興趣,而且還使軟體更加便於使用。前面幾篇文章講解了畫筆(Brush),形狀(Shape),幾何圖形(Geometry),變換(Transform)等相關內容,今天繼續講解動畫相關內容和知識點,僅供學習分享使用,如有不足之處,還請指正。 ...
  • 什麼是委托? 委托可以說是把一個方法代入另一個方法執行,相當於指向函數的指針;事件就相當於保存委托的數組; 1.實例化委托的方式: 方式1:通過new創建實例: public delegate void ShowDelegate(); 或者 public delegate string ShowDe ...