Fragmentation in tablespace in oracle 9i

Hi All,
We have oracle 9.2.0.8 installed in solaris 9, database size is 1.5 TB, we are looking for the tablespaces which are suffering from the fragmentation.
We have locally manged tablesapaces in the database. so can you please tell me, is there any tablespace fragmentation in the locally managed tablespace in oracle 9i, and if it is there than how to relove the situation.?
thanks in advance

If you mean by fragmentation, a number of free space areas in the data files - sometimes called honeycombing, this script will show them to you.
SELECT  'free space'      owner,
        ' '               object,
        ' '               obj_type,
        f.file_name,
        s.file_id,
        s.block_id,
        s.blocks,
        s.bytes/1048576   mbytes
  FROM  dba_free_space s,
        dba_data_files f
WHERE  s.file_id = &file_id
   AND  s.file_id = f.file_id
UNION
SELECT  owner,
        segment_name,
        DECODE(segment_type, 'TABLE',          'T',
                             'INDEX',          'I',
                             'ROLLBACK',       'RB',
                             'CACHE',          'CH',
                             'CLUSTER',        'CL',
                             'LOBINDEX',       'LI',
                             'LOBSEGMENT',     'LS',
                             'TEMPORARY',      'TY',
                             'NESTED TABLE',   'NT',
                             'TYPE2 UNDO',     'U2',
                             'TABLE PARTITION','TP',
                             'INDEX PARTITION','IP', '?'),
        f.file_name,
        s.file_id,
        s.block_id,
        s.blocks,
        s.bytes/1048576
  FROM  dba_extents s,
        dba_data_files f
WHERE  s.file_id = &file_id
   AND  s.file_id = f.file_id
ORDER
    BY  file_id,
        block_id
However, when you look at the report you will see that in a locally managed tablespace, all of the free space 'chunks' are all 8 blocks, or a multiple of 8 blocks. This means that all of these free space chunks are able to be (re)used. And, they will be used. There is no need to do anything unless there is a pressing need to give disk back to the OS.

Similar Messages

  • How to find Fragmentation of tables and tablespaces in oracle 8i

    Hi,
    How can i measure the fragmentation of Tables and Tablespaces in oracle 8i.
    Do any one have any handy script to find the same.
    What are the attributes to be determined to do health checkup of a database.

    how many such empty blocks are there in the table and of what size.Again Tom Kyte reference :
    http://asktom.oracle.com/pls/ask/f?p=4950:8:7760471022221195640::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:231414051079
    For tablespace, fragmentation is the regular termAbout tablespace, the link from post above can help.
    Nicolas.

  • Fragmentation of Tablespace - Help

    We are dealing with a database of size 30 GB, which
    has become very much fragmented. The Fragmentation
    Report of the tablespace indicates that the largest single
    extent that can be allocated is 116,000 with the other
    segments mostly much smaller. Where-as the total blocks
    available in the User tablespace is 3,301,373.
    On querying V$SGASTAT, we find the free memory size
    to be more than 90,000,000 Bytes.
    We shall be pleased if any one may suggest a process
    to defragment this tablespace.
    Thank you -
    Prabir Sen.

    93469, to answer some of your questions:
    1- You need to determine if the new tablespace should be locally managed using uniform extents or autoallocate. The answer should probably be based on how much variation exists between the current object sizes (used allocation). If you have a lot of very small tables and a few large one then autoallocate may be a better choice that uniform extents.
    2- Why use three files if one will do? You should have a file management policy about file sizes and allocations so you should follow it.
    3- The best way to answer this question is to try the import and find out. There are some imp/exp bugs in 8.1 but since your tablespace names will match you will avoid the only one that comes to mind. Tables with LOB objects imported into a db where the target tablespace does not exist so that the table defaults to the owner default tablespace will fair if the LOB segment tablespace points to a non-existing tablespace since Oracle development failed to default it also. But if you do not have LOB segments this is not an issue. Come to think of it I do not think you can import a table with a LOB table into an autoallocate tablespace in version 8.1.
    HTH -- Mark D Powell --

  • How to relocate table in new tablespace in Oracle 8i

    Hi all
    I would like to know how to relocate table from one tablespace to another tablespace in Oracle 8i. Currently, I create new table without data in new tablespace and then load data from old table in old tablespace. However, I think it is not efficient at all. Could anyone kindly advise any method to proceed it
    Thanks

    Nick has pointed out the best way to relocate a table. With the alter table move command you do not have to worry about FK or any other kind of constraints, table triggers, or grants. They all remain in place. You just need to rebuild the indexes as Nick pointed out.
    There were some restrictions on the types of tables that could be moved with alter table move when the command first was introduced. I think LOB columns were unsupported at first. The old exp/imp had to be used for those cases.
    HTH -- Mark D Powell --

  • Can I import a tablespace into Oracle 10g Express Edition

    I am very new to Oracle 10g Express Edition. We have a server running Oracle Enterprise Edition and we have been creating a transportable tablespace to be imported into a few servers. This works fine for us. I would like to find out if I can import the tablespace into Oracle 10g Express Edition. Someone told me that I should be able to do that but I have no clue to how to do it. If this is possible, can someone tell where to find the information how to do this.
    Thanks,
    RJ

    I finally tried it and I got the following errors:
    IMP-00017: following statement failed with ORACLE error 721:
    "BEGIN sys.dbms_plugts.checkCompType('COMPATSG','10.2.0.2.0'); END;"
    IMP-00003: ORACLE error 721 encountered
    ORA-00721: changes by release 10.2.0.2.0 cannot be used by release 10.2.0.1.0
    ORA-06512: at "SYS.DBMS_PLUGTS", line 2004
    ORA-06512: at line 1
    IMP-00000: Import terminated unsuccessfully
    Am I right that the server that I exported the tablespace is using Oracle 10.2.0.2.0 while Oracle Express is 10.2.0.1.0? I looked around and I did not see Oracle Express version 10.2.0.2.0 that I can download. Is there a patch or something to upgrade it?
    Thanks,
    RJ

  • Can we create new tablespace in Oracle Database 10g Express Edition?

    Hi,
    Can we create new tablespace in Oracle Database 10g Express Edition instead of using the default "users" tablespace provided?
    Please advise.
    Thank you.

    Correct. The sum of all user tablespaces is not allowed to exceed 4 GIG.
    You could try shrinking your tablespaces. Theres a script called maxshrink on http://asktom.oracle.com which is useful for this.
    You could compress your tables.
    If you are storing lobs, you could consider storing them as bfiles.
    Or upgrade to Oracle Standard Edition 1. Its not that expensive.

  • Drop tablespace in Oracle 8i

    I want to know how to drop tablespace in Oracle 8i.
    Actually i read on internet that we cannot drop tablespace in oracle 8i.
    Is that true?
    How can i drop the tablespace in 8i?
    Thanks,

    8i does have a DROP TABLESPACE command. What it does not have is the "AND DATAFILES" clause. Thus, it will not remove the datafiles at the OS layer (eg filesystem).

  • Temporary tablespaces in Oracle 10g

    Hi,
    I have created temporary tablespaces in Oracle 10g from the SQL prompt,but when i list the corresponding datafiles from v$datafile there tempfiles are not listed there,why is it so?
    Regards,
    Cherry

    Hi,
    Take a look in
    1 - DBA_TEMP_FILES :http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96536/ch2398.htm
    2 - V$TEMPFILE: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96536/ch3225.htm
    Cheers,
    Marcello M.

  • Temporary tablespace in oracle 8i

    hi,
    i am working in oracle 8.1.7.4.0.i am creating a temporary tablespace.
    After creating the temp tablespace i am going to assign it as default temporary tablespace.
    alter database default temporary tablespace <tbs-name>;
    but its showing error...as
    ora-02231 - missing or invalid option to alter database,
    how to assign the default temporary tablespace in this oracle version.
    Rgds...

    You can not set the temporary tablespace at the database level as default temporary tablespace in Oracle 8i. From Oracle 9i onwards, you can create and assign the temporary tablespace at the database level.
    Only possible way in Oracle 8i is at the user level.
    i.e.
    SQL> alter user scott default tablespace TEMP;
    HTH.
    Regards,
    Sabdar Syed.

  • What is the use of SYSAUX Tablespace in Oracle 10G

    Dear Experts,
    Please Tell me What is the use of SYSAUX Tablespace in Oracle 10G Because
    during Web Load Testing It is going to increase countinuosly.Although i am not using this with any tables.
    How Can I find out the what is gong on in this.
    Can I Remove this tablesspace and other non using Schemas like FLOWS_020100,MDSYS,OUTLN,DIP and TSMSYS etc.

    What is SYSAUX?
    The SYSAUX tablespace provides storage of non-sys-related tables and indexes that traditionally were placed in the SYSTEM tablespace. For example, the tables and indexes that were previously owned by the system user can now be specified for a SYSAUX tablespace. Unfortunately, Oracle still places the SCOTT schema and the other demonstration schemas in the SYSTEM tablespace. Go figure.
    The SYSAUX tablespace is specified with the CREATE DATABASE command. This is demonstrated in the example database creation script in Figure 1.1.
    CREATE DATABASE test
    MAXINSTANCES 1
    MAXLOGHISTORY 1
    MAXLOGFILES 5
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    DATAFILE '/usr/oracle/OraHome1/oradata/aultdb1/test/system01.dbf' SIZE 300M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
    EXTENT MANAGEMENT LOCAL
    SYSAUX DATAFILE '/usr/oracle/OraHome1/oradata/aultdb1/test/sysaux01.dbf' SIZE 120M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
    DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/usr/oracle/OraHome1/oradata/aultdb1/test/temp01.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL
    UNDO TABLESPACE "UNDOTBS1" DATAFILE '/usr/oracle/OraHome1/oradata/aultdb1/test/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
    CHARACTER SET WE8ISO8859P1
    NATIONAL CHARACTER SET AL16UTF16
    LOGFILE GROUP 1 ('/usr/oracle/OraHome1/oradata/aultdb1/test/redo01.log') SIZE 10240K,
    GROUP 2 ('/usr/oracle/OraHome1/oradata/aultdb1/test/redo02.log') SIZE 10240K,
    GROUP 3 ('/usr/oracle/OraHome1/oradata/aultdb1/test/redo03.log') SIZE 10240K
    USER SYS IDENTIFIED BY "password" USER SYSTEM IDENTIFIED BY "password";
    Oracle10g sysaux
    With the new SYSAUX tablespace, Oracle comes closer to providing all the needed tablespaces for a truly OFA-compliant database right out of the box. With just one CREATE DATABASE command we can specify the SYSTEM tablespace, the TEMPORARY tablespace, the AUXSYS tablespace, the default UNDO tablespace, and the redo logs.
    Of course, with the Oracle Managed Files option you can create an entire database with a single command, but the database created is not suitable for production use and is not OFA-compliant.
    The SYSAUX tablespace is required in all new 10g databases. Only the SYSAUX tablespace datafile location is specified. Oracle specifies the remainder of the tablespace properties including:
    online
    permanent
    read write
    extent managment local
    segment space management auto
    If a datafile is specified for the SYSTEM tablespace, then one must be specified for the SYSAUX tablespace as well. If one is not specified, then the CREATE DATABASE command will fail. The only exception is for an Oracle Managed File system.
    During any update of a database to Oracle Database 10g, a SYSAUX tablespace must be created or the upgrade will fail. The SYSAUX tablespace has the same security profile as the SYSTEM tablespace. However, loss of the SYSAUX tablespace will not result in a database crash, only the functional loss of the schemas it contains.
    Can I drop SysAux?
    DROP DATAFILE
    Read this...

  • Fragmentation in tablespace

    can anyone say me how to find that the tablespace is undergoing fragmentation.please say me the ways o find out whether the tablespace is undergoing fragmentation

    Tablespace fragmentation query:
    select total.tablespace_name tsname,
    count(free.bytes) nfrags,
    nvl(max(free.bytes)/1024,0) mxfrag,
    total.bytes/1024 totsiz,
    nvl(sum(free.bytes)/1024,0) avasiz,
    (1-nvl(sum(free.bytes),0)/total.bytes)*100 pctusd
    from dba_data_files total,
    dba_free_space free
    where total.tablespace_name = free.tablespace_name(+)
    and total.file_id=free.file_id(+)
    group by total.tablespace_name,
    total.bytes;
    NFRAGS: number of fragmentation in tablespace where there are BYTES amount of free space between extents.
    MXFRAG: the maximum size of free space between extents
    This only gives you an overall info on space allocation. If you want to know about read/write and throughput of your tablespace use v$filestat. So the higher number in NFRAGS means more frangmenations.
    HTH
    Girish Sharma

  • Reorganize tablespaces in Oracle standby server

    Dear All,
    Our current configuration is
    SAP ECC 5.0
    Oracle 10.2.0.2.0
    HP/UX 11iv1
    We have Oracle Data Guard installed and working.  Since a couple of our SAP tablespaces are very fragmented, we would like to reorganize them using brtools.  These tablespaces are large (300+ GB) and we don't have the downtime to do the reorganization in the primary server.  I was wondering if we can do the following:
    1.      discontinue applying archive logs to the standby
    2.      open the standby database
    3.      reorganize the tablespaces
    4.      shutdown and mount the standby database
    5.      continue applying the archive logs from step 1 on
    I am not sure step 5 would work.  The SCN would have changed during the tablespace reorganization.
    Thank you very much,
    Fong

    > Also, since our primary server is production critical, we are worrying about some locking issues during the online reorganization.  That is why we would like to do the reorganization in the standby server.
    Stop worrying and learn how online reorgs actually works!
    You've payed a huge bunch of money for a DBMS that allows online reorgs and now you don't want to use it because you are in fear.
    And you are in fear because you don't seen to know but in doubt and uncertainty...
    Bad place to be - especially if your system is so critical.
    There is no way you can move your data on your standby size and then be able to re-synch the data with the primary site, since only physical standby is supported for SAP systems (that is block changes are transferred from primary to standby db - not SQL commands).
    With online reorg you can actually do what the name promises - perform your reorgs online, while the whole application is fully up and running.
    If you don't trust it (which is a good thing), then try it out on a test system before (you should practise it anyhow before you reorganize the production db).
    regards,
    Lars

  • How to fragment a table in oracle?

    I am a bit confused about horizontal fragmentation in oracle, for example:
    I have two databases A and B
    I create a employee table in A database that has name, dept attributes
    Now I want to fragment this table, put all the rows where dept=science to table employee in B database,
    so in B database I type:
    create table employee
    as select * from employee@A
    where dept='science';
    But the employee table in A database still has all the data , thats not what I want, I want employees in A that are not from science dept
    So how should I do this? in one step?

    891814 wrote:
    I am a bit confused about horizontal fragmentation in oracle, for example:
    I have two databases A and B
    I create a employee table in A database that has name, dept attributes
    Now I want to fragment this table, put all the rows where dept=science to table employee in B database,
    so in B database I type:
    create table employee
    as select * from employee@A
    where dept='science';
    But the employee table in A database still has all the data , thats not what I want, I want employees in A that are not from science dept
    So how should I do this? in one step?Well, creating a table in B using data that is queried from A, isn't going to magically remove the data from A.
    You'd need to have a subsequent DELETE statement that deletes the records from A that have been moved to B e.g.
    delete from employee@A
    where dept != 'science'

  • How to define tablespaces in Oracle 10g and how put tables on tablespaces

    Hello,
    I'm having trouble to define the structure of tablespaces and how to distribute the tables/indexes/lobs on these tablespaces.
    Do you know some rules on how to define this?
    What I have until now:
    1) Put table indexes in separate tablespace
    2) Put lobs in separate tablespace and use storage clause when defining the lob column. Not sure how many tablespaces to use, I have tables with millions of lobs and tables with just one lob (with row containing the lob).
    3) Please fill more rules here ...
    Thank you, Alex.

    Long story: I received database and schema creation scripts defined in Oracle 9i. I want to redesign the tablespaces number/storage and also to change the distribution of tables into tablespaces.
    As an example I will show how tablespaces are created now. There is one tablespace for indexes BLUE_AUTO_INDX and one for each EXTENT MANAGEMENT of:
    - 64K for BLOB , name BLUE_K064_BLOB
    - 64K for tables , name K064_NTAB
    - 128K for tables, name BLUE_K128_NTAB
    - 512K for CLOB , name BLUE_K512_CLOB
    - 4M for BLOB , name BLUE_M004_BLOB
    - 64M for CLOB , name BLUE_M064_CLOB
    - 8M for tables , name BLUE_M008_NTAB
    - 1M for tables , name BLUE_M001_NTAB
    - 256M for tables, name BLUE_M256_NTAB
    Definition of each tablespace is like:
    CREATE TABLESPACE BLUE_AUTO_INDX DATAFILE 'BLUE_AUTO_INDX01.DBF' SIZE 200M REUSE AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL UNIFORM SIZE 64M SEGMENT SPACE MANAGEMENT AUTO;
    CREATE TABLESPACE BLUE_K064_BLOB DATAFILE 'BLUE_K064_BLOB01.DBF' SIZE 20M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL UNIFORM SIZE 64K SEGMENT SPACE MANAGEMENT AUTO;
    CREATE TABLESPACE BLUE_K064_NTAB DATAFILE 'BLUE_K064_NTAB01.DBF' SIZE 20M REUSE AUTOEXTEND ON NEXT 20M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL UNIFORM SIZE 64K SEGMENT SPACE MANAGEMENT AUTO;
    CREATE TABLESPACE BLUE_K128_NTAB DATAFILE 'BLUE_K128_NTAB01.DBF' SIZE 20M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K SEGMENT SPACE MANAGEMENT AUTO;
    CREATE TABLESPACE BLUE_K512_CLOB DATAFILE 'BLUE_K512_CLOB01.DBF' SIZE 20M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL UNIFORM SIZE 512K SEGMENT SPACE MANAGEMENT AUTO;
    CREATE TABLESPACE BLUE_M004_BLOB DATAFILE 'BLUE_M004_BLOB01.DBF' SIZE 20M REUSE AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL UNIFORM SIZE 4M SEGMENT SPACE MANAGEMENT AUTO;
    CREATE TABLESPACE BLUE_M064_CLOB DATAFILE 'BLUE_M064_CLOB01.DBF' SIZE 400M REUSE AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL UNIFORM SIZE 64M SEGMENT SPACE MANAGEMENT AUTO;
    CREATE TABLESPACE BLUE_M008_NTAB DATAFILE 'BLUE_M008_NTAB01.DBF' SIZE 200M REUSE AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL UNIFORM SIZE 8M SEGMENT SPACE MANAGEMENT AUTO;
    CREATE TABLESPACE BLUE_M001_NTAB DATAFILE 'BLUE_M001_NTAB01.DBF' SIZE 100M REUSE AUTOEXTEND ON NEXT 50M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M SEGMENT SPACE MANAGEMENT AUTO;
    CREATE TABLESPACE BLUE_M256_NTAB DATAFILE 'BLUE_M256_NTAB01.DBF' SIZE 512M REUSE AUTOEXTEND ON NEXT 256M MAXSIZE UNLIMITED LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256M SEGMENT SPACE MANAGEMENT AUTO;
    Does this structure of tablespaces ok? I mean if the logic of one tablespace for different EXTENT SIZEs looks ok?

  • SQL*PLUS console not coming back when create a tablespace in ORACLE RAC11g

    Hi all,
    I have run a create command in oracle RAC 11g system (2 nodes, ASM) by SQL*PLUS, every datafile for this tablespace is 1.5GB, I want to create 6 tablespace at the first:
    1. It run successfully for the first tablespace , it toook 4-5 minutes to come back;
    2. It run much longer time for the second tablespace , it took over 20 minutes to come back;
    3. The third tablespace , I waited for 45 minutes and it didn't come back.
    I have check in alert.log, and saw all three tablespace were successfully created about 4-5 minutes. And I also use another SQL*PLUS to query in user_tablespaces. the third tablespace did display in user_tablespaces view.
    From that time, I tried 4,5,6, it took me 30 minutes to create 1.5GB big tablespace. It doesn't make sense for me.
    Any sugguestion? Thanks.

    How did they create the disk group?
    How big are the devices/LUNs?
    are all of the LUNS the same size?
    Check the alert log for both the RDBMS and ASM.
    What redundancy did they use?
    in asmca, what is the total size of the disk group(s)? ( or sum total_mb from v$asm_diskgroup for each disk group)

Maybe you are looking for

  • 5th gen iPod won't sync

    I updated to ios 7 and now when I try to upload some of my music my iPod gets stuck on the last step of backup.  Working from a non apple computer but it did sync once and then I wiped the songs out when I went to sync it again after adding/deleting

  • How to handle Asynch Synch (IDoc - SOAP) interfce without using BPM

    Hi Experts, I have a Idoc to SOAP scenario and where I need to hadle SOAP response but for this how it can be handle without BPM I am unable to figure out. Specificaly it is a interfacce with SFDC (sales force.com) CRM and need to handle IDoc - SOAP

  • Transferring info from G4 to mini

    I have a G4 and have both system 9.2.1 and 10.3.9 loaded. My hard drive has been making funny noises so I bought a mini to transfer everything over because this was about the same price as getting my current hard drive fixed. I also liked the idea of

  • I can't install adobe

    Someone please help me! I desperately need to install adobe flash player on my notebook but I can't at all. It keeps asking to close safari. I did close it. Even after closing it continues to ask the same question. What else am I supposed to do???? P

  • Media Manager loads to "Switch To or Retry" Buttons

    This has been going on for some time, but it's finally gotten to the point that it's annoying. I run Media Manager on my PC so I can stream music into my bedroom when I go to sleep. (Radio stations around here leave a lot to be desired, and the only