首页Linux包含linux asm的词条

包含linux asm的词条

时间2021-09-28 03:24:05发布夜天蜘蛛分类Linux 评论0浏览25

环境:RHEL 6.5 + Oracle 11.2

需求:单机静默安装GI软件并创建ASM实例和ASM磁盘组,为后续迁移数据库文件到ASM做准备

· 1. 安装配置GI软件

· 2. 创建ASM实例

包含linux asm的词条

· 3. 创建ASM磁盘组DATA1

1. 安装配置GI软件

1.1 创建grid用户和相关组,创建目录,确认ASM磁盘权限,配置环境变量

-- 创建grid用户和相关组

groupadd asmadmingroupadd asmdbagroupadd asmoperuseradd -g oinstall -G dba,asmadmin,asmdba,asmoper gridusermod -g oinstall -G dba,asmadmin,asmdba oraclepasswd grid

-- 创建目录

mkdir -p /u02/app/11.2.0/gridmkdir -p /u02/app/grid

-- 赋予目录权限

包含linux asm的词条

chmod 775 /u02/appchown -R grid:oinstall /u02/app/11.2.0chown -R grid:oinstall /u02/app/grid

-- ASM磁盘

$ ls -lh /dev/mapper/ora_vg-lv_asm*lrwxrwxrwx. 1 root root 7 Dec 1 13:13 /dev/mapper/ora_vg-lv_asm1 -> ../dm-2lrwxrwxrwx. 1 root root 7 Dec 1 13:14 /dev/mapper/ora_vg-lv_asm2 -> ../dm-3lrwxrwxrwx. 1 root root 7 Dec 1 13:14 /dev/mapper/ora_vg-lv_asm3 -> ../dm-4lrwxrwxrwx. 1 root root 7 Dec 1 13:14 /dev/mapper/ora_vg-lv_asm4 -> ../dm-5lrwxrwxrwx. 1 root root 7 Dec 1 13:14 /dev/mapper/ora_vg-lv_asm5 -> ../dm-6lrwxrwxrwx. 1 root root 7 Dec 1 13:15 /dev/mapper/ora_vg-lv_asm6 -> ../dm-7

-- 赋权并将赋权操作添加到/etc/rc.local文件中

chown grid:asmadmin /dev/mapper/ora_vg-lv_asm*

-- grid环境变量

包含linux asm的词条

export ORACLE_BASE=/u02/app/gridexport ORACLE_HOME=/u02/app/11.2.0/gridexport ORACLE_SID=+ASMexport PATH=$ORACLE_HOME/bin:$PATH

注意:生产环境一般用udev绑定新盘,我这里由于是Citrix虚拟化实验环境,用每个lv模拟了一个磁盘。

1.2 解压安装包

# chmod 775 /u02/soft/$ unzip /u02/media/p13390677_112040_Linux-x86-64_3of7.zip -d /u02/soft/

1.3 静默安装GI

$ cd /u02/soft/grid/response$ cp grid_install.rsp grid_install.rsp.bak$ sed -i 's/^#.*$//g' *.rsp$ sed -i '/^$/d' *.rsp$ more grid_install.rsporacle.install.responseFileVersion=/oracle/install/rspfmt_crsinstall_response_schema_v11_2_0ORACLE_HOSTNAME=nwppdb01INVENTORY_LOCATION=/u02/app/oraInventorySELECTED_LANGUAGES=enoracle.install.option=HA_CONFIGORACLE_BASE=/u02/app/gridORACLE_HOME=/u02/app/11.2.0/gridoracle.install.asm.OSDBA=asmdbaoracle.install.asm.OSOPER=asmoperoracle.install.asm.OSASM=asmadminoracle.install.crs.config.gpnp.scanName=oracle.install.crs.config.gpnp.scanPort=oracle.install.crs.config.clusterName=oracle.install.crs.config.gpnp.configureGNS=falseoracle.install.crs.config.gpnp.gnsSubDomain=oracle.install.crs.config.gpnp.gnsVIPAddress=oracle.install.crs.config.autoConfigureClusterNodeVIP=oracle.install.crs.config.clusterNodes=oracle.install.crs.config.networkInterfaceList=oracle.install.crs.config.storageOption=ASM_STORAGEoracle.install.crs.config.sharedFileSystemStorage.diskDriveMapping=oracle.install.crs.config.sharedFileSystemStorage.votingDiskLocations=oracle.install.crs.config.sharedFileSystemStorage.votingDiskRedundancy=NORMALoracle.install.crs.config.sharedFileSystemStorage.ocrLocations=oracle.install.crs.config.sharedFileSystemStorage.ocrRedundancy=NORMALoracle.install.crs.config.useIPMI=falseoracle.install.crs.config.ipmi.bmcUsername=oracle.install.crs.config.ipmi.bmcPassword=oracle.install.asm.SYSASMPassword=oracleoracle.install.asm.diskGroup.name=data1oracle.install.asm.diskGroup.redundancy=NORMALoracle.install.asm.diskGroup.AUSize=1oracle.install.asm.diskGroup.disks=/dev/mapper/ora_vg-lv_asm1,/dev/mapper/ora_vg-lv_asm2oracle.install.asm.diskGroup.diskDiscoveryString=/dev/mapper/ora*oracle.install.asm.monitorPassword=oracleoracle.install.crs.upgrade.clusterNodes=oracle.install.asm.upgradeASM=falseoracle.installer.autoupdates.option=oracle.installer.autoupdates.downloadUpdatesLoc=AUTOUPDATES_MYORACLESUPPORT_USERNAME=AUTOUPDATES_MYORACLESUPPORT_PASSWORD=PROXY_HOST=PROXY_PORT=PROXY_USER=PROXY_PWD=PROXY_REALM=

1.3.1 静默安装

./runInstaller -responseFile /u02/soft/grid/response/grid_install.rsp -silent -ignorePrereq -showProgress

过程如下:

Starting Oracle Universal Installer...Checking Temp space: must be greater than 120 MB. Actual 20827 MB PassedChecking swap space: must be greater than 150 MB. Actual 4015 MB PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2018-12-01_03-47-21PM. Please wait ...

按提示执行脚本

-- root用户执行root.sh

# /u02/app/11.2.0/grid/root.shCheck /u02/app/11.2.0/grid/install/root_nwppdb01_2018-12-01_15-54-30.log for the output of root script

-- 启动资源$ crsctl start resource -all

-- 检查has,css,evm都是online

crsctl check hascrsctl check csscrsctl check evm

-- 创建密码文件

$ cd $ORACLE_HOME/dbs$ orapwd file=orapw+ASM password=oracle entries=10 ignorecase=y

-- grid用户执行配置

$ /u02/app/11.2.0/grid/cfgtoollogs/configToolAllCommands RESPONSE_FILE=/u02/soft/grid/response/grid_install.rsp2. 创建ASM实例

-- ASM实例参数文件

INSTANCE_TYPE=ASMDB_UNIQUE_NAME=+ASMASM_POWER_LIMIT=1ASM_DISKSTRING=/dev/mapper/ora*ASM_DISKGROUPS=data1LARGE_POOL_SIZE=16M

-- 启动到nomount

SQL> startup nomount pfile='$ORACLE_HOME/dbs/init+ASM.ora'ASM instance startedTotal System Global Area 1135747072 bytesFixed Size 2260728 bytesVariable Size 1108320520 bytesASM Cache 25165824 bytes3. 创建ASM磁盘组DATA1

3.1 查询可用ASM磁盘

3.2 创建磁盘组

创建ASM磁盘组data1,普通冗余,指定2个故障组。

create diskgroup data1 normal redundancyfailgroup fg1 disk '/dev/mapper/ora_vg-lv_asm1' name d1afailgroup fg2 disk '/dev/mapper/ora_vg-lv_asm2' name d1b;

执行过程输出信息:

3.3 注册磁盘组到crsctl中

3.3.1 添加asm服务

[grid@nwppdb01 ~]$ srvctl add asm[grid@nwppdb01 ~]$ crsctl stat res -t-------------NAME TARGET STATE SERVER STATE_DETAILS--------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.LISTENER.lsnr ONLINE ONLINE nwppdb01ora.asm OFFLINE OFFLINE nwppdb01ora.ons OFFLINE OFFLINE nwppdb01--------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.cssd 1 ONLINE ONLINE nwppdb01ora.diskmon 1 OFFLINE OFFLINEora.evmd 1 ONLINE ONLINE nwppdb01

3.3.2 创建spfile,重启ASM实例

3.3.3 查看资源,DATA1磁盘组已经自动注册

$ crsctl stat res -t------------NAME TARGET STATE SERVER STATE_DETAILS--------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.DATA1.dg ONLINE ONLINE nwppdb01ora.LISTENER.lsnr ONLINE ONLINE nwppdb01ora.asm ONLINE ONLINE nwppdb01 Startedora.ons OFFLINE OFFLINE nwppdb01--------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.cssd 1 ONLINE ONLINE nwppdb01ora.diskmon 1 OFFLINE OFFLINEora.evmd 1 ONLINE ONLINE nwppdb01

这是之前做的一些实验,大家有空可以在虚拟机试一下。后面会发更多关于devops和DBA内容,感兴趣的朋友可以关注下。

夜天资讯版权声明:对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!

linux asm
网速管家去广告版的简单介绍 占豪新浪博客直播(占豪博客新浪博客首页)

游客 回复需填写必要信息