Sponsored Content
Full Discussion: Purge in oracle9i
Homework and Emergencies Emergency UNIX and Linux Support Purge in oracle9i Post 302706615 by radoulov on Thursday 27th of September 2012 04:33:29 AM
Old 09-27-2012
You don't have a recycle bin in Oracle < 10g and, in any case, you don't need to purge it manually (it gets purged automatically when space pressure occurs).

In order to reclaim the free space in the tablespace, in Oracle 9i, you need to recreate (move) the table (and rebuild its relative indexes) subject to mass deletions.

Code:
alter table <table_name> move;
alter index index1 rebuild;
alter index index2 rebuild;
...

You need to take special care if you need to do this in production, because (this is not a complete list):

1. During the move the table will be locked in exclusive mode.
2. Right after the move the indexes on the table will be marked unusable and statements that try to use those indexes will fail (you'll need a maintenance window).
3. Before you begin you'll need to check the definitions of the involved objects - for example if you have compressed indexes you may end up with no compression after the rebuild (i.e. you'll need to include compress in the alter statement too).
4. You could speed up the operations by using parallel degree greater than 1 (only EE), just remember to reset the degree back to their original values.
5. You could rebuild the indexes online (EE only), but you could move the table online only if it's an IOT (Index Organized Table).
6. Remember to re-gather statistics after the move/rebuild operations.

That said, you can, of course, ad some space to the tablespace.

Hope this helps.

Last edited by radoulov; 09-27-2012 at 07:36 AM..
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

purge xterm

Being new I had my focus in the wrong place and typed in xterm instead of <If you can't guess, good>. Can I purge xterm so that this word no longer appears using up or down arrows? (1 Reply)
Discussion started by: noobie_doo
1 Replies

2. AIX

install oracle9i on aix5.3

I am installing oracle9i on aix5.3 and an link error appears during the install process. 'Error in invoking target iokdstry of makefile /export/home/oracle/OraHome/network/lib/ins_nau.mk' happened I tried to find the way out,and there seems to be one... (2 Replies)
Discussion started by: mayuhao
2 Replies

3. Shell Programming and Scripting

script for purge

Hi , I want to purge 7 days older data from a list of data sorted on date in a log file... Can anyone provide me with the shell script for the same.. Thanks, Jaz (1 Reply)
Discussion started by: JP003
1 Replies

4. Red Hat

find help with directory purge.

Hi, I have a purge directory called /b02/purge which has backed up directories like this drwxrwxr-x 17 root root 4096 Jan 5 15:33 purge1 drwxrwxr-x 17 root root 4096 Jan 5 16:21 purge.new1 drwxrwxr-x 15 root root 4096 Jan 5 16:21 purge.new2 drwxrwxr-x 17 root root 4096 Jan 12... (3 Replies)
Discussion started by: uxadmin007
3 Replies

5. Shell Programming and Scripting

purge logs, keep the 30 lasts

Hi, I have to make a script to purge logs in a directory (this script will run automatically every day) and this script has to keep just the 30 last files. So I want it to count all the files in the directory, find the 30 most recents and delete the others. I just started shell scripting and... (4 Replies)
Discussion started by: jblecrou
4 Replies

6. UNIX for Advanced & Expert Users

Purge MAil file

Hi, merry christmas. on AIX 6.1, the file /var/spool/mail/user, should/can be purged manually ? Any commande line to purge it ? Thanks. (2 Replies)
Discussion started by: big123456
2 Replies

7. Shell Programming and Scripting

Menu for Purge

I have these commands that help me find and delete files over certain days. How can I build a menu to list the files, and then hit y for yes to delete or no? find /logs/212/abinitio/prod/mfs/partitions/part0/mfs_12way_001/mfs_12way/sncrpt/main/ -name "*dat" -mtime +1 -exec ls -ltr {} \; find... (3 Replies)
Discussion started by: xgringo
3 Replies

8. UNIX for Dummies Questions & Answers

Apt-get install --purge

Hello, i would like to know what is the use of that command apt-get install --purgeI understand the use of --purge while using with remove parameter, but i don't get it when it's about installing. Enlight me please ! Thx ---------- Post updated 09-03-16 at 11:35 AM ---------- Previous... (0 Replies)
Discussion started by: Purgator
0 Replies
ALTER 
INDEX(7) SQL Commands ALTER INDEX(7) NAME
ALTER INDEX - change the definition of an index SYNOPSIS
ALTER INDEX name RENAME TO new_name ALTER INDEX name SET TABLESPACE tablespace_name ALTER INDEX name SET ( storage_parameter = value [, ... ] ) ALTER INDEX name RESET ( storage_parameter [, ... ] ) DESCRIPTION
ALTER INDEX changes the definition of an existing index. There are several subforms: RENAME The RENAME form changes the name of the index. There is no effect on the stored data. SET TABLESPACE This form changes the index's tablespace to the specified tablespace and moves the data file(s) associated with the index to the new tablespace. See also CREATE TABLESPACE [create_tablespace(7)]. SET ( storage_parameter = value [, ... ] ) This form changes one or more index-method-specific storage parameters for the index. See CREATE INDEX [create_index(7)] for details on the available parameters. Note that the index contents will not be modified immediately by this command; depending on the parame- ter you might need to rebuild the index with REINDEX [reindex(7)] to get the desired effects. RESET ( storage_parameter [, ... ] ) This form resets one or more index-method-specific storage parameters to their defaults. As with SET, a REINDEX might be needed to update the index entirely. PARAMETERS
name The name (possibly schema-qualified) of an existing index to alter. new_name The new name for the index. tablespace_name The tablespace to which the index will be moved. storage_parameter The name of an index-method-specific storage parameter. value The new value for an index-method-specific storage parameter. This might be a number or a word depending on the parameter. NOTES
These operations are also possible using ALTER TABLE [alter_table(7)]. ALTER INDEX is in fact just an alias for the forms of ALTER TABLE that apply to indexes. There was formerly an ALTER INDEX OWNER variant, but this is now ignored (with a warning). An index cannot have an owner different from its table's owner. Changing the table's owner automatically changes the index as well. Changing any part of a system catalog index is not permitted. EXAMPLES
To rename an existing index: ALTER INDEX distributors RENAME TO suppliers; To move an index to a different tablespace: ALTER INDEX distributors SET TABLESPACE fasttablespace; To change an index's fill factor (assuming that the index method supports it): ALTER INDEX distributors SET (fillfactor = 75); REINDEX INDEX distributors; COMPATIBILITY
ALTER INDEX is a PostgreSQL extension. SEE ALSO
CREATE INDEX [create_index(7)], REINDEX [reindex(7)] SQL - Language Statements 2010-05-14 ALTER INDEX(7)
All times are GMT -4. The time now is 01:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy