1. Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING) Click the link to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This message will disappear after you have made at least 12 posts. Thank you for your cooperation.

Billing SQL Query

Discussion in 'Scripting' started by bigred15, May 28, 2013.

  1. bigred15

    bigred15 New Member

    Joined:
    May 30, 2011
    Messages:
    52
    Likes Received:
    3
    Occupation:
    Senior Consultant
    Location:
    Melbourne, Australia
    Hi all,

    I am looking for an SQL query which will allow me to determine how many GB is being used in the primary storage pool by the nodes associated with domains.

    I have my policy domains configured for departments, like so:
    ACCNT_FILE
    ACCNT_DB2
    ACCNT_EXCH
    LEGAL_FILE
    LEGAL_DB2
    LEGAL_EXCH

    So I am looking for an SQL query which will determine the amount of occupancy by the nodes associated with the domains for accounting, for legal, for marketing etc...

    I've spent a couple of hours trying to work it out myself but I've really gotten nothing but excessive failed SQL queries. Does anyone have any queries which will help me here?

    Thanks in advance.

    Kind regards,
    Michael Andrews
     
  2.  
  3. Jeroen

    Jeroen Senior Member

    Joined:
    Oct 2, 2002
    Messages:
    355
    Likes Received:
    12
    Occupation:
    AIX + storage administrator
    Location:
    netherlands
  4. Tiger22

    Tiger22 Member

    Joined:
    Jan 28, 2008
    Messages:
    166
    Likes Received:
    11
    Occupation:
    IT Consultant
    Location:
    London, UK
    Here's a starting point...

    By Node:

    select auditocc.node_name, nodes.domain_name, auditocc.backup_mb from auditocc inner join nodes on auditocc.node_name = nodes.node_name order by nodes.domain_name

    Totals for each Domain:

    select nodes.domain_name as DOMAIN, sum(auditocc.backup_mb)/1024 as BACKUP_GB from auditocc inner join nodes on auditocc.node_name = nodes.node_name group by nodes.domain_name

    Format and tweak as you see fit.
     
  5. bigred15

    bigred15 New Member

    Joined:
    May 30, 2011
    Messages:
    52
    Likes Received:
    3
    Occupation:
    Senior Consultant
    Location:
    Melbourne, Australia
    That's exactly what I needed. Thanks for that mate.

    Cheers,

    bigred15
     

Share This Page