<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic oracle tablespace in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tablespace/m-p/2779059#M832392</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;We have a tablespace with 10GB size, We want to&lt;BR /&gt;delete old records out of it and free the space. &lt;BR /&gt;&lt;BR /&gt;After deleting the records , will the TABLESPACE  and TABLE size reduce immediately or we have to follow any procedure to get the&lt;BR /&gt;free space ?.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;U.SivaKumar&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Sat, 03 Aug 2002 03:38:46 GMT</pubDate>
    <dc:creator>U.SivaKumar_2</dc:creator>
    <dc:date>2002-08-03T03:38:46Z</dc:date>
    <item>
      <title>oracle tablespace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tablespace/m-p/2779059#M832392</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;We have a tablespace with 10GB size, We want to&lt;BR /&gt;delete old records out of it and free the space. &lt;BR /&gt;&lt;BR /&gt;After deleting the records , will the TABLESPACE  and TABLE size reduce immediately or we have to follow any procedure to get the&lt;BR /&gt;free space ?.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;U.SivaKumar&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 03 Aug 2002 03:38:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tablespace/m-p/2779059#M832392</guid>
      <dc:creator>U.SivaKumar_2</dc:creator>
      <dc:date>2002-08-03T03:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: oracle tablespace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tablespace/m-p/2779060#M832393</link>
      <description>Hi,&lt;BR /&gt;-- I used to be a DBA, so I'm sure of the concepts, but please CHECK all this information (it has been a while, you know :-).&lt;BR /&gt;&lt;BR /&gt;1. The trick is in reducing the size of the datafile (OS-system file) that contains the tablespace. You can do this with a ALTER DATABASE-command (example from the manual) :&lt;BR /&gt;ALTER DATABASE&lt;BR /&gt;DATAFILE '/u02/oracle/rbdb1/stuff01.dbf'&lt;BR /&gt;RESIZE 100M;&lt;BR /&gt;&lt;BR /&gt;2. However, the space in the tablespace is NOT automatically freed up. The above command may not work because the rows of your tables may be spread over all of the 10Gb (even though you only use 100Mb in total). You'll definitely have to take a look at the fragmentation in your tablespace. The procedure that is definitely going to work is :&lt;BR /&gt;- export the data&lt;BR /&gt;- drop the tables/indexes (and maybe even the tablespace itself).&lt;BR /&gt;- resize the datafile&lt;BR /&gt;- recreate the tablespace with smaller storageparameters&lt;BR /&gt;- recreate the tables/indexes with smaller storageparameters&lt;BR /&gt;- import the data&lt;BR /&gt;&lt;BR /&gt;Note that this would be the procedure for a Oracle 8.0.x database. It is possible that better procedures exist for 8.1.x databases.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Tom</description>
      <pubDate>Sat, 03 Aug 2002 07:45:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tablespace/m-p/2779060#M832393</guid>
      <dc:creator>Tom Geudens</dc:creator>
      <dc:date>2002-08-03T07:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: oracle tablespace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tablespace/m-p/2779061#M832394</link>
      <description>To give you additional information of database reorg (The action of exp/imp or moving database objects around in order to reduce fragmentation or space reclaim) in Oracle8i (8.1.x) and newer databases, you can:&lt;BR /&gt;&lt;BR /&gt;1. Create a new tablespace reorg (or whatever name you like) that can house all the objects in your existing 10Gb tablespace.&lt;BR /&gt;&lt;BR /&gt;2. Run the following sql script to generate the commands to move all the tables from the existing tablespace to the new tablespace:&lt;BR /&gt;&lt;BR /&gt;~~~ START ~~~&lt;BR /&gt;&lt;BR /&gt;connect system/&lt;PASSWORD&gt;&lt;BR /&gt;&lt;BR /&gt;set heading off&lt;BR /&gt;set linesize 256&lt;BR /&gt;set pagesize 0&lt;BR /&gt;&lt;BR /&gt;spool /tmp/reorg_table1.sql&lt;BR /&gt;&lt;BR /&gt;SELECT 'ALTER TABLE ' || owner || '.' || table_name || ' MOVE TABLESPACE REORG;'&lt;BR /&gt;FROM dba_tables&lt;BR /&gt;WHERE tablespace_name = 'DAT';&lt;BR /&gt;(change DAT to your existing 10Gb tablespace name)&lt;BR /&gt;&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;spool /tmp/reorg_index1.sql&lt;BR /&gt;&lt;BR /&gt;SELECT 'ALTER INDEX ' || owner || '.' || index_name || ' REBUILD TABLESPACE REORG;'&lt;BR /&gt;FROM dba_indexes&lt;BR /&gt;WHERE tablespace_name = 'DAT';&lt;BR /&gt;(change DAT to your existing 10Gb tablespace name)&lt;BR /&gt;&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;~~~  END  ~~~&lt;BR /&gt;&lt;BR /&gt;3.  You will get two spool files that contains sql commands to move all the tables and indexes away from your 10Gb tablespace, run the two files one by one starting from the tables first, followed by the indexes):&lt;BR /&gt;&lt;BR /&gt;@/tmp/reorg_table1.sql&lt;BR /&gt;@/tmp/reorg_index1.sql&lt;BR /&gt;&lt;BR /&gt;4.  After that confirm your 10Gb tablespace do not contains any objects:&lt;BR /&gt;&lt;BR /&gt;SELECT object_name&lt;BR /&gt;FROM dba_objects&lt;BR /&gt;WHERE tablespace_name = 'DAT';&lt;BR /&gt;&lt;BR /&gt;it should return no rows.&lt;BR /&gt;&lt;BR /&gt;5.  Resize the datafile as according to the last reply provided by Tom.  Make sure that the new size is big enough for all the objects to move back.&lt;BR /&gt;&lt;BR /&gt;6. Run the following sql script to generate the commands to move all the tables from the new tablespace back to the resized tablespace:&lt;BR /&gt;&lt;BR /&gt;~~~ START ~~~&lt;BR /&gt;&lt;BR /&gt;connect system/&lt;PASSWORD&gt;&lt;BR /&gt;&lt;BR /&gt;set heading off&lt;BR /&gt;set linesize 256&lt;BR /&gt;set pagesize 0&lt;BR /&gt;&lt;BR /&gt;spool /tmp/reorg_table2.sql&lt;BR /&gt;&lt;BR /&gt;SELECT 'ALTER TABLE ' || owner || '.' || table_name || ' MOVE TABLESPACE DAT;'&lt;BR /&gt;FROM dba_tables&lt;BR /&gt;WHERE tablespace_name = 'REORG';&lt;BR /&gt;(change DAT to your resized tablespace name)&lt;BR /&gt;&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;spool /tmp/reorg_index2.sql&lt;BR /&gt;&lt;BR /&gt;SELECT 'ALTER INDEX ' || owner || '.' || index_name || ' REBUILD TABLESPACE DAT;'&lt;BR /&gt;FROM dba_indexes&lt;BR /&gt;WHERE tablespace_name = REORG';&lt;BR /&gt;(change DAT to your existing 10Gb tablespace name)&lt;BR /&gt;&lt;BR /&gt;spool off&lt;BR /&gt;&lt;BR /&gt;~~~  END  ~~~&lt;BR /&gt;&lt;BR /&gt;7.  You will get two spool files that contains sql commands to move all the tables and indexes back to your resized tablespace, run the two files one by one starting from the tables first, followed by the indexes):&lt;BR /&gt;&lt;BR /&gt;@/tmp/reorg_table2.sql&lt;BR /&gt;@/tmp/reorg_index2.sql&lt;BR /&gt;&lt;BR /&gt;8.  After that confirm your REORG tablespace do not contains any objects:&lt;BR /&gt;&lt;BR /&gt;SELECT object_name&lt;BR /&gt;FROM dba_objects&lt;BR /&gt;WHERE tablespace_name = 'REORG';&lt;BR /&gt;&lt;BR /&gt;it should return no rows.&lt;BR /&gt;&lt;BR /&gt;9.  You can now drop the tablespace REORG:&lt;BR /&gt;&lt;BR /&gt;DROP tablespace REORG;&lt;BR /&gt;&lt;BR /&gt;This is a safe and time saving method for database reorg introduced in Oracle8i, since the objects are never removed from the database and risk of losing data is lower comparing with exp/imp.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Kenneth&lt;/PASSWORD&gt;&lt;/PASSWORD&gt;</description>
      <pubDate>Sat, 03 Aug 2002 11:08:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tablespace/m-p/2779061#M832394</guid>
      <dc:creator>Kenneth_19</dc:creator>
      <dc:date>2002-08-03T11:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: oracle tablespace</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tablespace/m-p/2779062#M832395</link>
      <description>A TABLESPACE is a logical construct and not a physical one.  Datafiles contain the data for tables and indexes. If the tables/indexes in the datafiles in question are dropped, the space is recovered to the datafile. The datafile can the be reduced in size with "alter database datafile '/u01.../data01.dbf' resize 10M  etc. If you are only deleting rows, (you are better off using truncate) the space is not recovered and you would use export etc as others have replied in this post, move the stuff to other datafiles (in other tablespaces) then drop the stuff in the current datafiles.  Oracle's Enterprise Manager has a tablespace manager that allows you to see what extents are in which datafiles, organized by tablespace.</description>
      <pubDate>Mon, 05 Aug 2002 13:16:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/oracle-tablespace/m-p/2779062#M832395</guid>
      <dc:creator>Dave Chamberlin</dc:creator>
      <dc:date>2002-08-05T13:16:35Z</dc:date>
    </item>
  </channel>
</rss>

