10-19-2011
Help with Database size script
Hello,
I'm not very good at scripting as my job is an DBA for a small firm, but now I'd like to implement a few cron jobs which access and report on the databases on an automatic basis.
This is my SQL TEXT
HTML Code:
# -- Total size of Database Size in GB
set echo off feedback off verify off pause off
SELECT 'Database Size is --> ' || TO_CHAR(ROUND((select sum(bytes)/1024/1024/1024 from dba_data_files) + (select sum(bytes)/1024/1024/1024 from v$log),0)) ||
'GB'
FROM dual;
PROMPT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
exit
The SQL part works fine. However I would like to schedule this via cron, so it runs on a weekly basis at say 4am every Monday.
The mail part I believe is as follows - which I can end at the end of the script
mail -s 'Database Size for Database DB1'
name@company.com < /tmp/dbsize.log
This will execute on a linux box under the Oracle user
Could someone please help and many thanks in advance
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
This is the info i have so far. please if you are dead positive can u let me know if i my math/process is correct.
Chunks
address chk/dbs offset size free bpages flags pathname
5003e1f8 1 1 0 250000 177177 PO- /database/link_cw_p01_rootdbs
5003e494 2 ... (5 Replies)
Discussion started by: Optimus_P
5 Replies
2. Solaris
hi ,
we are using Veritas netbackup 5 to backup all databases at our site.
i noticed lately that a specific filesystem on the netbackup servers in running critically out of space , after some investigations i found that there are images that are increasing in size everytime a backup is taken .... (6 Replies)
Discussion started by: ppass
6 Replies
3. UNIX for Dummies Questions & Answers
hello,
i'm trying to figure out the size of a mysql database shelling into my server with putty / command line.
is there / are there any commands that will return the size of a database, in MB?
thanks. (4 Replies)
Discussion started by: sbourgeois
4 Replies
4. Shell Programming and Scripting
Hi,
I have one file stat.
Stat file contents are as follows: for example.
H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000
H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000
Now i... (1 Reply)
Discussion started by: davidpreml
1 Replies
5. HP-UX
Hi all ,
How to know the size of a oracle database running in hp-ux server. (1 Reply)
Discussion started by: megh
1 Replies
6. UNIX for Dummies Questions & Answers
Hi all,
I am looking to find the size of the database by counting all the used pages.
1. I have a file which reads like below
16384 4750850
32768 165
The first column is the pagesize and the second column is the number of pages... (6 Replies)
Discussion started by: family_guy
6 Replies
7. UNIX and Linux Applications
Can anybody tell me how to look for the size of the database on the solariis servers.
I am using Solaris 5.6 and Solaris 1.1.1
Any help will be appreciated.................. (1 Reply)
Discussion started by: asalman.qazi
1 Replies
8. Solaris
Hey all!
I was hoping someone knew anything about this one...
I know with Solaris Volume Manager the default Database Replica size is 8192 blocks (4MB approximately)
Now I know you can increase this amount but is there any point?
The reason I am asking this is that I've setup mirroring on... (2 Replies)
Discussion started by: Keepcase
2 Replies
9. Shell Programming and Scripting
Hi Experts,
I have a script like
$ORACLE_HOME/bin/sqlplus username/password # << ENDSQL
set pagesize 0 trim on feedback off verify off echo off newp none timing off
set serveroutput on
set heading off
spool Schemaerrtmp.txt
select ' TIMESTAMP COMPUTER NAME ... (5 Replies)
Discussion started by: welldone
5 Replies
10. UNIX for Dummies Questions & Answers
Hello,
I'm not very good at scripting as my job is an DBA for a small firm, but now I'd like to implement a few cron jobs which access and report on the databases on an automatic basis.
This is my SQL TEXT
# -- Total size of Database Size in GB set echo off feedback off verify off... (4 Replies)
Discussion started by: jnrpeardba
4 Replies
LEARN ABOUT OPENDARWIN
queuedefs
queuedefs(4) File Formats queuedefs(4)
NAME
queuedefs - queue description file for at, batch, and cron
SYNOPSIS
/etc/cron.d/queuedefs
DESCRIPTION
The queuedefs file describes the characteristics of the queues managed by cron(1M). Each non-comment line in this file describes one queue.
The format of the lines are as follows:
q.[njobj][nicen][nwaitw]
The fields in this line are:
q The name of the queue. a is the default queue for jobs started by at(1); b is the default queue for jobs started by batch (see
at(1)); c is the default queue for jobs run from a crontab(1) file.
njob The maximum number of jobs that can be run simultaneously in that queue; if more than njob jobs are ready to run, only the first
njob jobs will be run, and the others will be run as jobs that are currently running terminate. The default value is 100.
nice The nice(1) value to give to all jobs in that queue that are not run with a user ID of super-user. The default value is 2.
nwait The number of seconds to wait before rescheduling a job that was deferred because more than njob jobs were running in that job's
queue, or because the system-wide limit of jobs executing has been reached. The default value is 60.
Lines beginning with # are comments, and are ignored.
EXAMPLES
Example 1: A sample file.
#
#
a.4j1n
b.2j2n90w
This file specifies that the a queue, for at jobs, can have up to 4 jobs running simultaneously; those jobs will be run with a nice value
of 1. As no nwait value was given, if a job cannot be run because too many other jobs are running cron will wait 60 seconds before trying
again to run it.
The b queue, for batch(1) jobs, can have up to 2 jobs running simultaneously; those jobs will be run with a nice(1) value of 2. If a job
cannot be run because too many other jobs are running, cron(1M) will wait 90 seconds before trying again to run it. All other queues can
have up to 100 jobs running simultaneously; they will be run with a nice value of 2, and if a job cannot be run because too many other jobs
are running cron will wait 60 seconds before trying again to run it.
FILES
/etc/cron.d/queuedefs queue description file for at, batch, and cron.
SEE ALSO
at(1), crontab(1), nice(1), cron(1M)
SunOS 5.10 1 Mar 1994 queuedefs(4)