測試將RAC GRID_HOME下所有檔案屬組修改後的修復方式permission.pl
測試將GRID_HOME下所有檔案屬組改變為ORACLE使用者的,叢集出現異常後的修復方式。
參考MOS文件:Script to capture and restore file permission in a directory (for eg. ORACLE_HOME) (文件 ID 1515018.1)
測試環境:LINUX-x64+oracle11gR2兩節點RAC
1.測試,修改節點1 GRID_HOME中所有檔案許可權為oracle:oinstall
[root@bys1 app]# cd /u01/11.2.0/grid/
[root@bys1 grid]# chown -R oracle:oinstall ./*
2.在正常節點2上獲取目錄及檔案的正確許可權
[root@bys2 ~]# ls
anaconda-ks.cfg Documents install.log Music Pictures Templates
Desktop Downloads install.log.syslog permission.pl Public Videos
[root@bys2 ~]# chmod a+x permission.pl
[root@bys2 ~]# ./permission.pl /u01/11.2.0/grid/
Following log files are generated
logfile : permission-Wed-Dec-14-16-16-50-2016
Command file : restore-perm-Wed-Dec-14-16-16-50-2016.cmd
Linecount : 17253
3.使用生成的指令碼對許可權進行恢復
[root@bys1 ~]# chmod a+x restore-perm-Wed-Dec-14-16-16-50-2016.cmd
[root@bys1 ~]# ./restore-perm-Wed-Dec-14-16-16-50-2016.cmd >/tmp/chown.log
---從如下輸出來看,主要是一些日誌檔案不存在引起的對應CHOWN語句出錯;
---注意:1.olr在安裝完成時的自動備份檔案許可權需要手動配置
---注意:2.OCR自動備份許可權需要手動配置/u01/11.2.0/grid/cdata/bysrac--許可權不對會導致無法覆蓋
---注意:3.注意檢驗GRID/ORACLE 的home下bin目錄中oracle程式的許可權--6751e及屬組
--部分重複的輸出已經刪除--
chown: cannot access `/u01/11.2.0/grid/cdata/bys1/backup_20161109_205004.olr': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/cdata/bys1/backup_20161109_205004.olr': No such file or directory
chown: cannot access `/u01/11.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2016-11-24_15-50-32PM.txt': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/cfgtoollogs/oui/oraInstall2016-11-09_09-01-09PM.out.bys1': No such file or directory
chown: cannot access `/u01/11.2.0/grid/log/bys1/client/clsc_7.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/log/bys1/client/gpnptool_13875.log': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/log/bys1/client/ocrcheck_18006.log': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/log/bys1/client/clsc_9.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/log/bys1/client/gpnptool_12955.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/log/bys1/client/clsc_14.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/log/bys1/client/ocrconfig_14761.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/cv/init/start.txt': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/install/root_bys1.bys.com_2016-11-09_20-46-04.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/crf/db/bys1/26-NOV-2016-09:36:58.txt': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/crf/db/bys1/10-NOV-2016-13:30:24.txt': No such file or directory
chown: cannot access `/u01/11.2.0/grid/crf/db/bys1/log.0000000018': No such file or directory
chown: cannot access `/u01/11.2.0/grid/crf/db/bys1/26-NOV-2016-09:33:56.txt': No such file or directory
chown: cannot access `/u01/11.2.0/grid/crf/db/bys1/log.0000000017': No such file or directory
chown: cannot access `/u01/11.2.0/grid/crf/db/bys1/10-NOV-2016-12:07:04.txt': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/crf/db/bys1/29-NOV-2016-18:27:55.txt': No such file or directory
chown: cannot access `/u01/11.2.0/grid/oc4j/j2ee/home/log/oc4j_2016_11_29_18_05_27.err': No such file or directory
chown: cannot access `/u01/11.2.0/grid/oc4j/j2ee/home/log/oc4j_2016_11_27_21_25_38.out': No such file or directory
chown: cannot access `/u01/11.2.0/grid/oc4j/j2ee/home/persistence/MBeanServerEjb.ser': No such file or directory
chown: cannot access `/u01/11.2.0/grid/.patch_storage/NApply/2016-11-10_12-54-39PM': No such file or directory
chown: cannot access `/u01/11.2.0/grid/rdbms/log/+asm2_ora_2644.trc': No such file or directory
大量此類檔案
chmod: cannot access `/u01/11.2.0/grid/rdbms/log/+asm2_ora_2478.trc': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/rdbms/audit/+ASM2_ora_10622_20161109214606892302143795.aud': No such file or directory
大量此類檔案
chmod: cannot access `/u01/11.2.0/grid/rdbms/audit/+ASM2_ora_15864_20161109210021310719143795.aud': No such file or directory
chown: cannot access `/u01/11.2.0/grid/dbs/ab_+ASM2.dat': No such file or directory
[root@bys1 ~]#
4.重啟主機或者叢集,檢查叢集狀態,叢集可以恢復正常;
[root@bys1 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE bys1
ONLINE ONLINE bys2
ora.LISTENER.lsnr
ONLINE ONLINE bys1
ONLINE ONLINE bys2
ora.asm
ONLINE ONLINE bys1 Started
ONLINE ONLINE bys2 Started
ora.gsd
OFFLINE OFFLINE bys1
OFFLINE OFFLINE bys2
ora.net1.network
ONLINE ONLINE bys1
ONLINE ONLINE bys2
ora.ons
ONLINE ONLINE bys1
ONLINE ONLINE bys2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE bys2
ora.bys1.vip
1 ONLINE ONLINE bys1
ora.bys2.vip
1 ONLINE ONLINE bys2
ora.bysrac.db
1 ONLINE ONLINE bys1 Open
2 ONLINE ONLINE bys2 Open
ora.cvu
1 ONLINE ONLINE bys2
ora.oc4j
1 OFFLINE OFFLINE
ora.scan1.vip
1 ONLINE ONLINE bys2
參考MOS文件:Script to capture and restore file permission in a directory (for eg. ORACLE_HOME) (文件 ID 1515018.1)
測試環境:LINUX-x64+oracle11gR2兩節點RAC
1.測試,修改節點1 GRID_HOME中所有檔案許可權為oracle:oinstall
[root@bys1 app]# cd /u01/11.2.0/grid/
[root@bys1 grid]# chown -R oracle:oinstall ./*
2.在正常節點2上獲取目錄及檔案的正確許可權
[root@bys2 ~]# ls
anaconda-ks.cfg Documents install.log Music Pictures Templates
Desktop Downloads install.log.syslog permission.pl Public Videos
[root@bys2 ~]# chmod a+x permission.pl
[root@bys2 ~]# ./permission.pl /u01/11.2.0/grid/
Following log files are generated
logfile : permission-Wed-Dec-14-16-16-50-2016
Command file : restore-perm-Wed-Dec-14-16-16-50-2016.cmd
Linecount : 17253
3.使用生成的指令碼對許可權進行恢復
[root@bys1 ~]# chmod a+x restore-perm-Wed-Dec-14-16-16-50-2016.cmd
[root@bys1 ~]# ./restore-perm-Wed-Dec-14-16-16-50-2016.cmd >/tmp/chown.log
---從如下輸出來看,主要是一些日誌檔案不存在引起的對應CHOWN語句出錯;
---注意:1.olr在安裝完成時的自動備份檔案許可權需要手動配置
---注意:2.OCR自動備份許可權需要手動配置/u01/11.2.0/grid/cdata/bysrac--許可權不對會導致無法覆蓋
---注意:3.注意檢驗GRID/ORACLE 的home下bin目錄中oracle程式的許可權--6751e及屬組
--部分重複的輸出已經刪除--
chown: cannot access `/u01/11.2.0/grid/cdata/bys1/backup_20161109_205004.olr': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/cdata/bys1/backup_20161109_205004.olr': No such file or directory
chown: cannot access `/u01/11.2.0/grid/cfgtoollogs/opatch/lsinv/lsinventory2016-11-24_15-50-32PM.txt': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/cfgtoollogs/oui/oraInstall2016-11-09_09-01-09PM.out.bys1': No such file or directory
chown: cannot access `/u01/11.2.0/grid/log/bys1/client/clsc_7.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/log/bys1/client/gpnptool_13875.log': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/log/bys1/client/ocrcheck_18006.log': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/log/bys1/client/clsc_9.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/log/bys1/client/gpnptool_12955.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/log/bys1/client/clsc_14.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/log/bys1/client/ocrconfig_14761.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/cv/init/start.txt': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/install/root_bys1.bys.com_2016-11-09_20-46-04.log': No such file or directory
chown: cannot access `/u01/11.2.0/grid/crf/db/bys1/26-NOV-2016-09:36:58.txt': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/crf/db/bys1/10-NOV-2016-13:30:24.txt': No such file or directory
chown: cannot access `/u01/11.2.0/grid/crf/db/bys1/log.0000000018': No such file or directory
chown: cannot access `/u01/11.2.0/grid/crf/db/bys1/26-NOV-2016-09:33:56.txt': No such file or directory
chown: cannot access `/u01/11.2.0/grid/crf/db/bys1/log.0000000017': No such file or directory
chown: cannot access `/u01/11.2.0/grid/crf/db/bys1/10-NOV-2016-12:07:04.txt': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/crf/db/bys1/29-NOV-2016-18:27:55.txt': No such file or directory
chown: cannot access `/u01/11.2.0/grid/oc4j/j2ee/home/log/oc4j_2016_11_29_18_05_27.err': No such file or directory
chown: cannot access `/u01/11.2.0/grid/oc4j/j2ee/home/log/oc4j_2016_11_27_21_25_38.out': No such file or directory
chown: cannot access `/u01/11.2.0/grid/oc4j/j2ee/home/persistence/MBeanServerEjb.ser': No such file or directory
chown: cannot access `/u01/11.2.0/grid/.patch_storage/NApply/2016-11-10_12-54-39PM': No such file or directory
chown: cannot access `/u01/11.2.0/grid/rdbms/log/+asm2_ora_2644.trc': No such file or directory
大量此類檔案
chmod: cannot access `/u01/11.2.0/grid/rdbms/log/+asm2_ora_2478.trc': No such file or directory
chmod: cannot access `/u01/11.2.0/grid/rdbms/audit/+ASM2_ora_10622_20161109214606892302143795.aud': No such file or directory
大量此類檔案
chmod: cannot access `/u01/11.2.0/grid/rdbms/audit/+ASM2_ora_15864_20161109210021310719143795.aud': No such file or directory
chown: cannot access `/u01/11.2.0/grid/dbs/ab_+ASM2.dat': No such file or directory
[root@bys1 ~]#
4.重啟主機或者叢集,檢查叢集狀態,叢集可以恢復正常;
[root@bys1 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE bys1
ONLINE ONLINE bys2
ora.LISTENER.lsnr
ONLINE ONLINE bys1
ONLINE ONLINE bys2
ora.asm
ONLINE ONLINE bys1 Started
ONLINE ONLINE bys2 Started
ora.gsd
OFFLINE OFFLINE bys1
OFFLINE OFFLINE bys2
ora.net1.network
ONLINE ONLINE bys1
ONLINE ONLINE bys2
ora.ons
ONLINE ONLINE bys1
ONLINE ONLINE bys2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE bys2
ora.bys1.vip
1 ONLINE ONLINE bys1
ora.bys2.vip
1 ONLINE ONLINE bys2
ora.bysrac.db
1 ONLINE ONLINE bys1 Open
2 ONLINE ONLINE bys2 Open
ora.cvu
1 ONLINE ONLINE bys2
ora.oc4j
1 OFFLINE OFFLINE
ora.scan1.vip
1 ONLINE ONLINE bys2
相關文章
- solaris程式檔案屬性紊亂的修復
- 所有控制檔案損壞的恢復--resetlogs方式
- 所有控制檔案損壞的恢復--noresetlogs方式
- 控制檔案恢復測試
- RAC 11G ASM下修改spfile檔案ASM
- RAC下歸檔不放到共享盤的測試
- Reflector反編譯.NET檔案後修復編譯
- 網站漏洞測試 檔案上傳漏洞的安全滲透與修復網站
- linux修改檔案所屬使用者和組Linux
- 控制檔案修復
- /etc/fstab檔案丟失後--修復系統
- Reflector反編譯.NET檔案後修復【轉】編譯
- SQL Anywhere db檔案損壞修復 DB檔案修復 DB資料庫修復SQL資料庫
- 【shell 指令碼】備份最後一天所有修改的檔案指令碼
- rman恢復控制檔案測試--log
- mac下將找出的檔案進行復制Mac
- 任意檔案讀取與下載的原理及修復
- 修改所有xml檔案中的某些內容XML
- RAC 環境下修改歸檔模式模式
- python將所有m4s檔案修改為mp4Python
- 【備份恢復】所有控制檔案丟失後 利用trace中的控制檔案備份執行恢復
- SQL Server的MDF檔案恢復/修復方法SQLServer
- rac歸檔模式/非歸檔模式下檔案建至本地儲存修復方法-ORA-01157模式
- 批處理檔案:將目錄下所有的jar檔案都加到CLASSPATHJAR
- 測試恢復5==使用2進位制形式檔案恢復控制檔案
- 通過遷移的方式修改ASM磁碟組的冗餘屬性ASM
- Oracle RAC修改引數檔案位置Oracle
- 如何修復MySQL配置檔案?MySql
- 日誌檔案的修復小結
- oracle 控制檔案的修復小結Oracle
- rac環境下修改歸檔路徑,並設定遠端傳輸屬性
- 修復檔案終結者病毒破壞的檔案
- 恢復測試:擁有當時的全部歸檔,控制檔案,恢復丟失的資料檔案。
- 使用jmeter測試工具完成檔案的下載JMeter
- win10系統dll檔案一鍵修復 缺少dll檔案修復方法Win10
- 修改ASM磁碟組的屬性ASM
- dbms_backup_restore包恢復控制檔案,資料檔案,歸檔檔案的測試案例REST
- 丟失所有重做日誌檔案的恢復例子丟失所有重做日誌檔案的恢復例子如下: