Reducing unused tablespace size

Hi,
i have oracle database 10g on linux.
when i initially created tablespaces i allocated a huge amount of space, but when i checked the actual data size in eac tablespace, they are very small.
and now i want to backup my tablespaces in a tape drive. but the size of all the tablespace is bigger then my tape.
is there a way where i can reduce the size of my tablespaces. for example my "USERS" tablespace has only data occupying only 3 GB but i allocated about 10GB as the size for USERS tablespace.
so how can i bring the size down to 5GB so i do need to backup unnecessary space on my tape.
Thanks,
Philip.

Hi,
First run below query and according query output you can reduce you tablespace size.
ORA-03297: file contains used data beyond requested RESIZE value
SQL> select bytes/1024 from dba_data_files where file_id = 6;
BYTES/1024
7168
SQL> select sum(bytes/1024) from dba_segments where tablespace_name = 'EXAMPLE';
SUM(BYTES/1024)
5440
SQL> alter database
2 datafile 'c:\oracle\product\10.1.0\oradata\db02\example01.dbf' resize 5500k
alter database
ERROR at line 1:
ORA-03297: file contains used data beyond requested RESIZE value
According below query output you can reduce your tablespace size up to HWM.
if you want to reset HWM you can use 1.export + import OR alter table + rebuild index.
SQL> ed
Wrote file afiedt.buf
1 select
2 a.file_name,
3 a.bytes file_size_in_bytes,
4 (c.block_id+(c.blocks-1)) * &_BLOCK_SIZE HWM_BYTES,
5 a.bytes - ((c.block_id+(c.blocks-1)) * &_BLOCK_SIZE) SAVING
6 from dba_data_files a,
7 (select file_id,max(block_id) maximum
8 from dba_extents
9 group by file_id) b,
10 dba_extents c
11 where a.file_id = b.file_id
12 and c.file_id = b.file_id
13 and c.block_id = b.maximum
14* and c.tablespace_name = 'EXAMPLE'
SQL> /
Enter value for blocksize: 8192
old 4: (c.block_id+(c.blocks-1)) * &_BLOCK_SIZE HWM_BYTES,
new 4: (c.block_id+(c.blocks-1)) * 8192 HWM_BYTES,
Enter value for blocksize: 8192
old 5: a.bytes - ((c.block_id+(c.blocks-1)) * &_BLOCK_SIZE) SAVING
new 5: a.bytes - ((c.block_id+(c.blocks-1)) * 8192) SAVING
FILE_NAME
FILE_SIZE_IN_BYTES HWM_BYTES SAVING
C:\ORACLE\PRODUCT\10.1.0\ORADATA\DB02\EXAMPLE01.DBF
7340032 6356992 983040
SQL> alter database
2 datafile 'c:\oracle\product\10.1.0\oradata\db02\example01.dbf' resize 63569
92;
Database altered.regards
Taj

Similar Messages

  • Reduce the tablespace size

    Hi,
    In my database, one tablespace used 5% and it's size is 8GB when i try to shrink the tablespace it gives the error that you can not shrink the tablespace.
    So can you please tell me that how can i reduce the size of that tablespace.
    Thanks in advance.

    1) Export the tables of that tablepsace
    2) Create a new tablespace and dump those tables into new tablespace
    3) Drop the 8GB tablespace.
    OR
    1) Move online the tables of 8 GB tablespace into another tablespace. Rebuild the indexes.

  • Reducing the tablespace size

    Hi,
    My database size has been grown upto 20GB. So we thought of dropping the users after taking the backup. The problem is even after dropping the user, the size has not been decreased. But when i see the datafile, there it is showing that the percentage of memory occupied is reduced from 99% to 10%.
    How can i free up the space.
    Regards,
    Alok Dubey

    This is not the correct forum to deal with your question. This forum deal with the languages SQL and PL/SQL. You have a general database (use & administration) question.
    Please ask this question in the [url http://forums.oracle.com/forums/forum.jspa?forumID=61]Database - General forum.
    Simple answer to your question. Dropping a user/schema/table/index frees up space in the tablespace (depending on the size of that being dropped).
    It does not decrease the size of the tablespace. (and a tablespace occupies disk space and not memory).
    Reducing the size of a tablespace is not a trivial task as it cannot be simply shrunk as there can be data blocks in use at the high-end of the tablespace. Thus the answer to your question is also not trivial and more than one approach can be considered.. which is why you would be best served asking this in the proper forum.

  • How to shrink tablespace size if there is more unused space ??

    i have a tablespace it's size has increased upto 800MB but only 200MB is used, how can i minimize this gap b/w actual size and used size.
    i think i may have wrongly set the autoextent parameter.
    Please help

    You said is has increased upto 800M , but only used 200MB?
    How it is possible? Tablespace size increases to accomodate space for new data.
    Is it possible that data might have deleted?
    Use the following command to resize the datafile. If the HWM is set to higher than this, the command will with an errors.
    RROR at line 1:
    RA-03297: file contains used data beyond requested RESIZE value
    Syntax:
    ALTER DATABASE DATAFILE 'tools01.dbf' RESIZE 250m;
    Jaffar

  • How can I reduce the file size when saving a psd as a pdf

    I have a psd with graphics and text, it is 8.5 x 11, 300 ppi
    I flatten the image and go to save as .pdf I un-check all of the options in general.
    In compression, I have tried a dozen different combinations and the way I've found to get a document that is not pixelated or blurry is to use jpeg 2000 > lossless or jpeg > maximum.
    So I have a high quality document but the file sizes are around 900 kb.
    I have downloaded other people's documents of the exact same type and size (8.5 x 11, 300 ppi) that I am making and viewed them in Photoshop, they are not pixelated or blurry and their file sizes are 300 kb or even less than 200 kb
    How are they doing this?!

    Delete all unused, invisible layers.
    Sometimes zip compression is better than jpg compression (in the pdf output settings). Zip is lossless, and works better with non gradient colour or no images.
    Flattening the image before you save it to pdf can reduce the file size if you are using jpg compression.
    Post a preview of your pdf and we can comment further on how to reduce the file size.

  • Reducing imovie library size

    Hello
    Here is my Problem
    I have an external hd with 500gb full with only imovie. It has been backed up with time machine to a larger hd together with my imac backup.
    I have already deleted unused footage and now have only the minimum footage for watching old projects plus all footage from current projects. But I am still running out of room and would like to delete all the old projects so they are no longer in imovie. I Always make camera archives so if I ever need the original footage i have it.
    What i would like to do.
    I want export all the finished projects on to my computer. I have done some already but am not sure of the best way. Exporting full quality AIC format I am getting 1gb per minute of video, this is going to take up way to much space on my computer. I have tried to export to itunes in full quality, this gives better results on the file size, but I am worried if a put all my home video in itunes things will start getting slow.
    How can I export my video without losing quality and not have the huge file sizes? and where is the best place to store it? itunes or just in files?
    Hope I can get some help

    i've heard people have been able
    to reduce their library size to only 30% of the size
    of their referenced files...
    When the originals are high-res RAW files or TIFFs, sure.
    Even with Previews turned off and deleted, Aperture still contains three or more* small thumbnails for each Version - the smaller ones are what you see in the browser pane and the 1024px one is what you see when laying out books, light tables and the detail pages for web galleries. These thumbnails take up ~400-600Kb each, so 1GB for 1300+ thumbnails (plus extra versions and masters) is about right.
    Ian
    *If you've made adjustments to an image then you end up with more thumbnails as you can still view the 'master' unadjusted image by hitting 'M'.

  • How can I reduce the file size rendered by After Effects?

    When I render a relatively simple 5 second project in After Effects, the file size of the resultant .avi is 64MB.  If I change the properties to reduce the file size, the degradation makes the file unusable.  What am I doing wrong?

    Is AE's encoder really that inefficient? 
    The thing is, AVI doesn't mean much.
    It's pretty much an empty container box, which doesn't imply a quality level.
    So, AME could default to something completely different as a starting point to produce an AVI file.
    AE defaults to uncompressed video when you pick AVI as a format. So, obviously this produces huge file sizes. There could be similar quality thresholds with smaller sizes if you pick other AVIcodecs, but that's a different subject. And in any case, when you're rendering a production quality master,  file size is usually not your main concern. You typically use this high quality video file as a source for compressed flavors for distribution. So, pristine video files with huge sizes are a good thing - people then wonder why trailers at apple.com, for instance look so good. And the thing is, the most compressed formats benefit enormously from having an uncompressed file as a source.
    Regarding encoding efficiency, yes, AE is less efficient than dedicated encoding solutions. Above all, because it doesn't support 2 pass encoding. Note that for some formats, 2 pass makes a night and day difference, while for others, nothing as drastic as most users seem to believe.
    All of this is a moot point for AVI, because the default AVI codecs don't offer these encoding options, which are more the realm of distribution formats like FLV, MPEG-4/H264 or WMV.
    There are distribution codecs which use AVI as a container out there, but those are a different case.

  • UNDO Tablespace size

    Hi,
    We have a production database with size 120GB (DB Version 11.1.0.6), And our UNDO Tablespace size is 30GB.
    For the past 4 days the UNDO tablespace utilization is more than 85%.
    We have disabled the AUTOEXTEND for the UNDO Tablespace.
    So the UNDO RETENTION is dynamically calculated by Oracle itself and the value now is
    TUNED_UNDORETENTION
    339183
    Please suggest how to fix this issue.
    Thanks !

    Hi,
    The UNDO Tablespace size is still increasing. We dont have flashnack enabled for our database.
    The database is 11.1.0.6 Standard Edition.
    TABLESPACE TOTAL_SIZE_IN_MB FREE_SPACE_IN_MB % FREE %USED
    UNDOTBS1 32152 4440 14 86.19
    USERS 123784 23120 19 81.32
    SYSTEM 1536 465 30 69.73
    SYSAUX 1024 449 44 56.15
    GGS_DATA 2048 1388 68 32.23
    We enabled AUTOEXTEND on for one of the datafiles in UNDO Tablespace.
    NAME TYPE VALUE
    undo_management string AUTO
    undo_retention integer 9000
    undo_tablespace string UNDOTBS1
    select to_char(begin_time, 'DD-MON-RR HH24:MI') begin_time,
    to_char(end_time, 'DD-MON-RR HH24:MI') end_time, tuned_undoretention
    from v$undostat order by end_time;
    BEGIN_TIME END_TIME TUNED_UNDORETENTION
    23-DEC-11 18:15 23-DEC-11 18:25 375077
    23-DEC-11 18:25 23-DEC-11 18:35 375678
    23-DEC-11 18:35 23-DEC-11 18:45 376278
    23-DEC-11 18:45 23-DEC-11 18:51 376578
    Please let me know how can i reduce the space consumed by UNDO Tablespace.

  • Tablespace Size

    hi,
    I am using Oracle 8i. From DBA studio i see that the space assigned to data files is 98.5% full. will it affect performance ?? Ther is very few much space avaiable in the drive. Data file size is around 12 GB auto extend is 50% and free space is 3 GB.
    Please suggest...

    If the data blocks are not cached in your shared pool , then it will read data blocks from the datafiles and this will leads to some performance issuies.Kuljit already pointed out from your answer that data blocks resides in buffer cache not in the shared pool.
    My point is, sometimes, physical reads are better than logical reads. To tune a query, one must concentrate to reduce logical reads. (buffer gets).
    Regarding tablespace size and performance problem, as long as there is free space is avaialble then no problems.
    If the tablespace is 100% used and its data files are autoextend enabled, then, when oracle needs space to insert datafile and tbs is 100% and its datafile are autoextend, then, oracle has to allocate new exten to keep the data. In this scinario, there might be a slight issue.
    If the tbs is locally managed, it will not be that must.
    Moreover, if the database is OLTP with heavey transactions, then, its always better to have good amount of free space i the tablespaces.
    Jaffar

  • Reduce ai file size?

    Hi all,
    I have an ai file. It is exported from PRo-E, so there are lot of nodes in that ai file which makes the file size larger. Is there any way to simplify the ai file without disturbing the profile of the entities in ai file. I tried Simplify options. It worked a little bit. But i want any other option to simplify the ai file in order to reduce the file size in a larger extent.
    Thank you in advance.

    savera,
    And have you removed any unused  things like Swatches/Brushes/Symbols/Styles, and whatever (else) may have been carried over from the original application?

  • A simple and free way of reducing PDF file size using Preview

    Note: this is a copy and update of a 5 year old discussion in the Mac OS X 10.5 Leopard discussions which you can find here: https://discussions.apple.com/message/6109398#6109398
    This is a simple and free solution I found to reduce the file size of PDFs in OS X, without the high cost and awful UI of Acrobat Pro, and with acceptable quality. I still use it every day, although I have Acrobat Pro as part of Adove Creative Cloud subscription.
    Since quite a few people have found it useful and keep asking questions about the download location and destination of the filters, which have changed since 2007, I decided to write this update, and put it in this more current forum.
    Here is how to install it:
    Download the filters here: https://dl.dropboxusercontent.com/u/41548940/PDF%20compression%20filters%20%28Un zip%20and%20put%20in%20your%20Library%20folder%29.zip
    Unzip the downloaded file and copy the filters in the appropriate location (see below).
    Here is the appropriate location for the filters:
    This assumes that your startup disk's name is "Macintosh HD". If it is different, just replace "Macintosh HD" with the name of your startup disk.
    If you are running Lion or Mountain Lion (OS X 10.7.x or 10.8.x) then you should put the downloaded filters in "Macintosh HD/Library/PDF Services". This folder should already exist and contain files. Once you put the downloaded filters there, you should have for example one file with the following path:
    "Macintosh HD/Library/PDF Services/Reduce to 150 dpi average quality - STANDARD COMPRESSION.qfilter"
    If you are running an earlier vesion of OS X (10.6.x or earlier), then you should put the downloaded filters in "Macintosh HD/Library/Filters" and you should have for example one file with the following path:
    "Macintosh HD/Library/Filters/Reduce to 150 dpi average quality - STANDARD COMPRESSION.qfilter"
    Here is how to use it:
    Open a PDF file using Apple's Preview app,
    Choose Export (or Save As if you have on older version of Mac OS X) in the File menu,
    Choose PDF as a format
    In the "Quartz Filter" drop-down menu, choose a filter "Reduce to xxx dpi yyy quality"; "Reduce to 150 dpi average quality - STANDARD COMPRESSION" is a good trade-off between quality and file size
    Here is how it works:
    These are Quartz filters made with Apple Colorsinc Utility.
    They do two things:
    downsample images contained in a PDF to a target density such as 150 dpi,
    enable JPEG compression for those images with a low or medium setting.
    Which files does it work with?
    It works with most PDF files. However:
    It will generally work very well on unoptimized files such as scans made with the OS X scanning utility or PDFs produced via OS X printing dialog.
    It will not further compress well-optimized (comrpessed) files and might create bigger files than the originals,
    For some files it will create larger files than the originals. This can happen in particular when a PDF file contains other optomizations than image compression. There also seems to be a bug (reported to Apple) where in certain circumstances images in the target PDF are not JPEG compressed.
    What to do if it does not work for a file (target PDF is too big or even larger than the original PDF)?
    First,a good news: since you used a Save As or Export command, the original PDF is untouched.
    You can try another filter for a smaller size at the expense of quality.
    The year being 2013, it is now quite easy to send large files through the internet using Dropbox, yousendit.com, wetransfer.com etc. and you can use these services to send your original PDF file.
    There are other ways of reducing the size of a PDF file, such as apps in the Mac App store, or online services such as the free and simple http://smallpdf.com
    What else?
    Feel free to use/distribute/package in any way you like.

    Thanks ioscar.
    The original link should be back online soon.
    I believe this is a Dropbox error about the traffic generated by my Dropbox shared links.
    I use Dropbox mainly for my business and I am pretty upset by this situation.
    Since the filters themsemves are about 5KB, I doubt they are the cause for this Dropbox misbehavior!
    Anyway, I submitted a support ticket to Dropbox, and hope everything will be back to normal very soon.
    In the meantime, if you get the same error as ioscar when trying to download them, you can use the link in the blog posting he mentions.
    This is out of topic, but for those interested, here is my understanding of what happened with Dropbox.
    I did a few tests yesterday with large (up to 4GB) files and Dropbox shared links, trying to find the best way to send a 3 hour recording from French TV - French version of The Voice- to a friend's 5 year old son currently on vacation in Florida, and without access to French live or catch up TV services. One nice thing I found is that you can directly send the Dropbox download URL (the one from the Download button on the shared link page) to an AppleTV using AirFlick and it works well even for files with a large bitrate (except of course for the Dropbox maximum bandwidth per day limit!). Sadly, my Dropbox shared links were disabled before I could send anything to my friend.
    I may have used  a significant amount of bandwidth but nowhere near the 200GB/day limit of my Dropbox Pro account.
    I see 2 possible reasons to Dropbox freaking out:
    - My Dropbox Pro account is wronngly identified as a free account by Dropbox. Free Dropbox accounts have a 20GB/day limit, and it is possible that I reached this limit with my testing, I have a fast 200Mb/s internet access.
    - Or Dropbox miscalculates used bandwidth, counting the total size of the file for every download begun, and I started a lot of downloads, and skipped to the end of the video a lot of times on my Apple TV.

  • Amount of temporary tablespace size used for index rebuild

    Hi All,
    I want to know approximate amount of temporary tablespace size used for index rebuild. I need this information to avoid the insufficient temporary tablespace error during the huge index rebuild.
    Is there a query or procedure to find it out.
    Thank you.

    Hi,
    While creating the index, the temporary segment is created in the permanent tablespace. So permanent tablespace must have sufficient space.
    http://www.oracle-base.com/articles/10g/SpaceObjectTransactionManagement10g.php
    http://aprakash.wordpress.com/2010/01/05/numeric-segment-name/
    Anand

  • How can I reduce the file size of a pdf when exporting?

    I don't want to just choose between high quality print or smallest file size.
    I want to export it from 60MB to 40MB.
    Can I do this manually? When I use smallest file size the quality is too low and the content looks bad.
    But high quality print exports my PDF at 60MB which is too big.

    You cannot simply legislate the size of a PDF file. If you content is primarily text and vector, there is not much at all you can do to reduce PDF file size other than to cut out content. Otherwise, the only other variables are those of downsampling and compressing the raster images from your content.
    You must be very careful in choosing the PDF export settings. The “smallest size” settings yield PDF files that realistically really are not fit for printing and may mess up any CMYK colors. The “high quality print” and “PDF/X-4” settings yield best print output, but yield the largest PDF files since they do less image resolution downsampling and only the maximum quality lossy JPEG compression.
    I would recommend that you start with either the “high quality print” or the “PDF/X-4” settings and make a custom set of export settings. Assuming that you aren't going for offset or gravure printing, change the color image and grayscale image downsampling values from 300 and 450 to either 200 and 275 or no less than 150 and 225. If that doesn't give enough file size reduction, change the compression image quality from “Maximum” to either “High” or no less than “Medium.” Beyond these changes, you may end up with PDF files that will neither print nor display with any reasonable quality.
            - Dov

  • How can I reduce the file size of 3 videos?...

    ...without losing quality? These three videos are as follows in terms of size and length of the video:
    1) 148MB 19minutes
    2) 357MB 18minutes
    3) 164MB 14minutes
    I tried using a video converter to reduce the bit rate in order to reduce the size, which i know affects the quality, but that did not actually work to reduce the file size this time.
    I thought perhaps i should ask my forum friends for help on this matter. How,if at all, can I get all three of these MOV's under 100mb or to a total of 300mb for all 3 and preserve quality? It has to be able to play on an ipad (MOV or MP4). Thanks for your help!

    I think that the point that David was trying to make is that reducing the amount of information originally provided by a product or part of it in order to make it smaller will inevitably reduce the efficiency of the product itself.
    However, you don't have access to the original masters? Then you might be after a good compromise, meaning a video that can display decent quality while playing at its original frame size (say on the web).
    Does this mean that there is no real way to reduce the size without losing quality?
    If your target is the web there is a way to reduce the file size and still make it look decent enough. Re-compression means loss of source information but video compression is an art on its own and can produce some amazing results!
    Not without testing though.
    Now back to my previous post, use Compressor to try to reduce the file size and compare the result quality. Trust your eyes and be honest with yourself.

  • How can I reduce the file size when PDF Optimizer does not do much?

    I have a PDF form that exists of 48 pages. 44 pages are forms / have form fields, the other 4 are just informative. Each form-page has approx. 80 fields (checkboxes, text fields).
    When I started setting up the PDF form the file size was 12 MB and I had placed fields on 21 pages. Then with 34 pages the file size was 19 MB. And with 40 pages it was 35 MB big! Finally with 44 pages the file size is 34 MB.
    So I searched with Google and found some tips. Using the "PDF Optimizer" option inside Acrobat for example. So I did, and the file was reduced only with 3 MB... 31 MB was the file. Also used the option "Save as.... Optimized".... no difference. I also found a suggestion about removing embedded fonts. Using the "Audit Space Usage" option I noticed the fonts taking many MegaBytes:
    * Content Streams: 5.287.000     15,09 %
    * Fonts:                24.556.810     70,08 %  !!
    * Acrobat forms:      3.349.164    12,05 %
    In the older PDF version (I saved and kept this one too) with just 21 pages with form-fields, the  "Audit Space Usage" shows:
    * Content Streams: 5.292.000     40,14 %
    * Fonts:                 1.290.224     9,79 %
    * Acrobat forms:      1.588.758    12,05 %
    So I could save many many MegaBytes by -UnEmbedding- fonts. But if I do this (unembed ALL fonts), the file size stays almost the same!?!?!? Why? What can I do to reduce the file size? I would like it to be 8 MB if possible (32 MB -  24 MB = 8 MB)?
    Thank you for your help!

    If you have authored the form, reduce the number of different fonts for the content and form fields.
    Any font used in a form field will cause that font to be embedded into the PDF.
    If you are going to Optimize the PDF be very careful with forms. Optimization does a lot of removal of items and rearranging of items which can really mess up forms.

Maybe you are looking for

  • TaxCut 2007 crashes on launch on iMac G5-Please help

    I'm posting this plea for help in both the iMac and Panther forums. On my iMac G5, running OS 10.3.9, I have an app, TaxCut 2007, which always crashes on launch. As soon as I click the second of the two "I Accept" buttons, the iMac gives me the "unex

  • SET_TABLE_FOR_DISPLAY - Edited value from dynamic internal table need to be captured

    Hi all, I have created  2 tabstrip screns which contain ALV GRID DISPLAY  in a container with dynamic internal table and editable columns .I want to capture the edited value from this ALV GRID display.I have used SET_TABLE_FOR_DISPLAY  and for this d

  • How to use custom password encryptor/decryptor class for jdbc connection

    I am in process of migrating application from Jrun server to weblogic . In jrun we use to provide our custom class which used to decrypt the password provided in resource file as below <username>webclt</username> <password>AAAAAAASSSSSSSCCCCCCCCCCCCC

  • My iphone 4 camera cant focus properly ! Please help !

    Hello friends, I am facing a serious problem in my iphone 4. And its really frustrating. I am trying to take some Good images but i have noticed that my phone camera is not able to take image properly. When i am trying to take close shots. camera is

  • Can i use 4gb of ram after 10.6 upgrade on MA589LL?

    Hello, I am new to Mac. I have a late 2006 iMac (MA589LL) that I have upgraded to 3GB of RAM. It has 10.4.11 on it but i have 10.6 in the mail. The specs say that it is limited to 3GB of Ram but it also says that the hardware will support 2 x 2GB sti