Linux.com

RHEL 5

Link to this post 07 Apr 10

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 -hl
and 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.

Link to this post 07 Apr 10

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.

Link to this post 07 Apr 10

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

Link to this post 08 Apr 10

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 [color=#008000]~password[/color]
df -hl [color=#008000]~ Print out needed[/color]
su - oracle
sqlplus /"as sysdba"
select count(*) from dba_objects where status='INVALID'; [color=#008000]~SQL Command that will need to return value[/color]

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'; ~SQL Command that will need to return value

Link to this post 08 Apr 10

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.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board