Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help with Database size script Post 302566730 by jnrpeardba on Friday 21st of October 2011 03:13:15 AM
Old 10-21-2011
Here is my results of running the script

Code:
$ ./db_size

SQL> 

SQL> exit

Here is the script
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

And this is what happens when I execute the same script after I access the database

Code:
# -- Total size of Database Size in GB
SQL> 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)) ||
  2   'GB'
  3  FROM dual;
PROMPT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'DATABASESIZEIS-->'||TO_CHAR(ROUND((SELECTSUM(BYTES)/1024/1024/
---------------------------------------------------------------
Database Size is --> 83GB
SQL> exit

As you can it works well if I enter the database, but I am trying to schedule this job via cron so that it runs overnight

Many thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to figure out the size in MB for an informix database

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

database image size

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

command(s) to find size of mysql database?

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

bash script working for small size files but not for big size files.

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

know the size of database

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

find the size of a database by counting all the used pages

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

Database Size

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

Solaris Volume Manger - Database Replicas Question - Benefits of Increasing Default Size?

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

Script to read file size and send email only if size > 0.

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. Shell Programming and Scripting

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 # -- Total size of Database Size in GB set echo off feedback off verify off pause... (2 Replies)
Discussion started by: jnrpeardba
2 Replies
vdltodmx(1)						      General Commands Manual						       vdltodmx(1)

NAME
vdltodmx - dmx configuration file parser and printer SYNOPSIS
vdltodmx infile outfile DESCRIPTION
vdltodmx reads the input file, which should be in VDL configuration file format. After a successful parse, a file in Xdmx configuration file format is written to the output file. The VDL file format is used with xmovie, which is available from http://www.llnl.gov/icc/lc/img/xmovie/xmovie.html EXAMPLE
Given the following VDL-format file: 0 2 # # 2560 2048 Left two-thirds [restrict=*:2] 2 :2.1 1280 2048 0 0 0 0 :2.2 1280 2048 1280 0 0 0 4 1280 1024 0 0 1280 1024 0 1024 1280 1024 1280 0 1280 1024 1280 1024 # 2560 2048 Right two-thirds [restrict=*:2] 2 :2.2 1280 2048 0 0 0 0 :2.3 1280 2048 1280 0 0 0 4 1280 1024 1280 0 1280 1024 1280 1024 1280 1024 2560 0 1280 1024 2560 1024 the following DMX-format file will be produced: # # virtual "Left two-thirds" 2560x2048 { display :2.1 1280x2048; display :2.2 1280x2048 @1280x0; } # virtual "Right two-thirds" 2560x2048 { display :2.2 1280x2048; display :2.3 1280x2048 @1280x0; } BUGS
If the VDL file is not in the expected format, the program will probably dump core. SEE ALSO
Xdmx(1), xdmxconfig(1), vdl(3), xmovie(1) X Version 11 xorg-server 1.12.4 vdltodmx(1)
All times are GMT -4. The time now is 02:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy