Create Directory Under ASM Diskgroup

In this activity, you will understand how to create directories inside disk groups to place data. Unlike OS level commands, Adding directories to ASM disk groups is little different. There are two ways to do this:

  • Using ASMCMD utility
  • Using SQLPLUS (for ASM)

CREATE DIRECOTRY USING ASMCMD UTILITY

Type asmcmd at command prompt.

# asmcmd
ASMCMD>

Under asmcmd, you can use many OS level commands like

  • ls – to list contents,
  • pwd – check present working directory,
  • mkdir – create new directory,.
  • rm – remove directory or file,
  • cp – copy file or directory
ASMCMD> ls
CRSVOL1/
DATAVOL1/
FRAVOL1/
RMANVOL/

Let us create directory under RMANVOL diskgroup:

ASMCMD> cd RMANVOL/
ASMCMD> mkdir RMAN_BACKUP
ASMCMD> mkdir RMAN_SCRIPT
ASMCMD> mkdir RMAN_LOG

You can create multiple directories in one single command too

ASMCMD> mkdir RMAN_BACKUP RMAN_SCRIPT RMAN_LOG

CREATE DIRECTORY USING SQLPLUS (FOR ASM)

Connect to Oracle (or grid) user and export Oracle home and SID variables to point Grid home and ASM instance

# sqlplus / as sysasm

Issue below SQL queries to create directories:

SQL> alter diskgroup RMANVOL add directory ‘+RMANVOL/RMAN_BACKUP’;
SQL> alter diskgroup RMANVOL add directory ‘+RMANVOL/RMAN_SCRIPT’;
SQL> alter diskgroup RMANVOL add directory ‘+RMANVOL/RMAN_LOG’;

Was this article helpful?

Related Articles

Leave a Comment