000027928 - KB-1550 - How to tell how much space is used in ASM partition?

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000027928
Applies To

Affected Versions: All Versions
Platform:  hardware appliances

Issue

The Oracle ASM partition, when used on a RSA hardware Appliance, is formatted and managed by the Oracle ASM software. As such, it's not seen by typical OS 'space usage' commands, such as df -kh, or du -a, or ls -ltr.


The only way to 'see' the ASM partition itself, is thru a device command such as fdisk -l, run as the Linux 'root' user.  However, the fdisk command only shows you the 'size' of the partition, not how much space is used within that partition.
 


How can you 'see' how much ASM space is used?


To see how much space is available and used in the ASM partition for Oracle 10g, the environment variable ORACLE_SID must be defined to the ASM instance name. On an Aveksa appliance, this sid is +ASM. The default value for the Linux 'oracle' or 'admin' account logins, is the database sid name, AVDB.

To see how much space is available and used in the ASM partition for Oracle 11g, the environment variable ORACLE_SID as well as the variable for ORACLE_HOME must be re-defined, as noted in the examples shown below.

TasksDefine the appropriate Oracle environment variables as noted below, depending on the version of Oracle being used, to be able to view hardware appliance use of Oracle's ASM partition using Oracle's asmcmd command.
Resolution

For ACM 3.6+, 4.X+ (Using Oracle 10g)


 


To see the space used, define ORACLE_SID to +ASM, using the Linux export command. Then, make use of the Oracle ASM command, asmcmd lsdg,  to see actual ASM space used. These commands can be run as either the Linux 'admin' or 'oracle' user.
In the example below, we only show part of the information returned by this command, and highlight the key 'space' infomation.   


 


For example:


 


$ export ORACLE_SID=+ASM
$ asmcmd lsdg


State Type  Sector Block     Total_MB   Free_MB   Offline_disks   Name
MNTED EXT      512  4096      1713401   1676996               0   DG01/



$ export ORACLE_SID=AVDB
(unless you logoff, and relogin, the default value for ORACLE_SID must be reset)


 


This output is telling us that there is 1.7 Tb of space available to the ASM partition, and approx 36gb of that is currently being used. (1713401mb - 1676996,   mb = 36000mb, or 36gb)


 


 


for ACM 5.x, 6.x  (using Oracle 11g)


 


To see the space used when ACM 5.x or IMG 6.x is in use, BOTH the ORACLE_SID and ORACLE_HOME environment variables must be defined. The ORACLE_SID environment variable needs to be set to +ASM, and the ORACLE_HOME environment variable must be set topoint to the ORACLE_GRID_HOME.  This can be done  using the Linux export command.
Once the appropriate environment variables are defined, the Oracle ASM command, asmcmd lsdg, can be used to see actual ASM space used. These commands can be run as either the Linux 'admin' or 'oracle' user.
In the example, we only show part of the information returned by this command, and highlight the key 'space' infomation.


 


In Oracle 11G use the following commands to switch from the Oracle AVDB instance to the +ASM instance:
 


For example:

$ echo $ORACLE_SID
AVDB

 


$ echo $ORACLE_GRID_HOME
/u01/app/11.2.0/grid



$ echo $ORACLE_HOME
/u01/app/oracle/product/11.2.0/db_1


 


$ export ORACLE_SID=+ASM
$ export ORACLE_HOME=$ORACLE_GRID_HOME
$ export PATH=$ORACLE_GRID_HOME/bin:$PATH


 


$ asmcmd lsdg


 



State    Type  Sector    Block      Total_MB    Free_MB       Name
 MNTD     EXT     512     4096
                 307094            298612       DG01/


This output is telling us that there is approximately  300gb of space available to the ASM partition, and approx 29gb of that is currently being used.


 


 


Note that if the asm lsdg command returns:
 


[oracle@vm-support-04 ~]$ asmcmd
Connected to an idle instance.
ASMCMD> lsdg
ASMCMD-08102: no connection to ASM; command requires ASM to run


 


This could be an indication that there is very little or no space left on the local OS partition.. and is not indicative of space on ASM. When the local space is 'cleaned up', the lsdg command can return expected output.


 


After checking the ASM space, these environment variables should be redefined back to their defaults:  ORACLE_HOME and ORACLE_SID:


 


 


$ export ORACLE_SID=AVDB
$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1


 


The reason that both ORACLE_SID and ORACLE_HOME are 'reset', is to ensure that non-Grid commands function properly. Another way to do this would be to logoff, and then log back on, or by executing the ACM  environment script /home/oracle/setDeployEnv.sh.


 


If these are NOT redefined/reset, then execution of sqlplus to access the database might fail with an error like this:


 


$ sqlplus avuser/<avuser-password>


SQL*Plus: Release 11.2.0.2.0 Production on Mon Dec 5 17:46:51 2011


Copyright (c) 1982, 2010, Oracle. All rights reserved.


ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory
Process ID: 0
Session ID: 0 Serial number: 0


 


Attachments

    Outcomes