In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Capacity expansion experiment of oracle 11g ASM disk pack:
This host is a test machine I often use, because in order to learn ASM, the underlying storage uses ASM, but the disk group was only 4G when it was planned before. due to the increase of data files, there is no available space. Therefore, the experiment of online expansion of ASM is done in the simulated production environment.
It is recommended that you back up the database before doing it.
-1. Host and database environment--
SQL > select * from v$version
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
PL/SQL Release 11.2.0.3.0-Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0-Production
NLSRTL Version 11.2.0.3.0-Production
[root@ray] # lsb_release-a
LSB Version:: core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.6 (Carthage)
Release: 5.6
Codename: Carthage
[root@ray ~] #
-- 2. Storage environment-
Since I am using a virtual machine, it is easy to add a hard disk to the virtual machine. We add a 5G disk and restart the host. Through the query below, we can see that our / dev/sde is the hard disk we added.
1. [root@ray ~] # ls-l / dev/sd*
Brw-r- 1 root disk 8, 0 Dec 18 21:17 / dev/sda
Brw-r- 1 root disk 8, 1 Dec 18 21:18 / dev/sda1
Brw-r- 1 root disk 8, 2 Dec 18 21:18 / dev/sda2
Brw-r- 1 root disk 8, 3 Dec 18 21:17 / dev/sda3
Brw-r- 1 root disk 8, 4 Dec 18 21:17 / dev/sda4
Brw-r- 1 root disk 8, 5 Dec 18 21:18 / dev/sda5
Brw-r- 1 root disk 8, 16 Dec 18 21:17 / dev/sdb
Brw-r- 1 root disk 8, 32 Dec 18 21:17 / dev/sdc
Brw-r- 1 root disk 8, 48 Dec 18 21:17 / dev/sdd
Brw-r- 1 root disk 8, 49 Dec 18 21:17 / dev/sdd1
Brw-r- 1 root disk 8, 64 Dec 18 21:17 / dev/sde
[root@ray ~] # fdisk / dev/sde
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only
Until you decide to write them. After that, of course, the previous
Content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w (rite)
Command (m for help): Q
[root@ray ~] # fdisk-l
Disk / dev/sda: 21.4 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/ dev/sda1 * 1 25 200781 83 Linux
/ dev/sda2 26 286 2096482 + 83 Linux
/ dev/sda3 287 547 2096482 + 82 Linux swap / Solaris
/ dev/sda4 548 2610 16571047 + 5 Extended
/ dev/sda5 548 2610 16571016 83 Linux
Disk / dev/sdb: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk / dev/sdb doesn't contain a valid partition table
Disk / dev/sdc: 2147 MB, 2147483648 bytes
255 heads, 63 sectors/track, 261 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk / dev/sdc doesn't contain a valid partition table
Disk / dev/sdd: 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/sdd1 1 623 5004216 83 Linux
Disk / dev/sde: 5368 MB, 5368709120 bytes-you can see it is 5G
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk / dev/sde doesn't contain a valid partition table
-3. Bind physical devices--
[root@ray] # / bin/raw / dev/raw/raw3 / dev/sde
/ dev/raw/raw3: bound to major 8, minor 64
-4. Configure UDEV rules--
[root@ray ~] # vi / etc/udev/rules.d/60-raw.rules
# Enter raw device bindings here.
#
# An example would be:
# ACTION== "add", KERNEL== "sda", RUN+= "/ bin/raw / dev/raw/raw1% N"
# to bind / dev/raw/raw1 to / dev/sda, or
# ACTION== "add", ENV {MAJOR} = = "8", ENV {MINOR} = = "1", RUN+= "/ bin/raw / dev/raw/raw2% M% m"
# to bind / dev/raw/raw2 to the device with major 8, minor 1.
#
ACTION== "add", KERNEL== "/ dev/sdb", RUN+= "/ bin/raw / dev/raw/raw1% N", OWNER= "grid", GROUP= "asmadmin", MODE= "0660"
ACTION== "add", KERNEL== "/ dev/sdc", RUN+= "/ bin/raw / dev/raw/raw2% N", OWNER= "grid", GROUP= "asmadmin", MODE= "0660
# add:
ACTION== "add", KERNEL== "/ dev/sde", RUN+= "/ bin/raw / dev/raw/raw3% N", OWNER= "grid", GROUP= "asmadmin", MODE= "0660
KERNEL== "raw*", WNER= "grid", GROUP= "asmadmin", MODE= "0660"
Chown grid:oinstall / dev/raw/raw* "
~
~
-5. Configure the control file for RAW--
[root@ray ~] # vi / etc/sysconfig/rawdevices
# raw device bindings
# format:
#
# example: / dev/raw/raw1 / dev/sda1
# / dev/raw/raw2 8 5
/ dev/raw/raw1 / dev/sdb
/ dev/raw/raw2 / dev/sdc
/ dev/raw/raw3 / dev/sde
~
[root@ray ~] # ls-l / dev/raw/raw*
Crw-rw---- 1 grid asmadmin 162, 1 Aug 21 17:28 / dev/raw/raw1
Crw-rw---- 1 grid asmadmin 162, 2 Aug 21 17:28 / dev/raw/raw2
Crw-rw---- 1 grid asmadmin 162, 3 Aug 21 17:27 / dev/raw/raw3
Above, we have finished our operation at the house level. Next we are going to do it at the database level.
-- DATA expansion--
1. Log in to database server node 1 to view the ASM disk group space as the grid user:
[root@ray ~] # su-grid
Grid@ray:/home/grid > asmcmd
ASMCMD > lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 4096 174 0 87 0 N DATA/
Note: as you can see, our DATA disk has only 174m of available capacity.
two。 In a production environment, adding disks to a disk group takes a long time to balance, so we first query the value of asm_power_limit and adjust it to 10
Grid@ray:/home/grid > sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Thu Aug 21 17:30:36 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
With the Automatic Storage Management option
SQL > show parameter asm_power_limit
NAME TYPE VALUE
-
Asm_power_limit integer 1
SQL > alter system set asm_power_limit=10 scope=both
System altered.
SQL > show parameter asm_power_limit
NAME TYPE VALUE
-
Asm_power_limit integer 10
3. View disk group usage and disk name and path
SQL > select group_number,name,state,total_mb,free_mb from v$asm_diskgroup
GROUP_NUMBER NAME STATE TOTAL_MB FREE_MB
1 DATA MOUNTED 4096 174
SQL > col name for A10
SQL > col path for A30
SQL > select name,path from v$asm_disk
NAME PATH
DATA_0001 / dev/raw/raw2
DATA_0000 / dev/raw/raw1
DATA_0002 / dev/raw/raw3
4. Add the newly added disks to the DATA disk group:
Grid@ray:/home/grid > sqlplus / as sysasm
SQL*Plus: Release 11.2.0.3.0 Production on Thu Aug 21 17:31:59 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production
With the Automatic Storage Management option
Note: you must operate as sysasm here, otherwise error ORA-15032 and ORA-15260 will be reported, which is an improvement in disk management of oracle 11G ASM.
SQL > alter diskgroup DATA add disk'/ dev/raw/raw3'
Diskgroup altered.
5. Check to see if the addition is complete
SQL > col name for A10
SQL > col path for A30
SQL > select name,path from v$asm_disk
NAME PATH
DATA_0001 / dev/raw/raw2
DATA_0000 / dev/raw/raw1
DATA_0002 / dev/raw/raw3
6. Make data redundant
Modify the rebalance speed of the current diskgroup group to 10:
SQL > alter diskgroup DATA rebalance power 10
Diskgroup altered.
Check the time it takes to rebalance: it's over here, because the disk is only 5G.
SQL > select operation,est_minutes from v$asm_operation
OPERA EST_MINUTES
--
REBAL 0
SQL > select name,path from v$asm_disk
NAME PATH
DATA_0001 / dev/raw/raw2
DATA_0000 / dev/raw/raw1
DATA_0002 / dev/raw/raw3
7. Change the parameters back
SQL > alter diskgroup DATA rebalance power 1
Diskgroup altered.
SQL > alter system set asm_power_limit=1 scope=both
System altered.
Querying the capacity of the DATA disk group, you can see that we have increased the capacity by 5G.
SQL > select group_number,name,state,total_mb,free_mb from v$asm_diskgroup
GROUP_NUMBER NAME STATE TOTAL_MB FREE_MB
--
1 DATA MOUNTED 9216 5233
You are welcome to criticize and correct:
QQ communication group: 300392987
On the altar: www.oraclefreebase.com
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.