Script to report database home in unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to report database home in unix
# 1  
Old 05-16-2012
Script to report database home in unix

Hello:

I am trying to build a ksh shell script which would summarize space occupied by "product" directory under /u*/app/oracle
and summarize and report the total size occupied by it in one server.

Environment is this...

HP UNIX 11i

Korn Shell


some thing like
Code:
/u402/app/oracle/product
du -s /u402/app/oracle/product
24991150 /u402/app/oracle/product - A 
/u12/app/oracle/product
du -s /u12/app/oracle/product
12975244 /u12/app/oracle/product - B 
/u25/app/oracle/product
du -s /u25/app/oracle/product
11699776 /u25/app/oracle/product - C

Total size in MB ==> A+B+C
Some thing like this.
Regards,
Sammy
Moderator's Comments:
Mod Comment please user code tags to format data

Last edited by jim mcnamara; 05-17-2012 at 08:15 AM..
# 2  
Old 05-17-2012
Not clear what you want but this gives the output you asked for:

Code:
du -h -s  /u*/app/oracle/product

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

UNIX script home work

plz can any one help to write the script of the output provided in the pdf. There are 2 tasks A and B. (5 Replies)
Discussion started by: mohdsadik90
5 Replies

2. Shell Programming and Scripting

How to avoid locks while loading database through UNIX script.?

Hi, I have the following requirement: I have load_cdr as main scriptwhich loads all the file records into vertica database through unix script. But there are two files which try to update same table..n thats y my script is getting failed... Can any1 give me some logic how to over come this... (6 Replies)
Discussion started by: gnnsprapa
6 Replies

3. Shell Programming and Scripting

Export data from database in Excel sheet with the help of Shell script and automated the report

Export data from database in Excel sheet with the help of Shell script and automated the report every day in the mornig. (1 Reply)
Discussion started by: neeraj617
1 Replies

4. Shell Programming and Scripting

Database Connection test in unix Script

i have a unix script that gives me the sysdate from the database EDNAMID.WORLD.What i want my script to do the following 1) Establish a database connection 2) if database connection is successfull then echo the message "Connected" 3) put the o/p of the Sql query in a spool file 4) then... (3 Replies)
Discussion started by: ali560045
3 Replies

5. Shell Programming and Scripting

unix script for loading a data from a file into database

Hi All, I am trying to load a data from a files in a particular directory to a database.. cd $SCC isql metdb >> ${LOGDATA}/LOAD.LOG < ! load from "${LDATA}/${FORM}.ld" insert into $LOADTABLE ! But it's showing the error "syntax error at line 46 : `<<' unmatched" Can u plz help me... (5 Replies)
Discussion started by: grajesh_955
5 Replies

6. Shell Programming and Scripting

how will i connect postgres database from unix shell script

I have got the solution so just closing this issue. (3 Replies)
Discussion started by: jambesh
3 Replies

7. Shell Programming and Scripting

Connecting and Querying DB2 database from Unix Script?

I am trying to develop a script that can connect to a DB2 database mainframe and Query the database and display the results. I've been researching, but I have yet to find a definitive solution where I can enter in the Mainframe DB2 address db2:// and query the database and return the results. If... (2 Replies)
Discussion started by: developncode
2 Replies

8. Shell Programming and Scripting

Script to check and report database file sizes...

Need help for a script to check and report database file sizes. (2 Replies)
Discussion started by: marconi
2 Replies

9. Shell Programming and Scripting

what is uses of unix shell script in database projects

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (2 Replies)
Discussion started by: alokjyotibal
2 Replies

10. Shell Programming and Scripting

getting dump from database by UNIX script

can i make a dump to happen from my script in a databse.and download that dump. I want to schedule a script i cron so that i will make a dump and download that inot my server. (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
Login or Register to Ask a Question