----------------- 加入常用命令
vi /etc/profile
export GRID_HOME=/u01/app/12.1.0/grid
export ORACLE_HOME=/u01/app/12.1.0/grid
export PATH=$PATH:$GRID_HOME/bin
===================================rac中重新运行root.sh脚本===================================================
需要注意的是,多数以pl结尾的脚本从12.1.0.2开始都变为了sh脚本,例如:rootcrs.pl需要修改为rootcrs.sh
In 12.1.0.2, rootcrs.sh/roothas.sh should be used instead of rootcrs.pl/roothas.pl
# OCR备份,物理和逻辑都进行备份
ocrconfig -export /tmp/export_asm_lhr_logical.bak
ocrconfig -manualbackup
ocrconfig -showbackup
ocrconfig -copy +MGMT:/raclhr-cluster/OCRBACKUP/backup_20190822_085506.ocr.285.1016960109 /tmp/export_asm_lhr_physical.bak #从12.2开始的OCR物理备份默认放在MGMT磁盘组,建议单独cp到FS中
cp /u01/app/11.2.0/grid/cdata/raclhr-cluster/backup_20190822_111554.ocr /tmp/export_asm_lhr_physical.bak
#手动对集群相关资源进行备份,包括新增的db、监听、service等
----------------- 日志地址
---11g、12.1.0.2、
日志地址:$ORACLE_HOME/cfgtoollogs/crsconfig/
重置的日志文件:hadelete.log
root.sh脚本日志:rootcrs_rac2.log
---18c
18c的日志地址:$ORACLE_HOME/install/
18c的详细日志地址:/u01/app/grid/crsdata/raclhr-18c-n1/crsconfig/
重置的日志文件:crsdeconfig_raclhr-18c-n1_2019-08-21_11-21-45AM.log
root.sh脚本日志:rootcrs_raclhr-18c-n1_2019-08-21_11-15-48AM.log
export GRID_HOME=$ORACLE_HOME
# 查询ASM磁盘
$GRID_HOME/bin/kfod disks=asm st=true ds=true cluster=true
# /grid/stage/ext/bin/kfod disks=asm st=true ds=true cluster=true
#root用户重新执行root.sh,配置文件:$ORACLE_HOME/crs/install/crsconfig_params
crsctl stop crs -f
#kill -9 `ps -ef|grep d.bin| grep -v grep | awk '{print $2}'`
export GRID_HOME=$ORACLE_HOME
$GRID_HOME/crs/install/rootcrs.pl -deconfig -force -verbose
$GRID_HOME/crs/install/rootcrs.pl -deconfig -force -verbose -lastnode -keepdg
find $ORACLE_HOME/gpnp/* -type f -exec rm -rf {} \;
dd if=/dev/zero of=/dev/rhdiskN bs=1024k count=100 --清理磁盘头
--查看磁盘是否有内容
--AIX用:lquerypv -h /dev/rhdisk5
--linux用:hexdump /dev/sdb ,例如:hexdump -n 1024 -C /dev/sdb1
#保证集群完全关闭,最好重启OS,检查网络情况,是否有cvuqdisk
#find /u01 -name cvuqdisk*
#rpm -qa cvuqdisk
#rpm -ivh $GRID_HOME/cv/rpm/cvuqdisk-*.rpm
#检查配置文件($ORACLE_HOME/crs/install/crsconfig_params)是否需要修改,18c可以去掉MGMTDB
$GRID_HOME/root.sh #若出现错误,则在解决错误后可以重复执行,不需要先deconfig
#也可以图形化界面使用GRID配置
#export DISPLAY=192.168.59.1:0.0
#$ORACLE_HOME/crs/config/config.sh
-----------------------------------------------------
--- 对于18c,需要注意:
#若MGMTDB不需要重复创建,则可以修改配置文件
#配置文件($ORACLE_HOME/crs/install/crsconfig_params)修改以下内容的值为空:
MGMT_DB=
GIMR_CONFIG=
CDATA_BACKUP_DISK_GROUP=
CDATA_BACKUP_FAILURE_GROUPS=
CDATA_BACKUP_QUORUM_GROUPS=
CDATA_BACKUP_DISKS=
CDATA_BACKUP_REDUNDANCY=
CDATA_BACKUP_AUSIZE=
CDATA_BACKUP_SITES=
CDATA_BACKUP_SIZE=
-----------------------------------------------------
# OCR恢复
crsctl stop crs
crsctl start crs -excl -nocrs
#crsctl stop resource ora.crsd -init
ocrconfig -import /tmp/export_asm_lhr_logical.bak #逻辑备份恢复
#ocrconfig -restore /tmp/export_asm_lhr_physical.bak #物理备份恢复
crsctl stop crs
crsctl start crs
===============================================================================================================
kfod命令:
[root@raclhr-11gR2-N1 app]# kfod -h
KFOD-00101: LRM error [107] while parsing command line arguments
_asm_a/llow_only_raw_disks KFOD allow only raw devices [_asm_allow_only_raw_disks=TRUE/(FALSE)]
_asm_l/ibraries ASM Libraries[_asm_libraries=lib1,lib2,...]
_asms/id ASM Instance[_asmsid=sid]
a/sm_diskstring ASM Diskstring [asm_diskstring=discoverystring, discoverystring ...]
c/luster KFOD cluster [cluster=TRUE/(FALSE)]
db/_unique_name db_unique_name for ASM instance[db_unique_name=dbname]
di/sks Disks to discover [disks=raw,asm,all]
ds/cvgroup Include group name [dscvgroup=TRUE/(FALSE)]
g/roup Disks in diskgroup [group=diskgroup]
h/ostlist hostlist[hostlist=host1,host2,...]
metadata_a/usize AU Size for Metadata Size Calculation
metadata_c/lients Client Count for Metadata Size Calculation
metadata_d/isks Disk Count for Metadata Size Calculation
metadata_n/odes Node Count for Metadata Size Calculation
metadata_r/edundancy Redundancy for Metadata Size Calculation
n/ohdr KFOD header suppression [nohdr=TRUE/(FALSE)]
o/p KFOD options type [OP=DISKS/CANDIDATES/MISSING/GROUPS/INSTS/VERSION/CLIENTS/RM/RMVERS/DFLTDSTR/GPNPDSTR/METADATA/ALL]
p/file ASM parameter file [pfile=parameterfile]
s/tatus Include disk header status [status=TRUE/(FALSE)]
v/erbose KFOD verbose errors [verbose=TRUE/(FALSE)]
[grid@raclhr-18c-n1 ~]$ kfod -h
KFOD-00101: LRM error [107] while parsing command line arguments
_asm_a/llow_only_raw_disks KFOD allow only raw devices [_asm_allow_only_raw_disks=(TRUE)/FALSE]
_asm_l/ibraries ASM Libraries[_asm_libraries=lib1,lib2,...]
_asms/id ASM Instance[_asmsid=sid]
_b/oot Running in pre-install env (boot=TRUE/FALSE)
_f/lexinfo Provide flexinfo (_flexinfo=TRUE/FALSE)
_p/atch_lib Patchlib [_patch_lib=]
_u/ser OS Username
asm_/diskstring ASM Diskstring [asm_diskstring=discoverystring, discoverystring ...]
asmc/ompatibility Include diskgroup ASM compatibility [asmcompatibility=TRUE/(FALSE)]
ce/ll KFOD display OSS site/rack info [cell=TRUE/(FALSE)]
cli/ent_cluster client cluster name
clus_/version cluster version
clust/er KFOD cluster [cluster=TRUE/(FALSE)]
db_/unique_name db_unique_name for ASM instance[db_unique_name=dbname]
dbc/ompatibility Include diskgroup DB compatibility [dbcompatibility=TRUE/(FALSE)]
disk_/access Disk access method [disk_access=DIRECT/(INDIRECT)]
disks Disks to discover [disks=raw,asm,badsize,all]
ds/cvgroup Include group name [dscvgroup=TRUE/(FALSE)]
f/orce Force option to delete files (force=TRUE/FALSE)
g/roup Disks in diskgroup [group=diskgroup]
h/ostlist hostlist[hostlist=host1,host2,...]
l/abel KFOD display disk labels [label=TRUE/(FALSE)]
metadata_a/usize AU Size for Metadata Size Calculation
metadata_c/lients Client Count for Metadata Size Calculation
metadata_d/isks Disk Count for Metadata Size Calculation
metadata_n/odes Node Count for Metadata Size Calculation
metadata_r/edundancy Redundancy for Metadata Size Calculation
na/me Include disk name [name=TRUE/(FALSE)]
no/hdr KFOD header suppression [nohdr=TRUE/(FALSE)]
ol/r Import credentials to OLR [olr=TRUE/(FALSE)]
op KFOD options type [OP=DISKS/CANDIDATES/MISSING/GROUPS/INSTS/VERSION/PATCHES/PATCHLVL/CLIENTS/RM/RMVERS/DFLTDSTR/GPNPDSTR/METADATA/CREDCRECLUS/GETCLSTYPE/CREDEXPORT/GETASMGUID/CREDDELCLUS/CREDVERIFY/UPGRADEVERIFY/LSCC/CREDLIST/CELLCONFIG/SETDISKACCESSMODE/SETRIMACCESSMODE/ALL]
p/file ASM parameter file [pfile=parameterfile]
r/im_disk_access Rim disk access method [rim_disk_access=DIRECT/(INDIRECT)]
sh/allow Do shallow discovery and report disk cnt [shallow=TRUE/(FALSE)]
st/atus Include disk header status [status=TRUE/(FALSE)]
v/erbose KFOD verbose [verbose=none,errors,warnings,functions,all]
w/rap wrap file for credentials
About Me
........................................................................................................................ ● 本文作者:小麦苗,部分内容整理自网络,若有侵权请联系小麦苗删除 ● 本文在itpub、博客园、CSDN和个人微 信公众号( xiaomaimiaolhr)上有同步更新 ● 本文itpub地址: http://blog.itpub.net/26736162 ● 本文博客园地址: http://www.cnblogs.com/lhrbest ● 本文CSDN地址: https://blog.csdn.net/lihuarongaini ● 本文pdf版、个人简介及小麦苗云盘地址: http://blog.itpub.net/26736162/viewspace-1624453/ ● 数据库笔试面试题库及解答: http://blog.itpub.net/26736162/viewspace-2134706/ ● DBA宝典今日头条号地址: http://www.toutiao.com/c/user/6401772890/#mid=1564638659405826 ........................................................................................................................ ● QQ群号: 230161599 、618766405 ● 微 信群:可加我微 信,我拉大家进群,非诚勿扰 ● 联系我请加QQ好友 ( 646634621 ),注明添加缘由 ● 于 2019-08-01 06:00 ~ 2019-08-31 24:00 在西安完成 ● 最新修改时间:2019-08-01 06:00 ~ 2019-08-31 24:00 ● 文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解 ● 版权所有,欢迎分享本文,转载请保留出处 ........................................................................................................................ ● 小麦苗的微店: https://weidian.com/s/793741433?wfr=c&ifr=shopdetail ● 小麦苗出版的数据库类丛书: http://blog.itpub.net/26736162/viewspace-2142121/ ● 小麦苗OCP、OCM、高可用网络班: http://blog.itpub.net/26736162/viewspace-2148098/ ● 小麦苗腾讯课堂主页: https://lhr.ke.qq.com/ ........................................................................................................................ 使用 微 信客户端扫描下面的二维码来关注小麦苗的微 信公众号( xiaomaimiaolhr)及QQ群(DBA宝典)、添加小麦苗微 信, 学习最实用的数据库技术。
........................................................................................................................ |