Welcome to the Linux Foundation Forum!

RHEL 5

Hi Guys / Girls,

Im hoping that someone can help me out by some small chance.

Im currently a (very very new and trying to learn things rapidly) DBA, we have reports that we manually do on our RHEL5 servers all the time as well as SQLPLUS and Oracle, Im also asking there so dont worry :P

What I want to do is Create some sort of report that can On demand create a report that I design, that has various things on it.

for instance from our linux servers I get things like avaliable disk space on the /u01 partition using df -hland I look at the one file and ensure there are no errors using less /u01/*****.log

on SQL there are a few different things I check on the ORACLE services such as invalid counts etc etc. all the commands are avaliable if needed.

But now what I want to know is this, is there possibly a open source reporting service that can return this information and arrange it as I need it too????

Thanks in advance for all your assist.

Comments

  • mfillpot
    mfillpot Posts: 2,177
    You can accomplish your tasks through shell scripting. You can build a shell script file to grab the necessary information is the particular order, clean it, concatenate it and e-mail or store it for later use.
  • Digiza
    Digiza Posts: 11
    ah.......:blink: .........um....:S

    OK I know what your refering to as far as shell scripting goes. BUT:blink:

    I have Zero idea how to accomplish this.:blush: Im still exceptionally new to Linux, know how to do the basics, and have never worked with shell scripting, so not too sure how it works, how to pull info etc...

    Can you assist with a example please????

    just on this basically.
    I would need the data displayed returned.

    ssh root@proddb1
    bob123 ~password
    df -hl ~ Print out needed
    su - oracle
    sqlplus /"as sysdba"
    select count(*) from dba_objects where status='INVALID'; ~SQL Command that will need to return value

    And this would have tp repeat for proddb1-4

    Sorry for being a pain in the behind. Hope you can assist
  • mfillpot
    mfillpot Posts: 2,177
    Digiza wrote:
    ah.......:blink: .........um....:S

    OK I know what your refering to as far as shell scripting goes. BUT:blink:

    I have Zero idea how to accomplish this.:blush: Im still exceptionally new to Linux, know how to do the basics, and have never worked with shell scripting, so not too sure how it works, how to pull info etc...

    Can you assist with a example please????

    just on this basically.
    I would need the data displayed returned.

    ssh root@proddb1
    bob123 ~password
    df -hl ~ Print out needed
    su - oracle
    sqlplus /"as sysdba"
    select count(*) from dba_objects where status='INVALID'; ~SQL Command that will need to return value

    And this would have tp repeat for proddb1-4

    Sorry for being a pain in the behind. Hope you can assist

    You almost already have the script, the issue we have now is that it will need to be two seperate scripts one run from the root user and one for the oracle user, you can schedule them in the crontabs file. The reason for the seperation is that you do not want a script to hold a username or password especially on an oracle server.

    for root:
    #!/bin/bash
    # Get the disk usage details
    df -hl>newfile_onserver.txt
    

    for oracle
    #!/bin/bash
    # Get the output of an oracle table
    
    # This is unknown to me, but you want to run the cli command to log into oracle 
    # and run a sql script to output the file
    
    # conver the below into a sql script
    #sqlplus /"as sysdba"
    #select count(*) from dba_objects where status='INVALID'; [color=#008000]~SQL Command that will need to return value
    
  • Digiza
    Digiza Posts: 11
    Thanks mfillpot,

    Ill look at it and get back to you if need be, atleast now have a better Idea what I can do :)

    Thanks again.

Categories

Upcoming Training