DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Script for tablspace full sends a email

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Posts
    5

    Thumbs up Script for tablspace full sends a email

    Dear all
    i have seen this script

    -- SQL script to get tablespace infomation
    -- checkfree.sql

    set heading off
    set feedback off
    set linesize 256
    set tab off

    col Name format a20
    col "Data file" format a20


    select
    free.tablespace_name "Name",
    df.file_name "Data file",
    df.bytes "Size (bytes)",
    TO_NUMBER(sum(free.bytes)) "Free (bytes)",
    round(100*sum(free.blocks)/df.blocks) "(%)"
    from dba_free_space free,
    dba_data_files df
    where free.file_id=df.file_id
    group by free.tablespace_name,
    df.file_name,
    df.bytes,
    df.blocks
    order by 1;

    /* Shell script to call */
    /* $5 mean free percentage tablespace remain */

    sqlplus system/manager @checkfree.sql | \
    awk '$5 < 20 {print}' | mail -s "Tablespace near full" administrator@yourcompany.com


    i just have to send the information of all the tablspace top the mention email ID how could i do it

    or

    the above script how could i do it ....i dont know the shell scripting so please help me to resolve this .......

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    spool report out to a file and send it using sendmail
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Apr 2007
    Posts
    5

    how to use sendmail

    hi all
    please let me know how to use sendmail in oracle
    as i will mail the output in sendmail

    please help me

  4. #4
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    log into your Unix box
    man sendmail
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width