好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

oracle11g

在 oracle11g 中,配置 asm 实例会用到 raw (裸设备)或者 asmlib 或者直接使用磁盘分区(这个特性也是 11g 的特性)。由于 oracle11g 中,已经将 asm 和数据库完全脱离,这句话的意思就是以前在 10g 的时候, asm 实例是在安装 oracle 软件之后,才配置实

在 oracle11g 中,配置 asm 实例会用到 raw (裸设备)或者 asmlib 或者直接使用磁盘分区(这个特性也是 11g 的特性)。由于 oracle11g 中,已经将 asm 和数据库完全脱离,这句话的意思就是以前在 10g 的时候, asm 实例是在安装 oracle 软件之后,才配置实例(借助 dbca ),而在 oracle11g 中, asm 实例已经由 grid 单独安装来配置了,也是 11g 中的第一大特性。

Linux 5 下的操作:

1) 使用 raw 设备

在创建 3 个分区 sda8,sda9,sda10 之后 ,start_udev (具体如何在 linux5 下创建 raw ,在此不介绍),从而有了 3 个 raw ,即 /dev/raw/raw1 /dev/raw/raw2 /dev/raw/raw3

2) 使用 asmlib

在创建了 3 个分区之后,可以使用如下命令,创建 3 个 asmdisk :

#/etc/init.d/oracleasm createdisk asmdisk01 /dev/sda8

#/etc/init.d/oracleasm createdisk asmdisk02 /dev/sda9

#/etc/init.d/oracleasm createdisk asmdisk03 /dev/sda10

查看 asmdisk :

#/etc/init.d/oracleasm listdisks

ASMDISK01

ASMDISK02

ASMDISK03

3) 直接使用磁盘分区,由于这个比较简单,只需要安装 grid 时,测试一下即可。

如上,现在已经建好了两种方式下的 asm 可用 disk ,现在安装 grid 的过程中,可能由于磁盘组的问题,最终导致没有安装成功,但 crs 已经没有问题了,如下:

[grid@yanfa2 dbs]$ crs_stat -t -v

Name Type R/RA F/FT Target State Host

----------------------------------------------------------------------

ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE yanfa2

ora.cssd ora.cssd.type 0/5 0/5 ONLINE ONLINE yanfa2

ora.diskmon ora....on.type 0/10 0/5 ONLINE ONLINE yanfa2

但 asm 实例确不能启动,错误信息如下:

SQL> startup

ORA-00099: warning: no parameter file specified for ASM instance

ASM instance started

Total System Global Area 283930624 bytes

Fixed Size 2212656 bytes

Variable Size 256552144 bytes

ASM Cache 25165824 bytes

ORA-15110: no diskgroups mounted

此时有两个问题,第一个就是没有 asm 实例启动需要的参数文件,目前使用的默认值,还有第二个问题就是没有 diskgroup ,用 asmcmd 也可以查看到,目前实例是没有 diskgroup 的。

解决办法就是用创建 diskgroup ,可以用 asmca ,打开页面之后,能看到 6 块 disk ,其中 3 块是 /dev/raw/raw* 格式的,另 3 块是 ORCL:ASMDISK0* 格式的,如果此时选择 ORCL: 这样的 disk ,那么此 diskgroup 是不会创建成功的,换成用 /dev/raw/raw* 的, create asm 时就可以成功了。然后在实例起来之后,也可以用命令创建另一个 diskgroup ,如下:

CREATE DISKGROUP fra EXTERNAL REDUNDANCY DISK 'ORCL:ASMDISK03';

CREATE DISKGROUP fra EXTERNAL REDUNDANCY DISK 'ORCL:ASMDISK03'

*

ERROR at line 1:

ORA-15018: diskgroup cannot be created

ORA-15072: command requires at least 1 failure groups, discovered only 0

此时,再查看以下信息:

SQL> create diskgroup fra external redundancy disk '/dev/raw/raw3';

Diskgroup created.

SQL> select PATH, MOUNT_STATUS, HEADER_STATUS, MODE_STATUS, STATE from V$ASM_DISK;

PATH

--------------------------------------------------------------------------------

MOUNT_S HEADER_STATU MODE_ST STATE

------- ------------ ------- --------

ORCL:ASMDISK03

CLOSED UNKNOWN ONLINE NORMAL

ORCL:ASMDISK01

CLOSED UNKNOWN ONLINE NORMAL

ORCL:ASMDISK02

CLOSED UNKNOWN ONLINE NORMAL

PATH

--------------------------------------------------------------------------------

MOUNT_S HEADER_STATU MODE_ST STATE

------- ------------ ------- --------

/dev/raw/raw2

CACHED MEMBER ONLINE NORMAL

/dev/raw/raw1

CACHED MEMBER ONLINE NORMAL

/dev/raw/raw3

CACHED MEMBER ONLINE NORMAL

6 rows selected.

可以看出,一旦使用 /dev/raw/raw* 的 disk 是可以创建成功的,再来看下 ORCL:ASMDISK0* 的 header_status 的状态为 UNKNOWN 。根据 metalink 上的一篇文章【 ID 396015.1】 ,如下:

Applies to:

Oracle Server - Enterprise Edition - Version: 10.2.0.1 to 10.2.0.4 - Release: to 10.2

Information in this document applies to any platform.

Symptoms

When a diskgroup with external redundancy needs to be created on a NetApps with iSCSI following errors might occur:

CREATE DISKGROUP KNVB EXTERNAL

REDUNDANCY DISK 'ORCL:DISK1';

CREATE DISKGROUP KNVB EXTERNAL REDUNDANCY DISK 'ORCL:DISK1'

*

ERROR at line 1:

ORA-15018: diskgroup cannot be created

ORA-15072: command requires at least 1 failure groups, discovered only 0

Error message from bdump alert log file

=======================================

...

Wed Oct 18 15:45:46 2006

ORA-15186: ASMLIB error function = [asm_open], error = [1], mesg = [Operation not permitted]

Wed Oct 18 15:45:46 2006

ORA-15186: ASMLIB error function = [asm_open], error = [1], mesg = [Operation not permitted]

The disk HEADER_STATUS from V$ASM_DISK is UNKNOWN instead of CANDIDATE or PROVISIONED

Cause

Oracleasm is able to create and stamp the ASM disk, because the soft link from the mapper,

but the ASM instance cannot see the disks (HEADER_STATUS is UKNOWN instead of PROVISONED) as the soft links were mounted in /etc/fstab as /data/...

If NetApp is used, then the /etc/fstab file should be checked.

The disks stammped by oracleasm should not be present in this file.

If EMC based storage but use the normal Linux multipath driver is used, then the following map settings should be set in /etc/sysconfig/oracleasm

# ORACLEASM_SCANORDER: Matching patterns to order disk scanning

ORACLEASM_SCANORDER="multipath sd"

# ORACLEASM_SCANEXCLUDE: Matching patterns to exclude disks from scan ORACLEASM_SCANEXCLUDE="sd"

Solution

1. If the customer is using NetApp check the /etc/fstab file for any mount points including the NetApp disks

E.g: umount /data/....

Connect to the ASM instance

conn / as sysdba

select PATH, MOUNT_STATUS, HEADER_STATUS, MODE_STATUS, STATE from V$ASM_DISK;

You should see the HEADER_STATUS as PROVISIONED instead of UNKNOWN.

Now you can create the diskgroup with external redundancy

Eg:CREATE DISKGROUP KNVB EXTERNAL REDUNDANCY DISK 'ORCL:DISK1';

2. If EMC based storage but use the normal Linux multipath driver is used, then please make the following changes in the /etc/sysconfig/oracleasm file.

# ORACLEASM_SCANORDER: Matching patterns to order disk scanning

ORACLEASM_SCANORDER="multipath sd"

# ORACLEASM_SCANEXCLUDE: Matching patterns to exclude disks from scan ORACLEASM_SCANEXCLUDE="sd"

Note that the asm_diskstring should be set to "ORCL:*"

以上信息为文章内容,根据提示,可以将 /etc/sysconfig/oracleasm 修改下,并且我在 asm 的 $ORACLE_HOME/dbs 下创建了一个参数文件 init+ASM.ora ,内容只有

*.asm_diskgroups = ‘DATA’

*.asm_diskstring = ‘ORCL:*’

经过如上修改,在 restart oracleasm 之后, asm 终于正常了。

SQL> ALTER DISkgroup fra mount;

Diskgroup altered.

SQL> select PATH, MOUNT_STATUS, HEADER_STATUS, MODE_STATUS, STATE from V$ASM_DISK;

PATH

--------------------------------------------------------------------------------

MOUNT_S HEADER_STATU MODE_ST STATE

------- ------------ ------- --------

ORCL:ASMDISK01

CACHED MEMBER ONLINE NORMAL

ORCL:ASMDISK02

CACHED MEMBER ONLINE NORMAL

ORCL:ASMDISK03

CACHED MEMBER ONLINE NORMAL

查看更多关于oracle11g的详细内容...

  阅读:42次