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
atrm(1) User Commands atrm(1)
NAME
atrm - remove jobs spooled by at or batch
SYNOPSIS
atrm [-afi] [ [ job #] [user...]]
DESCRIPTION
The atrm utility removes delayed-execution jobs that were created with the at(1) command, but have not yet executed. The list of these jobs
and associated job numbers can be displayed by using atq(1).
atrm removes each job-number you specify, and/or all jobs belonging to the user you specify, provided that you own the indicated jobs.
You can only remove jobs belonging to other users if you have solaris.jobs.admin privileges.
OPTIONS
The following options are supported:
-a All. Removes all unexecuted jobs that were created by the current user. If invoked by the privileged user, the entire queue will
be flushed.
-f Force. All information regarding the removal of the specified jobs is suppressed.
-i Interactive. atrm asks if a job should be removed. If you respond with a y, the job will be removed.
FILES
/var/spool/cron/atjobs spool area for at jobs
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
at(1), atq(1), auths(1), cron(1M), auth_attr(4), attributes(5)
SunOS 5.10 13 Aug 1999 atrm(1)