##### Oracle ASM Password File Commands From Asmcmd #####
asmcmd> pwcreate --asm -f '+DATA/orapwasm' --format=12
asmcmd> orapwusr --add test
asmcmd> orapwusr --grant sysasm test
asmcmd> orapwusr --grant sysdba test
asmcmd> lspwusr
asmcmd> orapwusr --delete test
##### Oracle ASM Check Disk Status and Mount Disk Group #####
SQL> COLUMN path FORMAT A20
SQL> COLUMN header_status FORMAT A10
SQL> COLUMN mount_status FORMAT A10
SQL> select path, header_status , mount_status from v$asm_disk;
PATH HEADER_STA MOUNT_STAT
-------------------- ---------- ----------
/dev/asm-disk2 MEMBER CACHED
/dev/asm-disk1 MEMBER CACHED
ls -l /dev/asm-disk*
lrwxrwxrwx. 1 root root 3 Jan 16 10:08 /dev/asm-disk1 -> sdb
lrwxrwxrwx. 1 root root 3 Jan 16 10:08 /dev/asm-disk2 -> sdd
fdisk -l /dev/sdb
Disk /dev/sdb: 3628.4 GB, 3628388371968 bytes, 7086696039 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 32768 bytes / 32768 bytes
ls -l /dev/sdb
brw-rw----. 1 oracle asmadmin 8, 16 Jan 16 10:16 /dev/sdb
ls -l /dev/sdd
brw-rw----. 1 oracle asmadmin 8, 48 Jan 16 10:16 /dev/sdd
fdisk -l /dev/sdd
Disk /dev/sdd: 5497.6 GB, 5497558138880 bytes, 10737418240 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 32768 bytes / 32768 bytes
SQL> SELECT name FROM v$asm_diskgroup;
NAME
----------
DATA
SQL> alter diskgroup DATA mount;
##### ORACLE ASM Add Disk To ASM DISKGROUP #####
grid_env
sqlplus / as sysasm
-- Learn ASM_DISKGROUPS
SELECT name AS diskgroup, compatibility AS asm_compat, database_compatibility AS db_compat FROM V$ASM_DISKGROUP;
-- Learn ASM_DISKS
SELECT dg.name AS diskgroup, d.name AS asmdisk, d.path, d.os_mb, d.total_mb, d.mount_status, d.state FROM V$ASM_DISKGROUP dg, V$ASM_DISK d WHERE dg.group_number = d.group_number;
show parameter asm_diskstring
ALTER DISKGROUP DATA ADD DISK '/dev/dm-5';
ALTER DISKGROUP DATA RESIZE DISK DATA_0000 SIZE 1000G;
-- CHECK ASM DISKGROUP SIZE
SELECT name, free_mb, total_mb, free_mb/total_mb*100 as percentage FROM v$asm_diskgroup;
asmcmd lsdg
Etiketler :
Oracle