In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how ASM is managed. Xiaobian thinks it is quite practical, so share it with you for reference. I hope you can gain something after reading this article.
I. Create/delete asm disk groups:
1. Creating ASM disks on the operating system
/etc/init.d/oracleasm create VOL4 /dev/sde1
2. Add this block asm disk to oralce
create diskgroup diskgroup_name
redundancy
failgroup failgroup_name disk 'disk_nmae' name asm_disk_name
...
;
Description:
Limit on the number of failgroups:
HIGH ---------- failgroup >= 3
NORMAL ---------- failgroup >= 2
EXTERNAL ------- failgroup == 0 (failure group cannot be specified)
SQL>create diskgroup DATA2 external redundancy disk 'ORCL:VOL 4';--If you are creating an external disk group, you do not need to specify a failure group.
SQL>create diskgroup DATA2 normal redundnacy
failgroup DATA2_FG_1 disk
'ORCL:VOL4'
failgroup DATA2_FG_2 disk
'ORCL:VOL6'
/ --Create a normal disk group with two failure groups.
3. drop a disk group
SQL>drop diskgroup DATA2; --The deleted diskgroup must be mounted
4. Mount/unmount disk groups
SQL>alter disgroup DATA2 mount/dismount;
II. Add/remove disks to ASM disk groups:
1. Add disks to the specified failure group
SQL> alter diskgroup diskgroup_name
add failgroup failgroup_name disk 'disk_name' name asm_disk_name [force];
2. Add disk and add a new fault group
SQL>alter diskgroup dgdata2
add disk 'disk_name' name asm_disk_name; --Failure group name not specified, name same as name field
SQL> alter diskgroup DATA1 add disk 'ORCL:VOL 4';--Failure group name and ASM disk name are not specified, their names are specified uniformly by the system.
3. Delete disk
SQL> alter diskgroup DATA1 drop disk 'ORCL:VOL4';
4, the fault group delete the disk while adding a new disk
SQL>alter diskgroup diskgroup_name
drop disk 'asm_disk_name'
add failgroup failgroup_name disk 'disk_name' name asm_disk_name [force]; --The goal is to reduce the resource consumption of rebalancing.
Description:
1. When adding disks, if the fault group name is not specified, the system defaults to the name after the fault group name. If no name field is specified, the system specifies it automatically.
2. When adding or deleting disks, rebalancing operations will occur.
3. force means to forcibly pull disks from other disk groups and join the disk group currently operating. (Required to be pulled disk group DISMOUNT).
4, delete the disk at the same time add new disk, disk group only once rebalancing. If you add a new disk after you delete it, you need to rebalance twice.
III. Query ASM disk related information:
1. To view disk information:
SQL> select name, path from v$asm_disk;
2. View disk group information
SQL>select name,path from v$asm_diskgroup;
IV. Create tablespaces on ASM disks:
SQL>create tablespace test datafile '+DATA1' size 100m;
SQL>create tablespace test datafile '+dgdata/info/test_01.dbf' size 150m; --alias naming
V. ASM alias management
1. Addition of aliases:
Command:
alter diskgroup diskgroup_name
add alias alias_name for 'asm_file';
SQL> alter diskgroup DATA1
add alias '+dgdata1/salse.dbf' for '+dgdata1/info/datafile/system.256.78684974';
2. Deletion of aliases
Command:
alter diskgroup diskgroup_name
drop alias alias_name;
SQL> alter diskgroup dgdata1
drop alias '+dgdata1/salse.dbf' ;
3. View aliases:
Alias information is stored in view v$asm_alias. view
SQL>select * from v$asm_alias
VI.ASMCMD command
asmcmd command is only available in 11g state
cd change directory to specified directory
cp copies files between ASM disk groups, either in the same instance or in a remote instance
du Loop Displays the overall disk utilization for the current directory and all subdirectories
exit terminates asmcmd and returns to the OS shell prompt
find Find all matches of names starting from a specified directory (wildcards can also be used)
help List asmcmd commands
ls List the contents of the current directory
lsct Lists information about the current ASM customer database
lsdg lists all disk groups and their attributes
lsdsk is a list of all disks visible to this ASM instance
md_backup is a script that creates a metadata backup for a specified disk group
md_restore is a disk group restored from a backup
mkalias Creates an alias for a system-generated ASM filename
mkdir Create an ASM directory
pwd Displays the current ASM directory
A remap is a series of physical blocks that repair damage or corruption on a disk
rm Delete ASM files or directories
rmalias deletes an ASM alias without deleting the target of the alias
About "ASM how to manage" this article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.
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.