Anyway to shrink tablespace online?

I have a 500GB tablespace with 10 files, that was full, after deleting, purge, it is half free now, I want to reduce datafile size, but I can not do "alter database datafile resize...." as some object in the end of the file.
anyway to shrink tablespace/datafiles online?
Thanks!!

Oh, sorry I thought they pointed you in the right direction.
What about using the SHRINK SPACE command? Take a look at it here...
http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/schema003.htm#ADMIN10161
It seems to do what you want.
You use online segment shrink to reclaim fragmented free space below the high water mark in an Oracle Database segment. The benefits of segment shrink are these:
Compaction of data leads to better cache utilization, which in turn leads to better online transaction processing (OLTP) performance.
The compacted data requires fewer blocks to be scanned in full table scans, which in turns leads to better decision support system (DSS) performance.
Segment shrink is an online, in-place operation. DML operations and queries can be issued during the data movement phase of segment shrink. Concurrent DML operation are blocked for a short time at the end of the shrink operation, when the space is deallocated. Indexes are maintained during the shrink operation and remain usable after the operation is complete. Segment shrink does not require extra disk space to be allocated.
Segment shrink reclaims unused space both above and below the high water mark. In contrast, space deallocation reclaims unused space only above the high water mark. In shrink operations, by default, the database compacts the segment, adjusts the high water mark, and releases the reclaimed space.
Segment shrink requires that rows be moved to new locations. Therefore, you must first enable row movement in the object you want to shrink and disable any rowid-based triggers defined on the object. You enable row movement in a table with the ALTER TABLE ... ENABLE ROW MOVEMENT command.

Similar Messages

  • Making the tablespace online

    Hi ,
    I am trying to make the tablespace online.
    But facing the below issues .Need your help.
    SQL> alter tablespace XXXXXX online;
    alter tablespace XXXXX online
    ERROR at line 1:
    ORA-01115: IO error reading block from file 15 (block # 1)
    ORA-01110: data file 15: '/xxxxxx.dbf'
    ORA-27091: skgfqio: unable to queue I/O
    ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
    Additional information: 1
    Additional information: 1
    SQL> alter tablespace XXXXXX read write;
    alter tablespace XXXXXXX read write
    ERROR at line 1:
    ORA-01646: tablespace XXXXXX is not read only - cannot make read write
    Os Solaris : 5.8
    Database ;Oracle 9.2.0.4.0
    Thanks
    USR0072

    USR0072 wrote:
    Hi ,
    I am trying to make the tablespace online.
    But facing the below issues .Need your help.
    SQL> alter tablespace XXXXXX online;
    alter tablespace XXXXX online
    ERROR at line 1:
    ORA-01115: IO error reading block from file 15 (block # 1)
    ORA-01110: data file 15: '/xxxxxx.dbf'
    ORA-27091: skgfqio: unable to queue I/O
    ORA-27069: skgfdisp: attempt to do I/O beyond the range of the file
    Additional information: 1
    Additional information: 1
    SQL> alter tablespace XXXXXX read write;
    alter tablespace XXXXXXX read write
    ERROR at line 1:
    ORA-01646: tablespace XXXXXX is not read only - cannot make read write
    Os Solaris : 5.8
    Database ;Oracle 9.2.0.4.0
    Thanks
    USR0072fix the Operating System error.
    Oracle is the victim; not the culprit

  • Is there anyway go get iPod online its been stolen and I can't track it because its offline

    Is ther anyway too get iPod online to track it its been stolen and is offline can't track

    Just like Kappy said, no. The thief must not have restored the iPod and used WiFi.

  • Shrink tablespace

    Hi,
    I have two tablespace with 30gb size.I have move all database objects from these tablespaces into newly created tablespace with same structure using MOVE TABLESAPCE commands. after that, i have dropped the old tablespaces.
    I have checked the newly tablespace size. the size of the one tablespace is shrinked but other tablespace shows the same size. the same size is same as old tablespace size.i have executed the shrink tablespace using shrink command. The size of the tablespace is reduced.
    Is shrink commands is needed after move tablespace into other tablespace?
    Please give an commands?

    Hi,
    Basically , what happened is the new tablespace created is having free buffers (I mean with out any contention).
    When table objects are moved from old tablespace to new tablespace, the rows are allocated as per there size in one continous extents. Due to that space with in the new tablespace allocated is perfect with out any space contentions. So when you performed shrink the space is reduced.
    But intiallly as per your configuration of old tablespace it was shown.
    - Pavan Kumar N

  • My iphone is missing (lost) and dead and it cannot be located because it is offline.  Is there anyway to get it online remotely?

    My iphone is missing (lost) and dead (no battery life and needs to be rechaged)  We are in the process of moving but I am terrified and canot locate through icloud as it is saying it is offline.
    Is there any way at all that i can access it remotely and change the offline to "online" only for a few seconds even so that it can become online again, long enough to play the music that i can find it.
    Thank you for your time and consideration in answering my question

    Tricia453 - I can understand you really want to find your lost iPhone.  But, this is your third post today asking the exact same question.  I'm sorry, but the answer is not going to change no matter how many times you re-post it.
    Without the phone being powered on, and connected to a wifi or a cellular data connection there is no way to track it remotely or do anything at all remotely to it.  Remote commands and remote tracking require a data connection, which requires your phone be powered on.  There is nothing you can do to find it remotely, nothing at all.

  • We cannot find our Ipod touch because it says under Find My Phone that it is offline   Anyway to get it online if we do not have it?

    My son lost his Ipod Touch.
    We went on the cloud for location, and it says that the  Ipod Touch is Offline and therefore cannot use location services.
    Can you remotely turn it online? 
    Or is there anything we can do?
    Thank You

    No. If the iPod has been restored (which erases the iPod) it will show off-line for ever. If the battery is dead or the iPod turned off it will also show off-line.

  • 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

  • Is there anyway to use your best buy credit card online before receiving it?

    I know if you haven't received the card yet in the mail you can still use it in store by giving an employee your information. But is there anyway to use it online to make a purchase?

    Good morning Seniorfarts, 
    It's great to hear that you are either considering or have already applied and been approved for a My Best Buy credit card! It is my understanding that you would have one opportunity immediately after being approved for the credit card online to use it. Outside of this browser session, I believe you would need to wait for the arrival of the physical card. Sadly, this means if you apply and are approved in store, you would not be able to use the card online until you receive it. 
    I hope this helps! Please let us know if you should have any other questions. 
    Sincerely, 
    Tasha|Social Media Specialist | Best Buy® Corporate
     Private Message

  • TABLESPACE cleanup not happening after table data delete

    Hi all
    I have a partitioned table with 4 partitions all residing in a single tablespace. I populated the table with sample data and then deleted all with a simple delete statement followed by a commit. But the tablespace is still showing data from the 4 partitions under the bytes column in query below:
    select segment_name, partition_name, tablespace_name, bytes
    from dba_segments
    where tablespace_name='tb_name'
    Am I missing something here? Do I need to run some other command after delete and commit to fully flush out the data?
    FYI, my system specs are:
    Windows 2008 Server Standard (32-bit)
    ORACLE 11.1.0.7.0

    HI,
    LMT is Locally Managed Tablespace.
    +Moreover, when you say the blocks will not be available immediately when do you reckon they will be available? How do I go about automating this to free up space as soon as data is deleted?+
    You cannot automate this job, this is already automated by Oracle.
    +FYI, both pct_free and pct_used come up as empty values for my table.+
    reason for a NULL-value for PCT_USED is that the tablespace where the table resides uses automatic segments space management (ASSM). With ASSM there is no need for PCT_USED only for PCT_FREE. Oracle manages blocks automatically.
    You dont worry about releasing the space, Oracle will take care of it automatically.
    Go through the below link
    [http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/tspaces.htm#ADMIN10065]
    [http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/schema.htm#sthref2100]
    [http://www.dba-oracle.com/art_builder_assm.htm]
    This is an extract form Oracle docs
    Understanding Reclaimable Unused Space
    Over time, updates and deletes on objects within a tablespace can create pockets of empty space that individually are not large enough to be reused for new data. This type of empty space is referred to as fragmented free space.
    Objects with fragmented free space can result in much wasted space, and can impact database performance. The preferred way to defragment and reclaim this space is to perform an online segment shrink. This process consolidates fragmented free space below the high water mark and compacts the segment. After compaction, the high water mark is moved, resulting in new free space above the high water mark. That space above the high water mark is then deallocated. The segment remains available for queries and DML during most of the operation, and no extra disk space need be allocated.
    You use the Segment Advisor to identify segments that would benefit from online segment shrink. Only segments in locally managed tablespaces with automatic segment space management (ASSM) are eligible. Other restrictions on segment type exist. For more information, see "Shrinking Database Segments Online".
    If a table with reclaimable space is not eligible for online segment shrink, or if you want to make changes to logical or physical attributes of the table while reclaiming space, you can use online table redefinition as an alternative to segment shrink. Online redefinition is also referred to as reorganization. Unlike online segment shrink, it requires extra disk space to be allocated. See "Redefining Tables Online" for more information.Regards,
    Vijayaraghavan K

  • Tablespace and performance issue

    Hi,
    I have Tablespace X and tablespace Y.
    I have seven transaction tables in X, which has image tables in Y. X tablespace is my Online tablespace and Y my archive tablespace and I use the archive tablespace to store old data.
    I use the same algorithm, only wrapped up in two processes, with only the source and destination alternating. The code performs extremely well for moving data X->Y. And ridiculously slow for Y-> X.
    I have just started doing this process of archiving, so the data volume in both the sets of tables are the almost the same.
    Any clue on what I could check up for here ?? What should be the problem ??
    The trace file shows the similar plans both sides, only there are wait times in process Y->X.
    Thanks for your time on this.
    Ashok.

    ahhh ... you are talking now about "internal" (vs. "external"?) volume instances. This implies probably you have really to talk to the responsible dba, as Justin already proposed.
    One small correction, you always can do an "insert /*+ append */ ...". As Oracle will write into new datablocks then, you only would loose the last allocated free blocks. But in the case of the offline tables, this is not a problem as you only add data anyway therefore you'll not loose a lot. And disk space is not really a concern anymore these days.
    For the other way around, you only had to do an "alter table X move tablespace <online-tbs>" afterwards to clean up all the unused blocks.
    For the truncating, may be you can think about it again. You have a processing going on there ie there is some grouping/selecting criteria. Probably one of these criterias is a partitioning candidate? And with a partitioned table you would be back in the truncating game.
    For the "I'm not let to DDL on the objects from inside the code" seems a rather funny restriction, as this doesn't let you do a truncate and instead you need a lot of (probably unnecessary) undo-tablespace for a delete. But as some dba's don't really know, what the job of a good developer is, you can probably ask your dba for a packaged procedure, where this table/partition gets truncated.

  • How to move Tablespace from One disk group to another disk group in RAC

    Hi All,
    I have 11gR2 RAC env on Linux.
    As ofnow I have problem with disk group. I have 3 disk group which is almost full - 98%. I have added one NEW disk group and want to move some of the Tablespace(TBS) from OLD disk group to NEW diskgroup and make some free space in OLD disk group.
    Can any one suggest me how to move TBS from one disk group to another disk grup without shutting down the instance.
    DB is in Noarchive mode.
    Thanks...

    user12039625 wrote:
    Hi Helios,
    Thanks for doc id but I am looking for noarchive mode solution. becaues I got ORA-
    "ORA-01145: offline immediate disallowed unless media recovery enabled " when run alter database datafile '...' offline.
    Hence I am trying something and findout below steps but not sure how useful it is:
    1- put tablespace offine
    2- Copy the file to new diskgroup using Either RMAN or DBMS_FILE_TRANSFER.
    3- Rename the file to point to new location.
    4- Recover the file.
    5- Bring the file online.
    I had move 240M TBS from OLE to NEW.
    These steps run successfully so I think this is valid for noarchive mode.Hence want to confirm..so inform me please.
    Thanks :)I have doubt in my mind:
    1. You database is in noarchivelog mode
    2. You're taking tablespace offline
    3. Suppose you're moving a file of size 10GB(or any larger filesize) to another disk group
    4. Now after moving the file, you're trying to bring the tablespace online............NOW
    tablespace will need recovery. if the required data is inside the SGA then it is ok. But if the data has been flushed, then?
    if step 2 and 3 has taken significant time, then most probably you'll not be able to bring that tablespace online.
    Regards,
    S.K.

  • Backup/restore tablespaces in noarchivelog mode

    In our office there is a oracle 10g box that's used for testing purposes.
    It's only got 1 database, but each user has their own tablespace.
    As it's not a 'live' box, archivelog and flashrecovery have been disabled by the dba probably in favour of speed.
    I have a NUnit test suit that runs across a tablespace, and I am trying to restore the tablespace before each run.
    In noarchivelog mode, RMAN allows me to take the tablespace offline, and create a backup - so far so good.
    Later on, I am able to take the tablespace offline again, and issue a "RESTORE TABLESPACE" command.
    But then I cannot bring the tablespace online without issuing a "RECOVER" command.
    I have tried the NOREDO option but it still says that the file needs a media recovery before it can be brought online.
    Is there a way to bring the tablespace online without applying the REDO logs ?
    Or is tablespace backup/restore not possible because of noarchivelog ?
    Thanks.

    I tried the TTS method, and it was only marginally quicker than a data_only impdp.
    I suspect this is due to the nature of a fresh nunit test database, where the metadata (huge tables structure, stored proc, etc) is often larger than the table contents itself.
    In the grand scheme of things it might even end up slower, as i need to drop the tablespace including contents if i want to use TTS to load up the backed up dbf.
    From the comments I'm guessing that there's no way of just updating the timestamp of the tablespace without applying the REDO logs then ?
    I've tested other methods as well.
    Flash recovery could only work on a table or db level, I can't take the db offline as there are other users on it with their own tablespace/schemas. (it was an old dev's box, we're reusing what we can)
    impdb with the truncate and data_only flag seems to be the only viable option so far, with TTS up for consideration.

  • Managing Undo tablespace & roll back segments

    Hi,
    I have oracle 9.1 version and have created 5g undo tablespace apart from 20m rbs tablespace for 15 rollback segments. But it is seen that whenever i give UNDO_MANAGEMENT=AUTO then rollback segments are created using undo tablespace and not allowing rollback segment in rbs tablespace ONLINE. In the reverse happens whenever I give UNDO_MANAGEMENT=MANUAL , the rollback segments in the rbs tablespace gets focus and roll back segments in the Undo tablespace goes offline. Is there anything that I can do so that both undo tablespace and redo segments in the rbs tablespace gets working together so as to minimize the undo contention. Moreover, any query given takes long time when select query given with || in the subquery.
    Please suggest the tuning need to do?

    brain_heart wrote:
    Hi,
    I have oracle 9.1 version and have created 5g undo tablespace apart from 20m rbs tablespace for 15 rollback segments. But it is seen that whenever i give UNDO_MANAGEMENT=AUTO then rollback segments are created using undo tablespace and not allowing rollback segment in rbs tablespace ONLINE. In the reverse happens whenever I give UNDO_MANAGEMENT=MANUAL , the rollback segments in the rbs tablespace gets focus and roll back segments in the Undo tablespace goes offline. Is there anything that I can do so that both undo tablespace and redo segments in the rbs tablespace gets working together so as to minimize the undo contention.No that's the way it would work, you can either use the automatic undo or the manual one.not both. And its better to stick with the automatic one IMHO. Have a read of this link to understand more about undo.
    http://download.oracle.com/docs/cd/B10501_01/server.920/a96521/undo.htm#8888
    HTH
    Aman....

  • What is the best way to copy Oracle Transportable Tablespace datafiles betw

    Hi All,
    We are planning to implement Oracle Transportable Tablespace feature to copy huge data (around 900 GB) between the DBs.
    Our plan is to:
    1. Offline the tablespace 1 and tablespace 2 on Linux BOX1.
    2. Take export of these two tablespaces using TTS on Linux BOX1.
    3. zip datafiles of tablespace1 & 2 on Linux BOX1.
    4. Copy the zipped datafiles and dump file to Linux BOX2.
    5. Unzip datafiles of tablespace1 & 2 on Linux BOX1.
    6. Make the tablespaces online on Linux BOX1.
    7. Unzip datafiles of tablespace1 & 2 on Linux BOX2.
    8. Import the dump file to DB on Linux BOX2.
    9. Online the tablespace1 & 2 on Linux BOX2.
    However I do have below queries before I proceed.
    1. Do you see any issue with the above approach?
    2. To improve the copying speed across the network, Do you suggest any solution than rcp and ftp
    Our Environment: Oracle 9.2.0.8 running on Linux 2.6.5-7.308-bigsmp #1 SMP
    Please share your experiences.
    Thanks in advance for your time and suggestions :)
    Krishna Bussu.

    Take a look at Note:77523.1.
    Hope this Helps
    Regards

  • How to shrink the size of JRE?

    Hi,
    I wrote a simple Java utlity that performs some business logic for my clients. It is going to run on Windows environments. I created a .exe for this Java application. Obviously It also needs JRE. I made sure that JRE is also shipped along with this application. But the size of JRE is around 70 MB. Is there anyway to shrink the size of JRE? What is best practice for such a thing?
    Thanks in advance,
    Mustafa

    I'm not sure what the licensing implications are of customizing your own derivative of Sun's JRE, presuming that's the one you're using. If the agreement permits, you could remove classes you know that you won't use from the runtime JAR.
    Your best bet, though, sounds like using a Java-to-native compiler. There are a number of applications out there that could produce a Windows executable from your Java code and, since you know it's only going to be run on Windows machines, you lose very little if anything by going through this process.
    Best of luck.

Maybe you are looking for

  • IMAP Default Folders are "Not Yet Available"

    Ok, I have exausted all of my troubleshooting abilities (I even turned it off and back on!)  I have three IMAP email accounts hosted on a server at Site5.  I can login, get mail, send mail, etc.  But the "Default Folders" are listed as "Not yet avail

  • Airport needs to be told what to do

    When I boot my G5 mac or my wife's ibook neither will automatically connect to the wireless network we always use (apple airport express network in our house). They have to be pointed to the network even though it is the only one listed in our prefer

  • Retrive data base details of all tables

    how can i retrive the table name, no of rows in that table, no of indexs in that table, no of not null col's in that table of in single data base(genuine query).

  • Serial Number for CS5.5 Production Premium that I received for Mac download not working for Windows

    My ProductionPremium CS5.5 serial number for my Mac is not working when I download and install ProductionPremium CS5.5 on my windows machine. Do I need to deinstall on my mac or get another serial number issued?

  • Reporting authorization issue

    Hi all, After transporting roles, users, authorizations, queries and workbooks from Dev into Prod we have an authorization problem. There is a message during the opening of workbook or a web-query that says: "Your user master record is not sufficient