Implementation of ASM Resizing in VirtualBox

Source: Internet
Author: User

Implementation of ASM Resizing in VirtualBox

Implement online ASM resizing

1. First disable the Cluster
[Root @ node1 bin] #./crsctl stop crs
[Root @ node2 bin] #./crsctl stop crs

Shutdown, halt

Create two vdi disks on the first host, set the sharing, and attach them to node2.
Asmn6.vdi 5G
Asmn7.vdi 8G

2. Start mounting and create disk partitions for Oracle ASM

[Root @ node1 dev] # ls-la sd *
Brw-rw ---- 1 root disk 8, 0 May 9 20:56 sda
Brw-rw ---- 1 root disk 8, 1 May 9 20:56 sda1
Brw-rw ---- 1 root disk 8, 2 May 9 20:56 sda2
Brw-rw ---- 1 root disk 8, 96 May 9 20:56 sdg
Brw-rw ---- 1 root disk 8,112 May 9 sdh

[Root @ node1 ~] # Fdisk-l

Disk/dev/sdg: 5368 MB, 5368709120 bytes

Disk/dev/sdh: 8589 MB, 8589934592 bytes

Two sdg and sdh disks found

3. format the partition: ### or not.
Fdisk/dev/sdg
Fdisk/dev/sdh

Command (m for help): n
E extended
P primary partition (1-4) p
Partition number (1-4): 1
First cylinder (1-512, default 1 ):
Using default value 1
Last cylinder or + size or + sizeM or + sizeK (1-2610, default 2610 ):
Using default value 2610
Command (m for help): w
The partition table has been altered!
Calling ioctl () to re-read partition table.
Syncing disks.

Method 1: bind a bare device with UDEV

Vi/etc/udev/rules. d/60-raw.rules

ACTION = "add", KERNEL = "sdg", RUN + = "/bin/raw/dev/raw/raw1% N"
ACTION = "add", KERNEL = "sdh", RUN + = "/bin/raw/dev/raw/raw2% N"
ACTION = "add", KERNEL = "raw [1-2]", OWNER = "grid", GROUP = "asmadmin", MODE = "660"

View bare devices:
Raw-qa
/Dev/raw/raw1: bound to major 8, minor 96
/Dev/raw/raw2: bound to major 8, minor 112

Transfer to node2:
Scp/etc/udev/rules. d/60-raw.rules node2:/etc/udev/rules. d/

Partprobe
Start_UDEV

Method 2: bind a disk to UDEV
For I in g h;
Do
Echo "KERNEL = \" sd * \ ", BUS = \" scsi \", PROGRAM = \ "/sbin/scsi_id-g-u-s % p \", RESULT = \ "'scsi _ id-g-u-s/block/sd $ I '\", NAME = \ "asm-disk $ I \", owners = \ "grid \", GROUP = \ "asmadmin \", MODE = \ "0660 \""
Done

KERNEL = "sd *", BUS = "scsi", PROGRAM = "/sbin/scsi_id-g-u-s % p", RESULT = "360080e50003f55d6000007a7535c0dad ", NAME = "asm-diskc", OWNER = "grid", GROUP = "asmadmin", MODE = "0660"
KERNEL = "sd *", BUS = "scsi", PROGRAM = "/sbin/scsi_id-g-u-s % p", RESULT = "360080e50003f55d6000007a9535c0dd1 ", NAME = "asm-diske", OWNER = "grid", GROUP = "asmadmin", MODE = "0660"

Vi/etc/udev/rules. d/99-oracle-asmdevices.rules

KERNEL = "sd *", BUS = "scsi", PROGRAM = "/sbin/scsi_id-g-u-s % p", RESULT = "360080e50003f55d6000007a7535c0dad ", NAME = "asm-diskc", OWNER = "grid", GROUP = "asmadmin", MODE = "0660"
KERNEL = "sd *", BUS = "scsi", PROGRAM = "/sbin/scsi_id-g-u-s % p", RESULT = "360080e50003f55d6000007a9535c0dd1 ", NAME = "asm-diske", OWNER = "grid", GROUP = "asmadmin", MODE = "0660"

Transfer to another node.
Scp/etc/udev/rules. d/99-oracle-asmdevices.rules jdserver24:/etc/udev/rules. d/
Artprobe
Start_udev
[Root @ quan-rac1/] # ls-la/dev/*
Crw-rw ---- 1 root audio 14, 12 Jul 26 12:58/dev/adsp
Brw-rw ---- 1 oracle oinstall 8, 32 Jul 26 13:40/dev/asm-diskg
Brw-rw ---- 1 oracle oinstall 8, 48 Jul 26 13:40/dev/asm-diskh

4. ASM disk operations

View the disk group status:
Select group_number, total_mb, required_assist_free_mb, free_mb, usable_file_mb, state from v $ asm_diskgroup;

GROUP_NUMBER TOTAL_MB required_pai_free_mb FREE_MB USABLE_FILE_MB STATE
--------------------------------------------------------------------------------
1 1024 0 922 922 MOUNTED
2 1024 0 748 748 MOUNTED
3 3072 0 468 468 MOUNTED
4 1024 0 628 628 MOUNTED

-- TOTAL_MB: size of the disk group
-- FREE_MB: The remaining space without considering Redundancy
-- USABLE_FILE_MB: 1). In case of external redundancy, USABLE_FILE_MB = FREE_MB
2). General redundancy USABLE_FILE_MB = FREE_MB/2
3). High redundancy USABLE_FILE_MB = FREE_MB/3

Select group_number, disk_number, name, failgroup, state, path from v $ asm_disk order by 1, 2;

SELECT GROUP_NUMBER, OPERATION, STATE, POWER, EST_MINUTES from v $ ASM_OPERATION;

Check asm_diskstring to see if the newly added disk is in the corresponding directory.
Show parameter asm_diskstring

Set asm_diskstring
Alter system set asm_diskstring = '/dev/asm *', '/dev/raw *' sid = '*';

ASM_DISKSTRING = 'path1' [, 'path2',...]
In simple terms, it is to set the disk to be checked when the ASM starts. This option can specify multiple values at the same time and support wildcards. For example, to check only the devices under/dev/dsk/, you can set this parameter as follows:/dev/dsk/*. If this parameter is null by default, ASM searches for all devices in the system that have read and write permissions on ASM.
ASM_DISKSTRING specifies an operating system-dependent value used by Automatic Storage Management to limit the set of disks considered for discovery. when a new disk is added to a disk group, each Automatic Storage Management instance that has the disk group mounted must be able to discover the new disk using the value of ASM_DISKSTRING.
An attempt to dynamically modify ASM_DISKSTRING will be rejected and the old value retained if the new value cannot be used to discover a disk that is in a disk group that is already mounted.


Create an external redundant disk group:
Create diskgroup AUX_DATA external redundancy disk '/dev/asm-diskg', '/dev/asm-diskh ';

Add a disk to an existing Disk:
Alter diskgroup DT02 add disk '/dev/raw/raw1','/dev/raw/raw2' rebalance power 10;

Select * from v $ asm_opration;

Note:
The newly added asmdiskgroup cannot be automatically mounted after the instance is restarted. The reason is that asm uses pfile to start the instance. By default, it will find the diskgroup listed by the asm_diskgroups parameter and execute mount when the instance is started.
To avoid automatic mount failure of some diskgroups, you can use the following two methods:
Manually modify pfile, and change asm_diskgroups to PROD_DATA and AUX_DATA.
Create spfile: create spfile from pfile;
Alter system set asm_diskgroups = PROD_DATA, AUX_DATA sid = '*';

Finally:
SQL> select GROUP_NUMBER, DISK_NUMBER, NAME, PATH, TOTAL_MB, FREE_MB from v $ asm_disk order by NAME;

How to change the password of ASM sys

How to copy data files in ASM to the Operating System

Restoration After all Oracle 11g rac asm disks are lost

Oracle 11g from entry to proficient in PDF + CD source code

Installing Oracle 11g R2 using RHEL6 ASM

Oracle 10g manual creation of the ASM Database

Solutions to various problems after installing Oracle 11gR2 in Ubuntu 12.04 (amd64)

How to change the sys password of Oracle 10g ASM

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.