In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "what are the management and maintenance methods of ASM under Oracle11g RAC". In the daily operation, I believe that many people have doubts about the management and maintenance methods of ASM under Oracle11g RAC. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "what are the management and maintenance methods of ASM under Oracle11g RAC?" Next, please follow the editor to study!
First, basic maintenance:
Note: the following commands and procedures other than OS can be managed by ASM-related operations and Oracle Enterprise Mananger in ASMCA.
1. View ASM disks and disk groups:
-- SQL to see which disk groups are available.
[root@rac01 ~] # su-grid
[grid@rac01 ~] $sqlplus "/ as sysasm"
SQL > select group_number, name, state, type from v$asm_diskgroup
GROUP_NUMBER NAME STATE TYPE
-
1 OCR_VOTE MOUNTED EXTERN
2 ORADATA MOUNTED EXTERN
3 ORAFLASH MOUNTED EXTERN
The space usage of the disk group can be seen through some fields such as total_mb and free_mb.
-- View ASM disk through SQL statement
SQL > set line 2000
SQL > select group_number, name,failgroup, path from v$asm_disk
GROUP_NUMBER NAME FAILGROUP PATH
-
2 ASMDATA01 ASMDATA01 ORCL:ASMDATA01
3 ASMDATA02 ASMDATA02 ORCL:ASMDATA02
1 OCR_VOTE01 OCR_VOTE01 ORCL:OCR_VOTE01
Disks can be associated with disk groups through group_number (a disk group can correspond to multiple disks).
Here, you can see that disk OCR_VOTE01 corresponds to OCR_VOTE disk group, disk ASMDATA01 corresponds to ORADATA disk group, and disk ASMDATA02 corresponds to ORAFLASH disk group (it is recommended to have the same name).
-- View disk groups through asmcmd (each disk group appears as a directory):
[root@rac01 ~] # su-grid
[grid@rac01 ~] $asmcmd
ASMCMD > ls-al
State Type Rebal Name
MOUNTED EXTERN N OCR_VOTE/
MOUNTED EXTERN N ORADATA/
MOUNTED EXTERN N ORAFLASH/
Remarks: or ASMCMD > lsdg
View the ASM disk through the oracleasm command under OS.
[root@rac01 bin] # / usr/sbin/oracleasm listdisks
ASMDATA01
ASMDATA02
OCR_VOTE01
two。 Learn about ASM-related paths:
Through the asmcm command, you can see that ASM will establish some default paths under the ORADATA disk group according to the datafile path established by DBCA (generally, ARCHIVELOG/, CONTROLFILE/,DATAFILE/, ONLINELOG/, PARAMETERFILE/, TEMPFILE/, directories under db_name are all uppercase, in which the lowercase arch is built by the user, the SYS field is Y, and N is defined by the user)
[root@rac01 bin] # su-grid
[grid@rac01 ~] $asmcmd
ASMCMD > ls
OCR_VOTE/
ORADATA/
ORAFLASH/
ASMCMD > cd oradata
ASMCMD > ls
RACDB/
ASMCMD > cd racdb
ASMCMD > ls-l
Type Redund Striped Time Sys Name
Y ARCHIVELOG/
Y CONTROLFILE/
Y DATAFILE/
Y ONLINELOG/
Y PARAMETERFILE/
Y TEMPFILE/
N arch/
N control01.ctl = > + ORADATA/RACDB/CONTROLFILE/Current.256.739387263
N control02.ctl = > + ORADATA/RACDB/CONTROLFILE/Current.257.739387265
N redo01.log = > + ORADATA/RACDB/ONLINELOG/group_1.258.739387273
N redo02.log = > + ORADATA/RACDB/ONLINELOG/group_2.259.739387281
N redo03.log = > + ORADATA/RACDB/ONLINELOG/group_3.266.739393547
N redo04.log = > + ORADATA/RACDB/ONLINELOG/group_4.267.739393547
N spfileracdb.ora = > + ORADATA/RACDB/PARAMETERFILE/spfile.268.739393555
ASMCMD >
-- Archive path ARCHIVELOG:
See the archive path from the oracle database parameter file:
SQL > show parameter log_archive_dest
Log_archive_dest_1 string LOCATION=+ORADATA/RACDB/arch
You can see the archive path "+ ORADATA/RACDB/arch", then + ORADATA/RACDB/ARCHIVELOG
What kind of files are saved below?
ASMCMD > pwd
+ oradata/racdb/arch-View the archive path in the parameter
ASMCMD > ls-l
Type Redund Striped Time Sys Name
N 1_204_739387258.arc = >
+ ORADATA/RACDB/ARCHIVELOG/2011_11_28/thread_1_seq_204.478.768441403
N 1_205_739387258.arc = >
+ ORADATA/RACDB/ARCHIVELOG/2011_11_29/thread_1_seq_205.481.768443221
N 1_206_739387258.arc = >
+ ORADATA/RACDB/ARCHIVELOG/2011_11_29/thread_1_seq_206.482.768443233
N 1_207_739387258.arc = >
+ ORADATA/RACDB/ARCHIVELOG/2011_11_29/thread_1_seq_207.483.768443239
The user-defined archive format and archive path point to the directories and files automatically established by ASM. The custom generated archive is equivalent to a shortcut (or soft connection), and the actual file is the archive file of the ASM default path.
You can also manually generate aliases for Oracle ASM Filename:
ALTER DISKGROUP ORADATA ADD ALIAS
'+ oradata/racdb/datafile/test01.dbf'
FOR'+ oradata/racdb/datafile/TEST.340.740166807'
ASMCMD > pwd
+ oradata/racdb/ARCHIVELOG-View the default archive path of the ASM system
ASMCMD > ls-l
Type Redund Striped Time Sys Name
Y 2011_11_28/
Y 2011_11_29/
Y 2011_11_30/
Archived files are stored on a daily basis and are cataloged separately.
ASMCMD > cd 2011 / 11 / 29 /
ASMCMD > ls-l
Type Redund Striped Time Sys Name
ARCHIVELOG UNPROT COARSE NOV 29 00:00:00 Y thread_1_seq_205.481.768443221
ARCHIVELOG UNPROT COARSE NOV 29 00:00:00 Y thread_1_seq_206.482.768443233
ARCHIVELOG UNPROT COARSE NOV 29 00:00:00 Y thread_1_seq_207.483.768443239
ARCHIVELOG UNPROT COARSE NOV 29 00:00:00 Y thread_1_seq_208.485.768443253
ARCHIVELOG UNPROT COARSE NOV 29 00:00:00 Y thread_1_seq_209.486.768443277
-- Control the file path CONTROLFILE:
ASMCMD > cd racdb
ASMCMD > ls-l
Type Redund Striped Time Sys Name
N control01.ctl = > + ORADATA/RACDB/CONTROLFILE/Current.256.739387263
N control02.ctl = > + ORADATA/RACDB/CONTROLFILE/Current.257.739387265
Check the location of the initialization parameter file. The actual file is similar to the soft link method:
SQL > show parameter control
NAME TYPE VALUE
-
Control_files string + ORADATA/racdb/control01.ctl
+ ORADATA/racdb/control02.ctl
How to add control files? Examples are as follows:
SQL > alter database mount database
SQL > alter database backup controlfile to'+ ORADATA/racdb/control02.ctl'
SQL > alter database backup controlfile to'+ ORADATA/racdb/control03.ctl'
SQL > alter system set control_files='+ORADATA/racdb/control01.ctl','+DATA/racdb/control02.ctl','+DATA/racdb/control03.ctl'
Scope=spfile
SQL > startup mount
-- data file path DATAFILE:
ASMCMD > pwd
+ oradata/racdb/datafile
ASMCMD >
ASMCMD > ls-l
Type Redund Striped Time Sys Name
DATAFILE UNPROT COARSE OCT 29 18:00:00 Y BASE_DATA.317.754072293
DATAFILE UNPROT COARSE OCT 29 18:00:00 Y BASE_DATA.318.754072319
DATAFILE UNPROT COARSE OCT 29 18:00:00 Y BASE_DATA.319.754072331
DATAFILE UNPROT COARSE OCT 29 18:00:00 Y BASE_DATA.320.754072345
N BASE_DATA01.DBF = > + ORADATA/RACDB/DATAFILE/BASE_DATA.317.754072293
N BASE_DATA02.DBF = > + ORADATA/RACDB/DATAFILE/BASE_DATA.318.754072319
N BASE_DATA03.DBF = > + ORADATA/RACDB/DATAFILE/BASE_DATA.319.754072331
N BASE_DATA04.DBF = > + ORADATA/RACDB/DATAFILE/BASE_DATA.320.754072345
You can see that the name of the link and the name of the corresponding entity file appear in the datafile directory. Of course, not every entity file has a corresponding linked file name. For example, when you specify a + ORADATA disk group when you initially set up the database, the database will automatically establish the initial data file. At that time, the file is only system-generated, and there is no user-specified name (link name). For example, LOGMNRTS.321.754072935, SYSTEM.263.754063787 and so on in the above example.
When joining the datafile or establishing a table space, if you only specify + ORADATA and do not clearly write the path and file name, then the system self-built file will be generated without the link name, and if the file uses a similar'+ ORADATA/racdb/datafile/mytbs01.dbf', then the system self-built file and the corresponding link file will be generated.
You can also use ALTER DISKGROUP XX ADD ALIAS to add aliases.
-- recognize the file name
BASE_DATA.317.754072293 is the table space name + file number. Incarnation.
+ group/dbname/file type/tag.file.incarnation format is the disk group name, file type is the Oracle file type, tag is generally for a table space name, file.incarnation is combined to ensure uniqueness.
Testing: adding data files or tablespaces
CREATE TABLESPACE MYTBS DATAFILE
'+ ORADATA/racdb/datafile/mytbs01.dbf' SIZE 10m AUTOEXTEND OFF
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL UNIFORM. SIZE 5M
BLOCKSIZE 16K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON
Or
CREATE TABLESPACE TONYTBS DATAFILE
'+ ORADATA' SIZE 10m AUTOEXTEND ON NEXT 5M MAXSIZE 1024m
LOGGING
ONLINE
PERMANENT
EXTENT MANAGEMENT LOCAL UNIFORM. SIZE 5M
BLOCKSIZE 16K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON
Add data files
ALTER TABLESPACE MYTBS ADD DATAFILE'+ ORADATA' SIZE 10m AUTOEXTEND OFF
If you set the initialization parameter db_create_file_dest (default is empty), you don't even need to write the disk group name, for example:
SQL > show parameter db_create_file_dest
NAME TYPE VALUE
-
Db_create_file_dest string + ORADATA
SQL > ALTER TABLESPACE MYTBS ADD DATAFILE SIZE 10m AUTOEXTEND OFF
Tablespace altered.
Tips:
For existing systems, the easiest way to move to ASM storage is to use RMAN
After the three statements have been established, view the system files:
[root@rac01 ~] # su-grid
[grid@rac01 ~] $
[grid@rac01 ~] $asmcmd
ASMCMD > ls
OCR_VOTE/
ORADATA/
ORAFLASH/
ASMCMD > cd oradata/racdb
ASMCMD > ls-l
Type Redund Striped Time Sys Name
DATAFILE UNPROT COARSE NOV 30 17:00:00 Y MYTBS.504.768590521
DATAFILE UNPROT COARSE NOV 30 17:00:00 Y MYTBS.505.768590741
DATAFILE UNPROT COARSE NOV 30 17:00:00 Y SYSAUX.261.739387301
DATAFILE UNPROT COARSE NOV 30 17:00:00 Y SYSTEM.260.739387283
DATAFILE UNPROT COARSE NOV 30 17:00:00 Y TEST.340.740166807
DATAFILE UNPROT COARSE NOV 30 17:00:00 Y TEST.341.740166937
DATAFILE UNPROT COARSE NOV 30 17:00:00 Y TONYTBS.506.768590761
DATAFILE UNPROT COARSE NOV 30 17:00:00 Y UNDOTBS1.262.739387315
DATAFILE UNPROT COARSE NOV 30 17:00:00 Y UNDOTBS2.264.739387351
DATAFILE UNPROT COARSE NOV 30 17:00:00 Y USERS.265.739387361
N mytbs01.dbf = > + ORADATA/RACDB/DATAFILE/MYTBS.504.768590521
N test01.dbf = > + ORADATA/RACDB/DATAFILE/TEST.340.740166807
N test02.dbf = > + ORADATA/RACDB/DATAFILE/TEST.341.740166937
We can see that mytbs01 specifies the path'+ ORADATA/racdb/datafile/mytbs01.dbf', so it is displayed with both mytbs01.dbf and corresponding MYTBS.504.768590521. The newly added MYTBS tablespace file only writes'+ ORADATA', and the generated file is MYTBS.505.768590741, as well as the established TONYTBS, the corresponding file is TONYTBS.506.768590761, and there is no linked file.
Modify the data file size (similar to file system operations):
ALTER DATABASE DATAFILE'+ DATA/wsjdell/datafile/users.256.754063811' RESIZE 200m
For archive directories and data file directories, another concern is the problem of space. How can we judge that disk groups need to add new disks or new disk groups to meet data growth?
ASMCMD > pwd
+ oradata/racdb/datafile
ASMCMD > du
Used_MB Mirror_used_MB
2949 2949
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 EXTERN N 512 4096 1048576 10236 9840 0 9840 0 N OCR_VOTE/
MOUNTED EXTERN N 512 4096 1048576 10236 465 0 465 0 N ORADATA/
MOUNTED EXTERN N 512 4096 1048576 4094 3999 0 3999 0 N ORAFLASH/
[root@rac01 ~] # su-grid
[grid@rac01 ~] $sqlplus "/ as sysasm"
SQL > select name, total_mb, free_mb,cold_used_mb from v$asm_diskgroup
NAME TOTAL_MB FREE_MB COLD_USED_MB
OCR_VOTE 10236 9840 396
ORADATA 10236 465 9771
ORAFLASH 4094 3999 95
You can see that the size of free_mb (or Usable_file_MB) queried through sql statements in asmcmd and asm instances is the same.
The use of tablespaces needs to be viewed through database SQL or auxiliary tools such as Toad.
-- online log file path ONLINELOG
ASMCMD > pwd
+ oradata/racdb
ASMCMD > ls-l
Type Redund Striped Time Sys Name
Y ARCHIVELOG/
Y CONTROLFILE/
Y DATAFILE/
Y ONLINELOG/
Y PARAMETERFILE/
Y TEMPFILE/
N arch/
N control01.ctl = > + ORADATA/RACDB/CONTROLFILE/Current.256.739387263
N control02.ctl = > + ORADATA/RACDB/CONTROLFILE/Current.257.739387265
N redo01.log = > + ORADATA/RACDB/ONLINELOG/group_1.258.739387273
N redo02.log = > + ORADATA/RACDB/ONLINELOG/group_2.259.739387281
N redo03.log = > + ORADATA/RACDB/ONLINELOG/group_3.266.739393547
N redo04.log = > + ORADATA/RACDB/ONLINELOG/group_4.267.739393547
N spfileracdb.ora = > + ORADATA/RACDB/PARAMETERFILE/spfile.268.739393555
ASMCMD > cd onlinelog
ASMCMD > ls-l
Type Redund Striped Time Sys Name
ONLINELOG UNPROT COARSE NOV 30 17:00:00 Y group_1.258.739387273
ONLINELOG UNPROT COARSE NOV 30 17:00:00 Y group_2.259.739387281
ONLINELOG UNPROT COARSE NOV 30 17:00:00 Y group_3.266.739393547
ONLINELOG UNPROT COARSE NOV 30 17:00:00 Y group_4.267.739393547
Like other key files, the directory + oradata/racdb is manually specified when building the library, so after all
Easily recognizable names such as redo01.log, redo02.log, etc., all exist in the form of link names.
Redo logfile redundancy settings can be set on different disk groups, such as ORADATA and ORAFLASH.
Join a redundancy group in the same way as in a file system (the only difference is that you cannot add parentheses to a file, if only one member is added).
Alter database add logfile member'+ ORAFLASH' to group 1
Alter database add logfile member'+ ORAFLASH' to group 2
Alter database add logfile member'+ ORAFLASH' to group 3
Alter database add logfile member'+ ORAFLASH' to group 4
After joining, you can see 2 members of each group by querying v$logfile.
ASMCMD > cd + oraflash
ASMCMD > ls
RACDB/
ASMCMD > cd racdb
ASMCMD > ls
ONLINELOG/
ASMCMD > ls-l
Type Redund Striped Time Sys Name
ONLINELOG UNPROT COARSE NOV 30 20:00:00 Y group_1.256.768602255
ONLINELOG UNPROT COARSE NOV 30 21:00:00 Y group_2.257.768603599
ONLINELOG UNPROT COARSE NOV 30 21:00:00 Y group_3.258.768603683
ONLINELOG UNPROT COARSE NOV 30 21:00:00 Y group_4.259.768603705
Join a redo log group.
Alter database add logfile group 5 ('+ ORADATA','+ ORAFLASH') size 50m
SQL > select member from v$logfile
MEMBER
-
+ ORADATA/racdb/redo01.log
+ ORADATA/racdb/redo02.log
+ ORADATA/racdb/redo03.log
+ ORADATA/racdb/redo04.log
+ ORAFLASH/racdb/onlinelog/group_1.256.768602255
+ ORAFLASH/racdb/onlinelog/group_2.257.768603599
+ ORAFLASH/racdb/onlinelog/group_3.258.768603683
+ ORAFLASH/racdb/onlinelog/group_4.259.768603705
+ ORADATA/racdb/onlinelog/group_5.508.768604159
+ ORAFLASH/racdb/onlinelog/group_5.260.768604161
10 rows selected.
SQL >
-- Parameter file path PARAMETERFILE (DB parameter file, non-ASM instance parameter file)
ASMCMD > pwd
+ oradata/racdb/parameterfile
ASMCMD > ls-l
Type Redund Striped Time Sys Name
PARAMETERFILE UNPROT COARSE NOV 30 17:00:00 Y spfile.268.739393555
ASMCMD >
-- temporary file path TEMPFILE
ASMCMD > cd tempfile
ASMCMD > ls-l
Type Redund Striped Time Sys Name
TEMPFILE UNPROT COARSE NOV 30 17:00:00 Y TEMP.263.739387321
3. Expand the disk group size
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 EXTERN N 512 4096 1048576 10236 9840 0 9840 0 N OCR_VOTE/
MOUNTED EXTERN N 512 4096 1048576 10236 414 0 414 0 N ORADATA/
MOUNTED EXTERN N 512 4096 1048576 4094 3737 0 3737 0 N ORAFLASH/
Through the lsdg or v$asm_diskgroup view, we find that there may not be enough disk group space, so should we join a new disk group or add a new disk based on the original disk group?
In order to get better Iamp O performance, it is common to add new disks to the disk group. ASM disk groups support dynamic expansion. We can dynamically add new disks to the existing disk groups. After the new disks are added, Oracle Rebalance through the background RBAL to balance the current data to the newly added disks. Drop disks also Rebalance.
The asm_power_limit parameter is used to control the speed of Rebalance. A value of 1: 11 rebalance power indicates that the greater the number of process RBAL of the started rebalance, the faster the balance speed. The default value is 1. However, the higher the number, the performance may be affected by Rebalance, which is generally set to between 3 and 6 for balance.
After adding the new disk, assume that / dev/sde, / dev/sdf, fdisk is partitioned as / dev/sde1, / dev/sdf1.
[grid@rac01 ~] $sqlplus "/ as sysasm"
SQL*Plus: Release 11.2.0.1.0 Production on Wed Nov 30 23:04:08 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Real Application Clusters and Automatic Storage Management options
SQL > show parameter asm_power_limit
NAME TYPE VALUE
-
Asm_power_limit integer 1
SQL > alter system set asm_power_limit=5;-- modify the power value.
System altered.
Or use the
ALTER DISKGROUP diskgroupname REBALANCE POWER 5
-- check existing disks.
SQL > select group_number, name from v$asm_disk order by 1
GROUP_NUMBER NAME
0
1 OCR_VOTE01
2 ASMDATA01
3 ASMDATA02
-- View existing disk groups.
SQL > select group_number, name from v$asm_diskgroup order by 1
GROUP_NUMBER NAME
1 OCR_VOTE
2 ORADATA
3 ORAFLASH
Create a new disk:
[root@rac01] # / usr/sbin/oracleasm createdisk ASMDATA03 / dev/sde1
Writing disk header: done
Instantiating disk: done
[root@rac01 ~] # / usr/sbin/oracleasm listdisks
ASMDATA01
ASMDATA02
ASMDATA03
OCR_VOTE01
On other nodes:
[root@rac02 ~] # / usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@rac02 ~] # / usr/sbin/oracleasm listdisks
ASMDATA01
ASMDATA02
ASMDATA03
OCR_VOTE01
The new disk ASMDATA03 needs to be added to the ORADATA disk group:
[grid@rac01 ~] $sqlplus "/ as sysasm"
SQL > ALTER DISKGROUP ORADATA ADD DISK 'ORCL:ASMDATA03'
Diskgroup altered.
Or (you need to specify ASM_DISKSTRING ='/ dev/*' in the initial parameter)
SQL > ALTER DISKGROUP ORADATA ADD DISK'/ dev/sde1' name ASMDATA03
The speed is still very fast (probably not much data needs to be transferred from disk to disk). You can find some large test libraries to test the speed and performance of different power values. After notice, change the asm_power_limit value to the default value of 1. 0.
SQL > alter system set asm_power_limit=1
System altered.
-
Note that if the expanded disk group is Normal Redundant, then failure group.
The statements related to modifying and adding a disk group are similar (you need to set the initial parameter ASM_DISKSTRING='/dev/*'):
Specific reference:
Http://docs.oracle.com/cd/E11882_01/server.112/e18951/asmdiskgrps.htm#CHDHHABI
One disk is composed of failgroup (Normal):
ALTER DISKGROUP dgroup1 NORMAL REDUNDANCY
FAILGROUP fg1 DISK'/ dev/sde1' NAME ASMDATA05
FAILGROUP fg2 DISK'/ dev/sdf1' NAME ASMDATA06
One disk is composed of failgroup (High):
Create diskgroup data2 high redundancy
Failgroup fg1 disk'/ dev/raw/raw3' name D2a
Failgroup fg2 disk'/ dev/raw/raw4' name D2B
Failgroup fg3 disk'/ dev/raw/raw5' name D2C
Multiple disks make up failgroup (Normal):
CREATE DISKGROUP dgroup1 NORMAL REDUNDANCY
FAILGROUP controller1 DISK
'/ dev/diska1'
'/ dev/diska2'
'/ dev/diska3'
'/ dev/diska4'
FAILGROUP controller2 DISK
'/ dev/diskb1'
'/ dev/diskb2'
'/ dev/diskb3'
'/ dev/diskb4'
Syntax:
CREATE DISKGROUP diskgroup_name
[{HIGH | NORMAL | EXTERNAL} REDUNDANCY]
[FAILGROUP failgroup_name]
DISK [NAME disk_name] [SIZE size_clause] [FORCE | NOFORCE]...
You can see what is going on through the v$asm_operation view.
Here are a few points to pay attention to:
(1) first of all, sqlplus login requires sysasm role, because sysdba can only be viewed and cannot be modified.
(2) the disk information followed by add disk is' ORCL:XXX', and XXX is the ASM disk label seen by listdisks.
If it's just add disk 'XXX', it will make a mistake.
(3) similarly, it is not possible to write'/ dev/sde1' directly after add disk, and permission errors will be reported.
View the disk group space expansion through asmcmd:
[root@rac02 ~] # su-grid
[grid@rac02 ~] $
[grid@rac02 ~] $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 EXTERN N 512 4096 1048576 10236 9840 0 9840 0 N OCR_VOTE/
MOUNTED EXTERN Y 512 4096 1048576 30709 20694 0 20694 0 N ORADATA/
MOUNTED EXTERN N 512 4096 1048576 4094 3737 0 3737 0 N ORAFLASH/
ASMCMD >
You can see that the Total_MB of the ORADATA disk group has changed to 30g (30709m), obviously
Successfully joined 20g / dev/sde1.
Delete the disks in the disk group (you also need to set the power value to speed up RBAL):
SQL > ALTER DISKGROUP ORADATA DROP DISK 'ASMDATA03'
Diskgroup altered.
If you check it immediately after execution, the size of the ORADATA disk group may not change. You need to look at the v$asm_operation view to see what is going on, and then change it. The results of not waiting and waiting for 3 minutes after executing the drop command are as follows:
ASMCMD > lsdg-check it right away (no change in size)
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files
Name
MOUNTED EXTERN N 512 4096 1048576 10236 9840 0 9840 0 N OCR_VOTE/
MOUNTED EXTERN Y 512 4096 1048576 30709 20694 0 20694 0 N ORADATA/
MOUNTED EXTERN N 512 4096 1048576 4094 3737 0 3737 0 N ORAFLASH/
ASMCMD >
ASMCMD > lsdg-wait for 3 minutes to check (of course, the waiting time is longer if the amount of data is large)
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files
Name
MOUNTED EXTERN N 512 4096 1048576 10236 9840 0 9840 0 N OCR_VOTE/
MOUNTED EXTERN N 512 4096 1048576 10236 223 0 223 0 N ORADATA/
MOUNTED EXTERN N 512 4096 1048576 4094 3737 0 3737 0 N ORAFLASH/
You can see that the total_mb of ORADATA has changed back to 10G.
If you want the ALTER DISKGROUP statement to complete all the work before returning to user control, you can attach the REBALANCE WAIT clause during execution, so that the statement will wait for the automatic balancing operation, and directly all the operations will be completed before returning the result. Of course, during the waiting period, if you change your mind and do not want to continue to wait, CTRL+C will be interrupted to gain control. At this time, the balancing operation will not be affected and will continue in the background.
ASMCMD > lsdsk-- ASMDATA03 disk disappears.
Path
ORCL:ASMDATA01
ORCL:ASMDATA02
ORCL:OCR_VOTE01
Note that DROP DISK simply removes ASMDATA03 from the disk group:
[root@rac02 ~] # / usr/sbin/oracleasm listdisks
ASMDATA01
ASMDATA02
ASMDATA03
OCR_VOTE01
Note:
(1), or you can only set rebalance power for a certain diskgroup, such as:
Alter diskgroup ORADATA rebalance power 8
(2), or set it in the command
Alter diskgroup ORADATA add disk 'ORCL:ASMDATA03' rebalance power 8
Alter diskgroup ORADATA drop disk 'ASMDATA03' rebalance power 8
It is important to note that both add and drop need to wait some time before doing actions for this disk or disk group, otherwise an error may be reported, or watch the v$asm_operation to view the transaction.
As follows:
SQL > select * from v$asm_operation
GROUP_NUMBER OPERA STAT POWER ACTUAL SOFAR EST_WORK EST_RATE
EST_MINUTES ERROR_CODE
-
2 REBAL RUN 8 8 173 6680 741
View it again at regular intervals (until the related transaction disappears from this view):
SQL > select * from v$asm_operation
No rows selected
Due to the ASM auto-balancing feature mentioned earlier, the return of the above statement does not mean that the disk has been deleted. At this time, the backend may be busy performing IO rebalancing work, so if DBA suddenly realizes the operation error at this time, but the disk does not need to be deleted, you can also cancel the deletion operation immediately through the alter diskgroup dgname undrop disks statement, for example:
SQL > alter diskgroup ORADATA undrop disks
Diskgroup altered.
As long as the delete operation is not really completed, the task will be cancelled, otherwise, the above statement will not save anything. If you want to save it, DBA can only add the disk back to the disk group through the ADD statement.
4. Add a new disk group
-- check existing disks.
SQL > select group_number, name from v$asm_disk order by 1
GROUP_NUMBER NAME
1 OCR_VOTE01
2 ASMDATA01
2 ASMDATA03
3 ASMDATA02
-- View existing disk groups.
SQL > select group_number, name from v$asm_diskgroup order by 1
GROUP_NUMBER NAME
1 OCR_VOTE
2 ORADATA
3 ORAFLASH
Create a new disk (/ dev/sdf1):
[root@rac01] # / usr/sbin/oracleasm createdisk ASMDATA04 / dev/sdf1
Writing disk header: done
Instantiating disk: done
[root@rac01 ~] # / usr/sbin/oracleasm listdisks
ASMDATA01
ASMDATA02
ASMDATA03
ASMDATA04
OCR_VOTE01
On other nodes:
[root@rac02 ~] # / usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "ASMDATA04"
[root@rac02 ~] # / usr/sbin/oracleasm listdisks
ASMDATA01
ASMDATA02
ASMDATA03
ASMDATA04
OCR_VOTE01
Start setting up the disk group (here is the external mode, specific syntax reference documentation):
Create a new disk group on node 1:
SQL > CREATE DISKGROUP ORAINDX EXTERNAL REDUNDANCY
DISK 'ORCL:ASMDATA04'
SQL > select group_number, name from v$asm_diskgroup
GROUP_NUMBER NAME
1 OCR_VOTE
2 ORADATA
3 ORAFLASH
4 ORAINDX
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 EXTERN N 512 4096 1048576 10236 9840 0 9840 0 N OCR_VOTE/
MOUNTED EXTERN N 512 4096 1048576 30709 20694 0 20694 0 N ORADATA/
MOUNTED EXTERN N 512 4096 1048576 4094 3737 0 3737 0 N ORAFLASH/
MOUNTED EXTERN N 512 4096 1048576 10236 10186 0 10186 0 N ORAINDX/
You can see that it all works on Node 1. But other nodes do not take effect (lsdg and lsdsk can't see it)
The new disk group needs to be mounted manually.
SQL > ALTER DISKGROUP ORAINDX MOUNT
Diskgroup altered.
You can see it by looking at it on other nodes:
SQL > select name from v$asm_diskgroup
SQL > select name from v$asm_disk
ASMCMD > lsdsk
ASMCMD > lsdg
5, delete the disk group
Syntax: drop diskgroup gpname, if the deleted diskgroup is not empty, executing the above statement directly will report an error. At this time, you can automatically delete the files contained in the disk group by attaching the including contents clause. Deleting a disk group automatically modifies the value of the ASM_DISKGROUPS initialization parameter in spfile (if SPFILE is used).
-- Tips:
If a file is deleted, its associated alias (Alias) will also be deleted automatically.
SQL > alter diskgroup asmdisk2 drop file'+ ASMDISK2/repdb/datafile/temp01.dbf'
Diskgroup altered.
Second, ASM instances are relevant.
1. Permissions and roles related to ASM
Common users and groups when installing Grid Infrastructure:
Grid Infrastructure operating system user grid, the primary group is oinstall, and the secondary group is asmadmin, asmdba, asmoper
Oracle RAC operating system user oracle, the primary group is oinstall, and the secondary group is dba, oper, asmdba
Oracle in 11 g release2 recommends managing Grid Infrastructure and ASM instances independently.
OSASM (asmadmin) user group
If we use ASM, we must create an osasm (asmadmin) user group whose members will be assigned
SYSASM permissions to meet the permission requirements of group members to manage Oracle Clusterware and ASM.
OSDBA for ASM group (asmdba) user group
Members of the OSDBA (asmdba) user group will be given read and write access to the ASM file. GI/CRS owners, users and
All oracle database software owners must be members of the group. All members of the OSDBA (dba) user group must also be members of the asmdba group.
OSOPER for ASM (asmoper) user group
Asmoper and osoper are similar to additional optional user groups that can be created to satisfy the
The user has a set of restricted ASM instance management rights (the SYSOPER role of ASM), which include starting and stopping ASM instances
By default, members of the OSASM (asmadmin) group will have ASM administrative rights for all SYSOPER.
Grid users install clusters separately, such as asm instances, listening resources, node resources, etc.
Oracle users only install oracle code
# groupadd oinstall
# groupadd asmadmin
# groupadd asmdba
# groupadd asmoper
# groupadd dba
# groupadd oper
# useradd-g oinstall-G asmadmin,asmdba,asmoper grid
# useradd-g oinstall-G dba, oper, asmdba oracle
For the meaning of the specific representative, refer to:
Http://www.oracledatabase12g.com/archives/oracle-installation-os-user-groups.html
User group description of the user group to which the user group belongs
Oinstall grid, oracle Oracle Inventory and Software Owner
Dba oracle Database Administrator
Asmadmin grid Oracle ASM Group
Asmdba grid, oracle ASM Database Administrator Group
Asmoper grid ASM Operator Group
Oper oracle Database Operator
If no asmdba group is assigned to oracle users, it will cause oracle users to fail to recognize diskgroup
Failed to start the corresponding node instance.
Remarks:
Sysdba is still used in Oracle10g to manage asm instances, and a new role, sysasm, is used in Oracle11g, dedicated to
Managing asm is equivalent to the sysdba role for asm instances. After logging in as a grid user in Oracle11g RAC, with
Sysdba login can also view the status related to asm instances, but no changes can be made until the sysasm roles are connected.
Sure.
2. ASM instance
ASM instances are similar to ORACLE database instances and are composed of SGA and background processes. The difference is that
Oracle instances manage databases, while asm instances manage only ASM disk groups. Here grid users belong to
Asmadmin group, used to manage ASM
[root@rac01 ~] # su-grid
[grid@rac01 ~] $id
Uid=501 (grid) gid=501 (oinstall) groups=501 (oinstall), 504,506 (asmdba), 507 (asmoper)
[grid@rac01 ~] $export ORACLE_SID=+ASM1 (generally not used, because there is only one ASM instance under grid users)
[grid@rac01 ~] $env | grep ORA
ORA_NLS11=/u01/grid/11.2.0/nls/data
ORACLE_SID=+ASM1
ORACLE_BASE=/u01/grid/crs
ORACLE_TERM=vt100
ORACLE_HOME=/u01/grid/11.2.0
[grid@rac01 ~] $sqlplus / as sysasm
SQL*Plus: Release 11.2.0.1.0 Production on Sat Dec 3 07:13:39 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Real Application Clusters and Automatic Storage Management options
SQL > show parameter instance_name
NAME TYPE VALUE
-
Instance_name string + ASM1
As a grid user, connect to the ASM instance and use both sysdba and sysasm roles
Login with sysdba can also view the status related to asm instances, but no changes can be made.
It is not possible until the sysasm role is connected.
A. enable and close ASM instances
Similarly, ASM instances can also be startup nomount / mount / open / force.
Nomount: just start the instance
Mount / open: start instances and load disk groups, open is the same as mount
Force: execute shutdown abort first, then startup
Test:
[grid@rac01 ~] $sqlplus / as sysasm
SQL > startup nomount
ASM instance started
Total System Global Area 120023424 bytes
Fixed Size 2082208 bytes
Variable Size 102775392 bytes
ASM Cache 25165824 bytes
SQL > select name,state from v$asm_diskgroup
NAME STATE
ASMDISK1 DISMOUNTED
ASMDISK2 DISMOUNTED
SQL > select instance_name,status from v$instance
INSTANCE_NAME STATUS
--
+ ASM1 STARTED
Then load the disk group, note that it is not alter database:
SQL > alter diskgroup all mount
Diskgroup altered.
SQL > select name,state from v$asm_diskgroup
NAME STATE
ASMDISK1 MOUNTED
ASMDISK2 MOUNTED
Close the ASM instance: several options for NORMAL/IMMEDIATE/TRANSACTIONAL/ABORT
Just like shutting down a normal database instance:
SQL > shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown
B. initialization parameters of ASM instance
ASM initialization is also divided into spfile and pfile, and the operation is the same. Compared with RDBMS database, there are still some differences.
Parameters.
SQL > create pfile='/tmp/asminit.ora' from spfile
File created.
Because the memory footprint of ASM instances is very small, 100 megabytes of memory is basically enough, not to mention memory correlation.
INSTANCE_TYPE: the value is ASM in ASM and RDBMS in the database instance.
ASM_POWER_LIMIT: specifies the degree of disk rebalance, which has a level of 0-11. The default value is 1. Specify
The higher the level, the faster the operation of the rebalance will be completed (which means, of course, that the
Take up more resources), if you specify a lower level, although the rebalance operation will take longer, for the current
The IO and load impact of the system will be less, and the intermediate degree needs to be measured by DBA according to the actual situation. In addition, this reference
The number specifies only a default value, which can be modified dynamically or on the statement-level command line during the operation.
Power is specified, overriding the default value.
ASM_DISKSTRING: in the simplest terms, set the disk to check when ASM starts. This option can
Multiple values are specified at the same time and wildcards are supported. For example, if you only check the devices under / dev/dsk/, you can set
The parameter is as follows: / dev/dsk/*,. By default, this parameter is empty. If it is empty, it means that ASM will find the system.
All devices in the ASM that have read and write permissions.
ASM_DISKGROUPS: specifies the magnetic to be loaded when the instance is started or when the alter diskgroup all mount statement is started
The disk group, if empty, will actually only boot to the NOMOUNT state. If you are using SPFILE
This parameter generally does not need to be modified manually, and ASM can automatically update the values in the initialization parameter.
[grid@rac01 tmp] $sqlplus / as sysasm
SQL*Plus: Release 11.2.0.1.0 Production on Tue Nov 29 05:24:38 2011
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-Production
With the Real Application Clusters and Automatic Storage Management options
SQL > show parameter
NAME TYPE VALUE
-
Asm_diskgroups string ORADATA, ORAFLASH
Asm_diskstring string
Asm_power_limit integer 1
.
3. ASM related views
[root@rac01 ~] # su-oracle
[oracle@rac01 ~] $sqlplus "/ as sysdba"
SQL > select TABLE_NAME from dict where table_name like 'VIP ASM%'
TABLE_NAME
-
V$ASM_ACFSSNAPSHOTS
V$ASM_ACFSVOLUMES
V$ASM_ALIAS-record file alias
V$ASM_ATTRIBUTE-record the properties of the ASM disk group
V$ASM_CLIENT-the client instance information of the current connection
V$ASM_DISK-disk and disk group information managed by ASM
V$ASM_DISKGROUP-- ASM disk group
V$ASM_DISKGROUP_STAT-ASM disk group status, size
V$ASM_DISK_IOSTAT-- ASM disk group iBandO statu
V$ASM_DISK_STAT
V$ASM_FILE
TABLE_NAME
-
V$ASM_FILESYSTEM
V$ASM_OPERATION-the operation information of the current disk
V$ASM_TEMPLATE
V$ASM_USER
V$ASM_USERGROUP
V$ASM_USERGROUP_MEMBER
V$ASM_VOLUME
V$ASM_VOLUME_STAT
19 rows selected.
4. ASM architecture
ASM instance:
1) RBAL: rebalancer process, which is responsible for planning Reblance activities for ASM disk groups
2) ABRn: a child process of the RBAL process that actually completes Reblance activities
RDBMS instance:
1) RBAL: responsible for opening all disks for each disk group
2) ASMB: this process acts as an information channel between the ASM instance and the database instance. This process is responsible for working with
The communication of the ASM instance, which first uses Diskgroup name to obtain the ASM instance that manages the Diskgroup from CSS
Connect the string, and then establish a persistent connection to the ASM through which the two instances exchange information periodically, and at the same time
It's a heartbeat mechanism.
3) O0nn 01-10: this group of processes establishes connections to ASM instances, and some long-term operations such as creating data files
RDBMS sends messages to ASM through these processes
Interaction between ASM Instance and RDBMS
When a disk group is mounted on an ASM instance, ASM will send Disk Group Name and ASM Instance Name
Information such as Oracle Home Path is registered with CSS (Cluster Sychronization Service), and it will be used
To construct Connect String. When you need to access an ASM File during RDBMS startup, RDBMS will
Contact CSS, get the Connect String from CSS, and then initiate a connection to the ASM instance
The initial connection between the ASM and the RDBMS instance is called Umbilicu (umbilical cord), as long as RDBMS opens ASM File
The connection will remain active. This connection is not available until all ASM File is closed by the RDBMS instance.
It will be closed.
According to the understanding of ASM, ASM actually means that LVM puts on the vest of Oracle, Disk corresponds to PV and Diskgroup corresponds to VG.
5. ASM efficient storage technology
Automatic storage management provides vertical integration of file systems and volume managers directly in the Oracle kernel
This brings the advantages of the "virtualization" type provided by the San system (easy to manage, higher availability)
And specially used for Oracle database files. ASM provides a quick way to configure the database to achieve optimal performance
And resource utilization. It automatically manages database files and their placement through the Oracle kernel, eliminating the need for
Third-party file systems and volume managers manage Oracle files. ASM eliminates the time-consuming manual I _ peg O performance and tuning
The whole task greatly saves DBA time.
ASM mirroring (mirroring) and striping (striping): ASM divides files into 1MB-sized regions (extent, AU)
And distribute the extents of all files evenly among all the disks of the disk group. ASM does not use mathematical functions to track the
Place, and use the pointer to record the location of the area. In this way, ASM can move a text when the disk group configuration changes
Without having to move all areas according to the formula and according to the number of disks. For files that require low latency
(for example, log files), ASM provides fine-grained (128k) segmentation to be separated by multiple disks in parallel and to handle more
Large I _ paw O. ASM distributes the Icano load among all available resources, eliminating the need for manual Icano regulation (by dividing the
Scatter database files to avoid hot spots) while optimizing performance.
ASM mirroring is more flexible than operating system disk mirroring because ASM can set redundancy levels based on files
That is, two files in the same disk group can be mirrored while the other is not mirrored. ASM mirror
Like it happened at the district level.
ASM's dynamic storage configuration: ASM makes it possible to adjust the storage configuration online, that is, it helps DBA manage
A dynamic database environment that allows DBA to expand or reduce the size of the database without shutting down the database
To adjust the storage configuration. After adding disks to or removing disks from a disk group, ASM will automatically
Rebalance-redistributes file data evenly across all disks in the disk group.
Third, ASM disk redundancy and fault handling
The disk redundancy strategy of ASM can be divided into three categories: external redundancy, standard redundancy and high redundancy.
External redundancy does not require failure disk groups, and standard and high redundancy must have failure disk groups
For example, for standard redundancy (Normal Redundancy), ASM requires that the disk group have at least
Two failure disk groups that provide double mirror protection for the same data (mirrored units in ASM)
Not a disk, nor a block, but a unit of AU, the default size of which is 1m) there will be two masters and slaves
Mirror images, and ASM automatically ensures that master and slave images do not exist in the same failure magnetic field through algorithms.
Disk group, which ensures that even if the entire failure disk group is damaged, the data will not be lost. As for Gao
Degree redundancy (High Redundancy) is even more secure, which requires at least three failure disk groups, that is,
It is a mirror image of AU with one master and more slaves, which will be more secure in theory.
If the disk is damaged, the damaged disk is automatically offline and drop by default, but the
The disk group in which the disk belongs will remain in MOUNT state. If the disk is mirrored, the application will not have
As a result, the mirror disk will automatically take over (as long as not all failure disk groups are damaged), otherwise
The disk group will automatically DISMOUNT. For example, a standard redundant failure group has 6 disks (corresponding to 6 bare settings)
If a disk is broken at this time, it doesn't matter, the operation continues, the broken piece will be automatically dropped, and the rest
The next 5 disks can still afford normal read and write operations.
ASM scalability:
Up to 63 disk groups are supported
Supports up to 10000 disk
Maximum support for 4pb/ disk
Supports up to 40 exabyte/ASM Stora
Supports up to 100 W files / disk groups
Maximum 35tb of a single file in external redundancy, maximum 5.8tb of a single file in standard redundancy, and single in high redundancy
The maximum 3.9tb of the file.
Load and unload disk groups
If you use UMOUNT disk groups, be sure to operate carefully and make sure that what is saved in UNMOUNT disk groups
The database corresponding to the file is not currently started, and this operation will directly cause the database SHUTDOWN.
Only the disk groups of mount can be used by the database and perform add/drop operations. Disk groups in ASM are default.
Recognition is automatically loaded when the ASM instance starts.
SQL > select group_number,name,state,total_mb,free_mb from v$asm_diskgroup
GROUP_NUMBER NAME STATE TOTAL_MB FREE_MB
1 ASMDATA1 MOUNTED 20472 18667
2 ASMDATA2 MOUNTED 16378 14621
Set the ASMDATA2 disk group UNMOUNT:
SQL > alter diskgroup ASMDATA2 dismount
Diskgroup altered.
SQL > select group_number,name,state from v$asm_diskgroup
GROUP_NUMBER NAME STATE
1 ASMDATA1 MOUNTED
0 ASMDATA2 DISMOUNTED
SQL > alter diskgroup ASMDATA2 mount;-- mount again.
Diskgroup altered.
Fourth, the related commands of ASM under Linux ORACLEASM, ASMCMD, ASMCA
1. ORACLEASM command
After installing asm lib, we can view the relevant commands through man:
[grid@rac01 tmp] $man oracleasm
Use ASMLib to create an ASM Disks with the following syntax:
# / usr/sbin/oracleasm createdisk disk_name device_partition_name
Disk_name is a name you choose for ASM Disk, which can only contain numbers, letters and underscores, such as OCR01, DATA01, etc. The partition of the system disk labeled ASM by device_partition_name, as shown in
/ dev/sdb1, / dev/sdc1, etc.
If you find that you have set up the wrong disk or need unmark, you can run the following command:
# / usr/sbin/oracleasm deletedisk disk_name
Set up shared disks.
# / usr/sbin/oracleasm createdisk OCR_VOTE01 / dev/sdb1
# / usr/sbin/oracleasm createdisk ASM_DATA01 / dev/sdc1
Use the listdisks command to confirm their availability.
[root@rac001 ~] # / usr/sbin/oracleasm listdisks
ASM_DATA01
ASM_DATA02
ASM_FRA
OCR_VOTE01
As the root user on all other nodes, use the scandisks command to scan the ASM disks that have been created, that is, we only need to create ASM disks on node 1, not on the other nodes.
[root@rac002 ~] # / usr/sbin/oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "OCR_VOTE01"
Instantiating disk "ASM_DATA01"
Instantiating disk "ASM_DATA02"
Instantiating disk "ASM_FRA"
Finally, check the availability of the ASM disk through listdisks at other nodes.
[root@rac002 ~] # / usr/sbin/oracleasm listdisks
ASM_DATA01
ASM_DATA02
ASM_FRA
OCR_VOTE01
2. ASMCMD command
[root@rac01 ~] # su-grid
[grid@rac01 ~] $id
Uid=501 (grid) gid=501 (oinstall) groups=501 (oinstall), 504,506 (asmdba), 507 (asmoper)
[grid@rac01 ~] $asmcmd
ASMCMD >
If asm-p enters, it will bring a path (path)
[grid@rac01] $asmcmd-p
ASMCMD [+] > cd oradata
ASMCMD [+ oradata] >
Get help help [command]:
ASMCMD [+ oradata] > help du
Du [- H] [dir]
Display total space used for files located recursively under [dir]
Similar to "du-s" under UNIX; default is the current directory. Two
Values are returned, both in units of megabytes. The first value does
Not take into account mirroring of the diskgroup while the second does.
For instance, if a file occupies 100 MB of space, then it actually
Takes up 200 MB of space on a normal redundancy diskgroup and 300 MB
Of space on a high redundancy diskgroup.
[dir] can also contain wildcards.
The-H flag suppresses the column headers from the output.
ASMCMD [+ oradata] >
3. ASMCA command
Run ASMCA to create a disk group.
Start the ASMCA configuration disk group with the login of the grid user. Because it is a graphical interface, we use the vnc session of the grid user (if the vnc of root enters su to grid, an error will be reported).
[grid@rac001 bin] $pwd
/ u01/grid/11.2.0/bin
[grid@rac001 bin] $. / asmca
The graphical interface is displayed to Disk Groups. We can see that the previously configured OCR_VOTE is already listed. Click create below to create ASM disk groups for datafile and flash recovery area.
Disk group name ORADATA, redundant section select External, click disk is ORCL:ASMDATA01, click OK. Continue create
Disk group name ORAFLASH, redundant section select External, disk is ORCL:ASMDATA02, click OK.
After all OK, click QUIT to exit.
4. ASMLib and other common commands
ORCL keyword description: discovery string of Linux ASMLib
ASMLib uses the discovery string to determine which disks ASM is requesting. A normal Linux ASMLib uses a glob string. The string must be prefixed with "ORCL:". The disk is specified by name. You can find a disk created with the name "VOL1" by discovering the string "ORCL:VOL1" in ASM. Similarly, you can query all disks that start with the string "VOL" with the discovery string "ORCL:VOL*".
The disk cannot be found with the path name in the discovery string. If the prefix is missing, the average Linux ASMLib will completely ignore the discovery string and think that it is suitable for a different ASMLib. The only exception is an empty string
It is considered to be a full wildcard. This is exactly equivalent to discovering the string "ORCL:*".
Other common commands:
SQL > create diskgroup dg2 external redundancy disk 'ORCL:VOL3'
SQL > drop diskgroup dg2 including contents; can delete the diskgroup of empty by default. If the disk group is not empty, an error will be reported if it is not connected to including contents. Specifying including contents deletes all files in the disk group, even if it is not empty.
SQL > alter diskgroup dg1 add disk 'ORCL:VOL3'
Diskgroup altered.
SQL > alter diskgroup dg1 rebalance power 8
Diskgroup altered.
SQL > alter diskgroup dg1 check all;-- check the consistency inside the ASM disk group
Diskgroup altered.
SQL > alter diskgroup dg1 check all repair;-- check and notify ASM to fix errors
Diskgroup altered.
5. Migration and file transfer / copy between ASM and file system
A, file transfer or copy
Files under ASM and OS file systems under 10g cannot be copied from each other.
11g from ASM to file system or file system to ASM is very convenient.
ASMCMD > cp spfileracdb.ora / tmp
Copying + oradata/racdb/spfileracdb.ora-> / tmp/spfileracdb.ora
[root@rac01 tmp] # ls-al spfileracdb.ora
-rw-r- 1 grid oinstall 4096 Dec 4 06:05 spfileracdb.ora
If you need to copy files under 10g, you can do the following:
Rman
Dbms_file_transfer
b. Use RMAN for migration.
At this point, the study on "what are the management and maintenance methods of ASM under Oracle11g RAC" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.