设为首页 收藏本站
查看: 661|回复: 0

[经验分享] Oracle ASM for linx as 4 x86-64 创建过程

[复制链接]

尚未签到

发表于 2016-7-29 12:22:33 | 显示全部楼层 |阅读模式
1、划分区

Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         499     4008186   83  Linux
/dev/sdb2             500         585      690795   83  Linux
/dev/sdb3             586         622      297202+  83  Linux
/dev/sdb4             623         652      240975   83  Linux

其中以下分区用于创建ASM盘   
/dev/sdb2
/dev/sdb3
/dev/sdb4

2、下载和内核相关的asm rpm包,其网址为
http://www.oracle.com/technology/tech/linux/asmlib/index.html

当前内核为
[iyunv@dbsvr /]# uname -a
Linux dbsvr 2.6.9-42.EL #1 Wed Jul 12 23:15:20 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux

[iyunv@dbsvr admin]# more /etc/issue
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
Kernel \r on an \m

下载asm包的版本为
[iyunv@dbsvr tmp]# rpm -qa|grep asm
oracleasm-support-2.1.3-1.el4
oracleasm-2.6.9-42.EL-debuginfo-2.0.5-1.el4
oracleasmlib-2.0.4-1.el4
oracleasm-2.6.9-42.EL-2.0.5-1.el4

3、安装rpm包
其安装顺序为
[iyunv@dbsvr tmp]# rpm -ivh oracleasm-support-2.1.3-1.el4.x86_64.rpm
Preparing...                ########################################### [100%]
   1:oracleasm-support      ########################################### [100%]
[iyunv@dbsvr tmp]# rpm -ivh  oracleasm-2.6.9-42.EL-2.0.5-1.el4.x86_64.rpm
Preparing...                ########################################### [100%]
   1:oracleasm-2.6.9-42.EL  ########################################### [100%]
[iyunv@dbsvr tmp]# rpm -ivh oracleasm-2.6.9-42.EL-debuginfo-2.0.5-1.el4.x86_64.rpm
Preparing...                ########################################### [100%]
   1:oracleasm-2.6.9-42.EL-d########################################### [100%]
[iyunv@dbsvr tmp]# rpm -ivh  oracleasmlib-2.0.4-1.el4.x86_64.rpm
Preparing...                ########################################### [100%]
   1:oracleasmlib           ########################################### [100%]
   
4、配置asm lib

[iyunv@dbsvr tmp]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface []: oracle
Default group to own the driver interface []: dba
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [FAILED]

晕,出问题了,尝试将SELINUX设置disabled
[iyunv@dbsvr tmp]#  vi /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

[iyunv@dbsvr tmp]#  setenforce 0
[iyunv@dbsvr tmp]#  /usr/sbin/sestatus
SELinux status:         enabled
SELinuxfs mount:        /selinux
Current mode:           permissive
Mode from config file:  disabled
Policy version:         18
Policy from config file:targeted

Policy booleans:
allow_syslog_to_console inactive
allow_ypbind            inactive
dhcpd_disable_trans     inactive
httpd_builtin_scripting active
httpd_disable_trans     inactive
httpd_enable_cgi        active
httpd_enable_homedirs   active
httpd_ssi_exec          active
httpd_tty_comm          inactive
httpd_unified           active
mysqld_disable_trans    inactive
named_disable_trans     inactive
named_write_master_zonesinactive
nscd_disable_trans      inactive
ntpd_disable_trans      inactive
pegasus_disable_trans   inactive
portmap_disable_trans   inactive
postgresql_disable_transinactive
snmpd_disable_trans     inactive
squid_disable_trans     inactive
syslogd_disable_trans   inactive
use_nfs_home_dirs       inactive
use_samba_home_dirs     inactive
use_syslogng            inactive
winbind_disable_trans   inactive
ypbind_disable_trans    inactive

[iyunv@dbsvr tmp]# reboot

Broadcast message from root (pts/2) (Sun Aug 23 17:01:10 2009):

The system is going down for reboot NOW!
[iyunv@dbsvr tmp]# /usr/sbin/sestatus
SELinux status:         disabled

[iyunv@dbsvr tmp]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting <ENTER> without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface [oracle]:
Default group to own the driver interface [dba]:
Start Oracle ASM library driver on boot (y/n) [y]:
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [  OK  ]
Scanning the system for Oracle ASMLib disks: [  OK  ]

可以利用 /etc/init.d/oracleasm 的 'enable' 和 'disable' 选项来启用或禁用自动启动。

[iyunv@dbsvr tmp]# /etc/init.d/oracleasm disable
Writing Oracle ASM library driver configuration: done
Dropping Oracle ASMLib disks: [  OK  ]
Shutting down the Oracle ASMLib driver: [  OK  ]

[iyunv@dbsvr tmp]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [  OK  ]
Scanning the system for Oracle ASMLib disks: [  OK  ]

5、对磁盘组的操作

1)创建asm磁盘组

[iyunv@dbsvr tmp]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb2
Marking disk "VOL1" as an ASM disk: [  OK  ]
[iyunv@dbsvr tmp]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdb3
Marking disk "VOL2" as an ASM disk: [  OK  ]
[iyunv@dbsvr tmp]# /etc/init.d/oracleasm createdisk VOL3 /dev/sdb4
Marking disk "VOL3" as an ASM disk: [  OK  ]

注意:磁盘名称是 ASCII 大写字母、数字和下划线。它们必须以字母开始。

2)当然不再被 ASM 使用的磁盘也可以取消标记

[iyunv@dbsvr tmp]#  /etc/init.d/oracleasm deletedisk VOL1
Removing ASM disk "VOL1": [  OK  ]

3)可以查询任意的操作系统磁盘,以了解它是否被 ASM 使用:

[iyunv@dbsvr tmp]# /etc/init.d/oracleasm querydisk /dev/sdb2
Device "/dev/sdb2" is marked an ASM disk with the label "VOL1"
[iyunv@dbsvr tmp]# /etc/init.d/oracleasm querydisk /dev/sdb3
Device "/dev/sdb3" is marked an ASM disk with the label "VOL2"
[iyunv@dbsvr tmp]# /etc/init.d/oracleasm querydisk /dev/sdb4
Device "/dev/sdb4" is marked an ASM disk with the label "VOL3"

4)可以列出和查询现有的磁盘:

[iyunv@dbsvr tmp]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3

[iyunv@dbsvr tmp]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
[iyunv@dbsvr tmp]# /etc/init.d/oracleasm querydisk VOL1
Disk "VOL1" is a valid ASM disk


当向 RAC 设置中添加磁盘时,需要通知其他节点该磁盘的存在。在一个节点上运行 'createdisk' 命令,然后在其他每一个节点上运行 'scandisks':

[iyunv@dbsvr tmp]# /etc/init.d/oracleasm scandisks
Scanning the system for Oracle ASMLib disks: [  OK  ]


5、利用dbca建库时,需要运行脚本,注意是root用户,但环境变量是oracle

[iyunv@dbsvr bin]# localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized

Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
        dbsvr
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)

建库时报ora-12547错误,需要安装如下包:

[iyunv@dbsvr tmp]# rpm -qa|grep libaio
libaio-0.3.105-2
libaio-0.3.105-2
libaio-devel-0.3.105-2

附:ASM实例可以手工创建,也可以通过dbca创建,如手工创建
1、创建asm参数
[oracle@dbsvr dbs]$ more spfile+ASM.ora


+ASM.asm_diskgroups='ASMDISK'#Manual Mount
*.asm_diskgroups='ASMDISK'
*.background_dump_dest='/oracle/app/admin/+ASM/bdump'
*.core_dump_dest='/oracle/app/admin/+ASM/cdump'
*.instance_type='asm'
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/oracle/app/admin/+ASM/udump'


2、创建diskgroup组
SQL> ALTER DISKGROUP ALL MOUNT
Sun Aug 23 18:26:49 2009
Loaded ASM Library - Generic Linux, version 2.0.4 (KABI_V2) library for asmlib interface
Sun Aug 23 18:29:24 2009
SQL> CREATE DISKGROUP asmdisk External REDUNDANCY  DISK '/dev/sdb2' SIZE 674M ,'/dev/sdb3' SIZE 290M ,'/dev/sdb4' SIZE 235M ,'/dev/sdc1' SIZE 1913M;

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-251233-1-1.html 上篇帖子: 双机容错环境Oracle数据库应用 下篇帖子: Installing Oracle 9iR2 on RHEL AS 3 Step-by-Step
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表