You are on page 1of 3

ASM instance is about 100MB

1. views to check
v$asm_diskgroup, v$asm_disk, v$asm_file, v$asm_operation, v$asm_disk_stat, v$asm
_template, v$asm_alias
2. Show diskgroup_name
show parameter asm_diskgroup

Oracle® Database Oracle Clusterware and Oracle Real Application Clusters Install
ation Guide 10g Release 2 (10.2) for Microsoft Windows
http://download-uk.oracle.com/docs/cd/B19306_01/install.102/b14207/storage.htm

---------------------- ASMTOOL command line ------------------------------------


----------------
asmtool is a command-line interface for stamping disks. It has the following opt
ions:
Option Description Example
-add Adds or changes stamps. You must specify the hard disk, partition, and n
ew stamp name. If the disk is a raw device or has an existing Automatic Storage
Management stamp, then you must specify the -force option.
If necessary, follow the steps under "Creating Partitions for Logical Volumes" t
o create a disk partition for the ASM instance.

asmtool -add [-force]


\Device\Harddisk1\Partition1 ORCLDISKASM0
\Device\Harddisk2\Partition1 ORCLDISKASM2...
-addprefix Adds or changes stamps using a common prefix to generate stamps
automatically. The stamps are generated by concatenating a number with the prefi
x specified. If the disk is a raw device or has an existing Automatic Storage Ma
nagement stamp, then you must specify the -force option.
asmtool -addprefix ORCLDISKASM [-force]
\Device\Harddisk1\Partition1
\Device\Harddisk2\Partition1...
-list List available disks. The stamp, windows device name, and disk size in m
egabytes are shown. Some disks may be file systems, and cannot be stamped. If th
e disk is a raw device or has an existing ASM stamp, then you must specify the -
force option.
asmtool -list [-force]
-delete Removes existing stamps from disks.
asmtool -delete ORCLDISKASM0 ORCLDISKASM1...

==================== reconfigure DB console for ASM link =======================


=========
1. Tao 1 tablespace mà có datafile trong ASM diskgroup
$export ORACLE_SID=orcl
$sqlplus / as sysdba
CREATE TABLESPACE ASM_TAB DATAFILE '+diskgroup_name' SIZE 10M;

2. Re-configure EM db console of "orcl" to enable access ASM instance


$export ORACLE_SID=orcl
$emca -deconfig dbcontrol db
$emca -config dbcontrol db
3. Vào EM Homepage cua orcl se thay ASM link
====================== Migrate DB from file system to ASM ======================
===========
- run $ORACLE_HOME\BIN\localconfig add
- Create ASM instance (using DBCA)
- Using EM to migrate DB using ASM
- Re-configure EM db console
$export ORACLE_SID=orcl
$emca -deconfig dbcontrol db
$emca -config dbcontrol db
- Go to ASM home page
=========================== AU unit =======================
COARSE striping AU = 1MB
FINE striping AU = 128KB (for log files, control files)
=============== asmcmd command =========
set oracle_home
set oracle_sid=+ASM
asmcmd
ls -la <diskgroup_name>/<db_instance_name>/datafile
ls -la <diskgroup_name>/<db_instance_name>/onlinelog
ls -la <diskgroup_name>/<db_instance_name>/sontrolfile
======================
The ASM instance must be started before you can start any of the other related i
nstances.

1. Drop disk
ALTER DISKGROUP ASM_GROUP01 DROP DISK ASM_GROUP01_0001;
-- Check status
select name,state from v$asm_disk;
2. add disk
ALTER DISKGROUP DG1 ADD DISK '\\.\ORCLDISKDATA2' SIZE 25438 M force;
ALTER DISKGROUP DG1 ADD DISK '\\.\ORCLDISKDATA2' SIZE 25438 M force to failgroup
DG1_0000;
ALTER DISKGROUP dgroup_01
ADD DISK '$ORACLE_HOME/disks/d100';
3. Undrop
ALTER DISKGROUP asm_group01 UNDROP DISKS;
-- Check status
select name,state from v$asm_disk;
4. Add a directory
ALTER DISKGROUP asm_group01 ADD DIRECTORY '+asm_group01/mydir';
5. Rename a directory
ALTER DISKGROUP asm_group01 RENAME DIRECTORY '+asm_group01/mydir' TO '+asm_group
01/yourdir';
6. Drop a directory
ALTER DISKGROUP asm_group01 DROP DIRECTORY '+asm_group01/yourdir' FORCE;
7. Mount diskgroup
ALTER DISKGROUP <name> MOUNT/DISMOUNT
8. Create Diskgroup
create diskgroup dg1 external redundancy disk '/dev/dsk/c2t0d0s2';
9. Resize disk size
ALTER DISKGROUP dgroup1
RESIZE DISKS IN FAILGROUP failgrp1 SIZE 100G;

You might also like