otmfaqForumsBlogsRegister
FAQMembers ListCalendarToday's PostsSearch


 Subscribe Blogs:RSS
 Subscribe Forums:RSS
OTMFAQ Home
OTMFAQ Blogs
OTMFAQ Forums
OTMFAQ Tutorials

OTM SIG
MavenWire


Database Administration Database installation, creation, administration and related topics.

Tags:

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old May 1st, 2007, 15:29
chrisplough's Avatar
Site Moderator
 
Join Date: Jun 2006
Location: West Chester, PA
Posts: 816
Blog Entries: 7
Thanks: 53
Thanked 199 Times in 121 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 10
chrisplough has a spectacular aura aboutchrisplough has a spectacular aura aboutchrisplough has a spectacular aura about
Send a message via AIM to chrisplough
[SCRIPT] DB Usage - mw-dbusage.sql

All,

Here's a simple script that I use to get the overall and per-tablespace usage from an Oracle DB. I use this when recreating a DB on another system, so that I can pre-allocate the datafiles and tablespaces before export/import. We often do this when replicating a client environment for thorough internal testing or migration assistance.

You must be logged in as sys or system in order to run and the output looks like:

Code:
SQL> @mw-dbusage.sql

  TOTAL_GB
----------
41.3867188


   USED_GB
----------
15.9564209


TABLESPACE_NAME                PERCENT_USED TOTAL_MB  USED_MB
------------------------------ ------------ -------- --------
INDX                                     97    5,750    5,570
DATA                                     99    5,250    5,197
LOB1                                     95    2,000    1,895
ARCHIVE                                  15    8,000    1,182
LOB4                                     93    1,000      925
SYSTEM                                   99      540      533
SYSAUX                                   98      290      285
LOB3                                     21    1,000      205
LOB2                                      9    1,000       90
EXAMPLE                                  52      150       78
LOB5                                      6    1,000       60
PART_4                                    6    1,000       59
LOB7                                      5    1,000       50
LOB6                                      4    1,000       40
PART_1                                    3    1,000       31
PART_3                                    3    1,000       30
PART_2                                    3    1,000       28
UNDOTBS1                                 13      175       22
REPORT                                    1    1,000       14
REPORTINDX                                1    1,000       14
BPL_DAY4                                  0    1,000        4
BPL_DAY7                                  0    1,000        4
BPL_DAY2                                  0    1,000        4
BPL_DAY5                                  0    1,000        4
BPL_DAY6                                  0    1,000        4
BPL_DAY1                                  0    1,000        4
BPL_DAY3                                  0    1,000        4
USERS                                    59        5        3

28 rows selected.

SQL>
Hope this helps!

--Chris
Attached Files
File Type: zip mw-dbusage.sql.zip (952 Bytes, 12 views)
__________________
Chris Plough
MavenWire

www.MavenWire.com

Last edited by chrisplough : May 15th, 2007 at 17:08. Reason: Added attachment (mw-dbusage.sql.zip)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old May 15th, 2007, 16:43
Junior Member
 
Join Date: Mar 2007
Posts: 12
Thanks: 2
Thanked 2 Times in 2 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 0
cheekythought is on a distinguished road
Re: Script: DB Usage - mw-dbusage.sql

Can you please attach the query? You seemed to have missed the attachment.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old May 15th, 2007, 17:12
chrisplough's Avatar
Site Moderator
 
Join Date: Jun 2006
Location: West Chester, PA
Posts: 816
Blog Entries: 7
Thanks: 53
Thanked 199 Times in 121 Posts
Groans: 0
Groaned at 0 Times in 0 Posts
Rep Power: 10
chrisplough has a spectacular aura aboutchrisplough has a spectacular aura aboutchrisplough has a spectacular aura about
Send a message via AIM to chrisplough
Re: Script: DB Usage - mw-dbusage.sql

Thanks for letting me know - I'm not sure how I missed it. The script has now been attached.

--Chirs
__________________
Chris Plough
MavenWire

www.MavenWire.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Usage of Debit Note sheriff Settlement 12 November 7th, 2007 08:50
[SOLVED] Problem with Capacity Usage Email List Archive 2 June 19th, 2007 05:02
Re: Problem with Capacity Usage Rick v100 Email List Archive 0 June 18th, 2007 12:30
[SCRIPT] Remote Restarts of OTM via RSH chrisplough SysAdmin and Management 1 June 12th, 2007 16:39
[SCRIPT] Remote Restart of OTM via SSH chrisplough SysAdmin and Management 0 June 12th, 2007 16:37



All times are GMT. The time now is 00:13.
Copyright © 2008, Open Book Solutions LLC. All rights reserved.

Sponsored by MavenWire - MavenWire.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37