Beruflich Dokumente
Kultur Dokumente
ASM Diskgroups
Create Diskgroup
CREATE DISKGROUP disk_group_1 NORMAL
REDUNDANCY
FAILGROUP failure_group_1 DISK
'/devices/diska1' NAME diska1,
'/devices/diska2' NAME diska2,
FAILGROUP failure_group_2 DISK
'/devices/diskb1' NAME diskb1,
'/devices/diskb2' NAME diskb2;
NOTE : The above disk group given as NORMAL redundancy, that means it contain 2 Fail groups (i.e.,
2 sets of each data is maintained) also similarly for EXTERNAL redundancy each data is made into
thrice(1 original and 2 duplicates) so it makes 3 fail groups in Disk group
Drop disk groups
DROP DISKGROUP DATA INCLUDING CONTENTS;
Add disks
ALTER DISKGROUP DATA ADD DISK '/dev/sda3';
Drop a disk
ALTER DISKGROUP DATA DROP DISK DATA_0001;
Rebalance diskgroup
ALTER DISKGROUP DATA REBALANCE POWER 5;
Check Diskgroup
ALTER DISKGROUP DATA CHECK;
ALTER DISKGROUP DATA CHECK NOREPAIR;
srvctl commands
ADD
srvctl add asm -n rac3 -i +ASM3 -o /opt/oracle/app/product/10.2.0/asm
ENABLE
srvctl enable asm -n rac3 -i +ASM3
DISABLE
srvctl disable asm -n rac3 -i +ASM3
START
srvctl start asm -n rac3
STOP
srvctl stop asm -n rac3
CONFIG
srvctl config asm -n rac1
REMOVE
srvctl remove asm -n rac1
STATUS
srvctl status asm
srvctl status asm -n rac1
MODIFY
srvctl modify asm -o -n rac1
asmcmd Commands
cd -----changes the current directory to the specified directory
du -----Displays the total disk space occupied by ASM files in the specified
ASM directory and all its subdirectories, recursively.
find -----Lists the paths of all occurrences of the specified name ( with wildcards) under the specified
directory.
ls +data/testdb ----Lists the contents of an ASM director, the attributes of the specified file, or the
names and attributes of all disk groups.
lsct -----Lists information about current ASM clients.
lsdg ----Lists all disk groups and their attributes
mkalias ----Creates an alias for a system generated filename.
mkdir -----Creates ASM directories.
pwd --------Displays the path of the current ASM directory.
rm
rm -f
rmalias ---------Deletes the specified alias, retaining the file that the alias points to
lsdsk ----------Lists disks visible to ASM.
md_backup ------Creates a backup of all of the mounted disk groups.
md_restore ------Restores disk groups from a backup.
remap ----repairs a range of physical blocks on a disk.
cp ------copies files into and out of ASM.
DISABLE
alter system stop rolling migration;
1.
2.
3.
4.
5.
6.
Step 1:
1
2
3
4
switched
switched
switched
switched
to
to
to
to
datafile
datafile
datafile
datafile
copy
copy
copy
copy
"+DATA/mydb/datafile/system.257.705063763"
"+DATA/mydb/datafile/sysaux.258.705064283"
"+DATA/mydb/datafile/undotbs1.259.705064821"
"+DATA/mydb/datafile/users.261.705064915"
+DATA/mydb/datafile/users.261.705064915
UNDOTBS1
+DATA/mydb/datafile/undotbs1.259.705064821
SYSAUX
+DATA/mydb/datafile/sysaux.258.705064283
SYSTEM
+DATA/mydb/datafile/system.257.705063763
NAME
-------+DATA/ctf1.dbf
FILE_NAME
--------------------------------------------+DATA/mydb/tempfile/temp.263.705065455
otherwise,
Create temporary tablespace in ASM disk group.
SQL> CREATE TABLESPACE temp1 ADD TEMPFILE +diskgroup1;
GROUP#
-------------------------------------------------- ---------/u01/new/oracle/oradata/mydb/redo03.log
/u01/new/oracle/oradata/mydb/redo02.log
/u01/new/oracle/oradata/mydb/redo01.log
GROUP#
----------
/u01/new/oracle/oradata/mydb/redo03.log
/u01/new/oracle/oradata/mydb/redo02.log
/u01/new/oracle/oradata/mydb/redo01.log
+DATA/mydb/onlinelog/group_4.264.705065691
+DATA/mydb/onlinelog/group_5.265.705065703
+DATA/mydb/onlinelog/group_6.266.705065719
If an additional control file is required for redundancy, you can create it in ASM as you would on any
other filesystem.
SQL> connect sys/sys@prod1 as sysdba
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
SQL> alter database backup controlfile to '+DATA/cf2.dbf';
Database altered.
SQL> alter system set control_files='+DATA/cf1.dbf ','+DATA/cf2.dbf' scope=spfile;
System altered.
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup