Tablespaces with Multiple Datafiles

I've got a Version 7.3.3.4 tablespace with multiple datafiles. There's a lot of object fragmentation. I want to be able to
drop and recreate many (but not all) of the objects in this tablespace but exercise some control on which objects go to
which datafiles in order to better utilize the available space on each datafile. I've been told that Oracle assigns objects
to datafiles in a "round robin" fashion. I'd like info on exactly how this process works and if I can have a more direct effect
on where objects are placed within the tablespace?
Thanks,
Paul Hargreaves
[email protected]

Hi,
I am interested by having more information about tablespaces and how they are fragmented.
I could, perhaps help you first by telling you that there is a ALTER command for coelescing space in ORACLE 7.3.4 :
ALTER TABLESPACE tablespace COALESCE ;
Of course you should have the permissions (ALTER TABLESPACE)
This command is for the entirely tablespace ...
In fact, i need a query that gives me for each tablespaces, how are they fragmented (with segment_name ..).
Thanx
Steff

Similar Messages

  • Resize Tablespace having  multiple datafiles...

    Hi All,
    Is there any way to resize the tablespace having multiple datafiles? Tablespace having multiple DBF can not be resized like we did with alter database datafile ...resize command.
    Please let me know if anyone having any idea.
    Thanks in advance.

    But as of now I have 4 DBF in a single Tablespace and all are having more than 25G in a size. And I can see many of the free blocks in all the files at the end If the free blocks are at the end, what prevents you from resizing the datafiles?
    when data are inserting in the DBFs its not only spread to single file and once its reach to max size then only moved to second DBF, its scatter with the all the allocated DBFs of that particualr Tablespace. You can downgrade to 9i! The out-dated method you are after was deprecated with 10g. Why do you want to ignore parallelism and fill up one datafile sequentially until it reaches maximum size before putting data in another?

  • Command to add multiple datafiles in multiple tablespace in one time.

    Send me command to
    command to add multiple datafiles in multiple tablespace in one time.

    Just list the files separated by a comma.
    SQL> alter tablespace example
    2 add datafile 'e:\oradata\scratch\example02.dbf' size 100m,
    3 'e:\oradata\scratch\example02.dbf' size 100m;
    Tablespace altered.
    SQL>
    You will have to use more then one command to add datafiles to multiple tablespaces.

  • Multiple datafiles per tablespace in 9i?

    Is it recommended to have multiple datafiles per tablespace?

    Is it recommended to have multiple datafiles per
    tablespace?It all depends on your particular storage needs. You could have a single datafile at maximum capacity for your tablespace, just ensure you can store it and in case you have to move it, it could be affordable.
    There are DBA's who use several datafiles for a single tablespaces, this reduces the single point of failure possibility and allows a more flexible datafile maintenance.
    Performance is the same for, except for the checkpoint process, the more datafiles, the more effort to update datafile headers.
    ~ Madrid

  • Tablespace autoextend on multiple datafiles

    There is a tablespace with 3 data files, one of them having AUTOEXTEND option ON. I am trying to understand why space is not allocated on datafile with AUTOEXEND option ON.
    Thanks in advance..

    Please also have a look at those scripts. They may help you;
    select a.TABLESPACE_NAME, round(total,1) Total_M, round(free) Free_M, round(100*(1-free/total),1) Usage
    from (select TABLESPACE_NAME,sum(BYTES)/(1024*1024) total from dba_data_files group by TABLESPACE_NAME) a
    ,(select TABLESPACE_NAME,sum(BYTES)/(1024*1024) free from dba_free_space group by TABLESPACE_NAME) b
    where a.TABLESPACE_NAME=b.TABLESPACE_NAME(+) order by 4 DESC;
    select df.tablespace_name ,
    df.file_name ,
    df.file_id ,
    df.totalspace,
    fs.freespace from
    (select
    tablespace_name,
    file_name,
    file_id,
    round(sum(bytes)/1024/1024,2) as totalspace
    from dba_data_files
    group by tablespace_name,file_name,file_id) df,
    (select
    tablespace_name,
    file_id,
    round(sum(bytes)/1024/1024,2) as freespace
    from dba_free_space
    group by tablespace_name,file_id) fs
    where df.file_id=fs.file_id 
    order by 5 desc;

  • Oracle hangs on query with multiple joins

    To test the sotftware from the LMS-vendor that are out partners we use virtual machines where we install Windows 2003 servers and Oracle XE
    While we were testing the software I've found that a particular query with multiple unions causes the CPU of the virtual machine totally claimed by oracle
    The query causes oracle to hang.
    I've found that the subcomponents of the query all return 0 rows (and response all immediately) combined into a query with at least 2 unions the query hangs the system
    I'm not familiar with with Database Management at all
    I've read something about SGA and PGA that could be the issue and tried to increase the target for both but it doesn't seem to do anything
    Some characterics
    Target Current
    Maximum System Global Area (SGA) Size: 380 MB 380 MB
    Program Global Area (PGA) Aggregate Target: 360 MB 38 MB
    Current Configuration: (SGA + PGA): 740 MB 418 MB
    Tablespaces Percent Used Allocated (MB) Used (MB) Datafiles
    SYSAUX 98.21% 460.00 451.75 1
    SYSTEM 73.09% 510.00 372.75 1
    DATA 99.13% 440.00 436.19 1
    UNDO 6.48% 160.00 10.38 1
    USERS 1.63% 100.00 1.63 1
    sort_area_size 65536
    shared_pool_reserved_size 5452595 TRUE size in bytes of reserved area of shared pool
    shared_pool_size 0 TRUE size in bytes of shared pool
    What other parameters are important? How could I get a good picture to see what's really going on?
    Some pointers, help would be appreciated.
    Regards,
    Remco

    Below is the base-query that is causing the problems
    SELECT /* Public - Internal learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no order_number, e.id person_id, format_name(e.fname , e.lname , @@005) learner_name , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description item_desc, substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1 , r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN tpt_oe_order_items i ON i.reg_id = r.id INNER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id INNER JOIN tpt_company c ON e.company_id = c.id INNER JOIN tpt_offering_action oa on r.offering_action_id = oa.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name INNER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name INNER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name INNER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name WHERE e.type = 100 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003))
    UNION
    SELECT /* Public - External learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , e.id person_id, format_name(e.fname , e.lname , @@005) , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1, r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN tpt_oe_order_items i ON i.reg_id = r.id INNER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id INNER JOIN tpt_offering_action oa on r.offering_action_id = oa.id LEFT OUTER JOIN tpt_company c ON e.company_id = c.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name INNER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name INNER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name INNER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name WHERE e.type = 200 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003))
    UNION
    SELECT /* Public - Unassigned learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , null person_id, null , null company_id, null , ent.id entidd, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1, r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,'' org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,'' learner_first_name ,'' learner_last_name FROM tpt_registration r INNER JOIN tpt_oe_order_items i ON i.reg_id = r.id INNER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN tpt_offering_action oa on oa.id = r.offering_action_id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name INNER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name INNER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name INNER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name WHERE r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND r.student_id is null AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 AND @@003 is null
    UNION
    SELECT /* Private - Internal learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , e.id person_id, format_name(e.fname , e.lname , @@005) , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1 , r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN let_pvt_offering_request pvt_offreq ON pvt_offreq.class_id = r.class_id INNER JOIN tpt_offering_action oa on oa.id = r.offering_action_id LEFT OUTER JOIN tpt_oe_order_items i ON i.part_id = pvt_offreq.id LEFT OUTER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id LEFT OUTER JOIN tpt_company c ON e.company_id = c.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name LEFT OUTER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' LEFT OUTER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name AND orderList.list_id = 'sysli000000000000129' AND orderList.locale_id = @@005 LEFT OUTER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name AND approvalList.list_id = 'sysli000000000000165' AND approvalList.locale_id = @@005 WHERE e.type = 100 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003))
    UNION
    SELECT /* Private - External learner */ r.id reg_id, i.id order_item_id, o.id order_id, o.order_no , e.id person_id, format_name(e.fname , e.lname , @@005) , c.id company_id, c.name2 , ent.id entid, ctype.id ctypeid, ctype.name , i.status , items.description , substr ( i.flags , 1 , 1 ) is_conf , r.status status1, rs.description description1 , r.wlist_priority , r.reg_no , r.flags , o.status status2, o.split, null learnerViewOnly, null statusViewOnly, i.approved_status, decode(substr(r.flags,2,1),'1','true','false') isWalkIn, oa.id offering_action_id, oa.status profile_status ,c.name2 org_name ,ctype.name audience_sub_type ,items.description description ,o.order_no order_no ,orderList.description order_status ,approvalList.description approval_status ,e.fname learner_first_name ,e.lname learner_last_name FROM tpt_registration r INNER JOIN let_pvt_offering_request pvt_offreq ON pvt_offreq.class_id = r.class_id INNER JOIN tpt_offering_action oa on r.offering_action_id = oa.id LEFT OUTER JOIN tpt_oe_order_items i ON i.part_id = pvt_offreq.id LEFT OUTER JOIN tpt_oe_order o ON i.order_id = o.id INNER JOIN cmt_person e ON r.student_id = e.id LEFT OUTER JOIN tpt_company c ON e.company_id = c.id LEFT OUTER JOIN tpt_roster_template_entry ent ON r.ros_temp_ent_id = ent.id LEFT OUTER JOIN tpt_customer_type ctype ON ent.customer_type_id = ctype.id INNER JOIN fgt_ext_sys_list_of_val rs ON to_char ( r.status ) = rs.name LEFT OUTER JOIN fgt_ext_sys_list_of_val items ON to_char ( i.status ) = items.name AND items.locale_id = @@005 AND items.list_id = 'sysli000000000000131' LEFT OUTER JOIN fgt_ext_sys_list_of_val orderList ON to_char ( o.status ) = orderList.name AND orderList.locale_id = @@005 AND orderList.list_id = 'sysli000000000000129' LEFT OUTER JOIN fgt_ext_sys_list_of_val approvalList ON to_char(i.approved_status) = approvalList.name AND approvalList.locale_id = @@005 AND approvalList.list_id = 'sysli000000000000165' WHERE e.type = 200 AND r.class_id = @@001 AND r.status = nvl ( to_number(@@002) , r.status ) AND rs.locale_id = @@005 AND rs.list_id = 'sysli000000000000100' AND ((@@003 is null) or (@@003 is not null and r.student_id = @@003)) ORDER BY 34,35,28,29,31,30,33,32

  • How the storage will be allocated on Undo tablespace made of datafiles?

    I have a UNDO tablespace with two data files. Wherein one data file with Auto Extend as Yes and other as No.
    In the case of multiple datafiles in UNDO tablespace,
    1. Will the storage be allocated of same size on each datafile ?
    2. What will be the case when the datafile with Auto Extent as NO reached it's max size?
    3. Will the storage be allocated proportion to the datafile size in each file?

    But when I use the following query, its not getting fired. Its taking "INDEX FULL SCAN"I would have thought that the later part of the above statement contradicts with the earlier part of the statement.
    its not getting firedcontradicts this statement:
    Its taking "INDEX FULL SCAN"Since the birth_dt is not the leading column of your index ...
    Is it doing a INDEX FULL SCAN on the GPM_PERSONPROFILEDEMO_DOB2_IDX index?
    if you have queries that involve profile_update_dt + birth_dt and some others that involve only birth_dt, then why not have the index in birth_dt + profile_update_dt instead?

  • Tablespace with one table

    I have a Tablespace which will only ever have one table. The first file and each subsequent file for this tablespace will be 2 GB each. Is it appropriate to have one segment of size 2GB for each file? Are there benefits to having multiple segments to the table per file even though it is the only one table in the Tablespace?
    thanks, Jon
    [email protected]

    There are many advantages to creating multiple datafile per tablespace, even if it has only one table. If a tablespace has more then one datafile, then Oracle will stripe the table extents across the datafiles.
    As an example, lets say you create your table with Initial and next extents set to 5 MB. As Oracle inserts the rows, and an extent fills up, the next extent will be created in the next datafile. If you create your datafiles on separate drive volumes, the will really speed up your I/O. (Not as quick as partioning, and you can't select by partition, but it is still an improvement over one large datafile).
    I recently did this for a schema I was rebuilding, I created 4 datafile on 2 Filesystems for the Tablespace. When I reimported the data, it was almost as fast as the export. Now, each of the larger segments are spread evenly over all four datafiles.

  • Autoextend user tablespace or add datafile

    Hello,
    My USERS tablespace had problem today when loading a file using sqlldr. It stopped loading halfway through the file.
    The allocated is set to 1900 mb and the used was at 1850. I only have 1 datafile for users tablespace. I have autoextensible to YES.
    Why did it not extend the tablespace when I should still have 2gb free??
    I dropped a couple unused user tables and it reduced the used amount, then I was able reran the sqlldr load and it completed.
    Should I create a new datafile
    ALTER TABLESPACE USERS ADD DATAFILE ‘/usr/lib/oracle/xe/oradata/XE/users01.dbf’ SIZE 2000M AUTOEXTEND OFF;
    or increase the allocation
    ALTER DATABASE DATAFILE ‘/usr/lib/oracle/xe/oradata/XE/users.dbf’ RESIZE 3000M;
    Thanks for the help...

    Why did it not extend the tablespace when I should still have 2gb free??
    Might be maxsize was defined at the time of tablespace creation
    For example
    SQL> select DBMS_METADATA.GET_DDL('TABLESPACE', 'USERS') from dual;
    DBMS_METADATA.GET_DDL('TABLESPACE','USERS')
    CREATE TABLESPACE "USERS" DATAFILE
    'C:\ORACLE\ORACLEXE\ORADATA\XE\USERS.DBF' SIZE 104857600
    AUTOEXTEND ON NEXT 10485760[b] MAXSIZE 5120M
    LOGGING ONLINE PERMANENT BLOCKSIZE 8192
    EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO
    Should I create a new datafile
    ALTER TABLESPACE USERS ADD DATAFILE
    ‘/usr/lib/oracle/xe/oradata/XE/users01.dbf’ SIZE
    2000M AUTOEXTEND OFF;
    or increase the allocation
    ALTER DATABASE DATAFILE
    ‘/usr/lib/oracle/xe/oradata/XE/users.dbf’ RESIZE
    3000M; It is good idea to add new file and having multiple file with same size.
    Also in future if needed you can relocate datafile to reduce I/O contention.

  • Can I Select from table skipping extents linked with lost datafiles?

    Hi~,
    I need your help to recover my database.
    I'm using oracle 9.2.0.8 at Fedora 3 with no-archive mode.
    and I don't have any backup.
    Last night, I experenced hard disk failure.
    I tried OS-level recovery, but I lost some datafiles of tablespace.
    anyway, I wanted to recover my database without data of lost datafiles.
    so, I issued "alter database datafile offline drop" and
    start oracle instance.
    But, datafiles were not removed from dba_data_files view and
    extents linked with lost datafiles were not removed from dba_extents view!
    Selecting query of some table containing extents linked with lost data files,
    I got "ORA-00376: file xxx cannot be read at this time" message.
    So, my question is that..
    HOW CAN I SELECT FROM THAT TABLE WITHOUT SCANNING EXTENTS LINKED WITH LOST DATA FILES?
    Thanks.

    Hi,
    Without being in archivelog and without backup, one can't do any sort of recovery. That's why backups and archivelog are so so important.
    The offline data file command never does actually drop the datafile. It merely indicates to the control file that now the said tablespace will also be dropped. This won't update any view that the files are not supposed to be used or shown to you anymore.
    This is what documentation says about the recovery of the database in the NoARch mode,
    http://download.oracle.com/docs/cd/B19306_01/backup.102/b14191/osrecov.htm#i1007937
    You do need a backup in order to get those tables being read. Oracle doesn't have any feature which can offline/skip the missing extents for you and let you read the data without them.
    HTH
    Aman....

  • Spatial Query with multiple geometries from 2 tables

    Hi,
    I'm using Oracle 8.1.7. I am trying to do a spatial query on two tables with multiple geometries. There are two spatial tables. One made up of points and one made up of polygons. There are 829551 rows in the table of points and 1817795 rows in the table with polygons...
    I want to find all polygons where one of this points is within it...
    This query is pretty intensive querying two large spatial tables against each other and so I need to find the most efficient way of running this query. I've been running variations of my query for the last two week and every time it's bombed out with various errors after 12-24 hrs processing like out of memory, out of tablespace, out of processing, invalid index etc etc etc. I need to get this query run asap... Any tips would be gratefully appreciated..
    For the session running the query I've allocated 16M sort area with
    ALTER SESSION SET SORT_AREA_SIZE=16777216;
    Below is the query I'm running... How can I improve this please? BTW PARCEL_OVERLAPS contains the points and TP$_PARCEL_AREAS the polygons.
    SELECT lu.LNU_PARCEL_ID
         FROM
              seventy.PARCEL_OVERLAPS po,
              imap_topol.TP$_PARCEL_AREAS pa,
              TP$_PARCEL_CENTROID_AREA pca,
              TDCR_LAND_UNIT lu
         WHERE
              SDO_FILTER(po.geometry, pa.area,
              'querytype=WINDOW') = ’TRUE’ and
              sdo_within_distance(po.geometry,pa.area,'distance=0')='TRUE' and
              pa.delete_date is null and
              Lu.LNU_LAND_UNIT_UNIQUE_NUM = pca.CENTROID_ID and
              pa.AREA_ID = pca.AREA_ID and
              pca.DELETE_DATE IS NULL and
              pa.DELETE_DATE IS NULL;

    Albert,
    Thanks for your reply and the tips you've given. The tp$_parcel_areas table will always be bigger so I've changed the order to sdo_within_distance(pa.area,po.geometry,'distance=0')='TRUE'. The requested counts for those queries are
    12:26:29 [email protected]:SQL> select count(*)
    13:46:22 2 from seventy.PARCEL_OVERLAPS;
    COUNT(*)
    612
    13:48:12 [email protected]:SQL> select count(*)
    13:48:17 2 from imap_topol.TP$_PARCEL_AREAS pa,
    13:48:21 3 TP$_PARCEL_CENTROID_AREA pca
    13:48:21 4 where pca.DELETE_DATE IS NULL
    13:48:21 5 and pa.DELETE_DATE IS NULL
    13:48:21 6 and pa.AREA_ID = pca.AREA_ID;
    COUNT(*)
    1310665
    There was no reason for both filter and within_distance. I did try use the anyinteract but for some reason that does not return the desired results(I've added one id row as a test to make sure it returns desired results). Plus Oracle have recomended using the within distance for better performance..
    so the explan plan for
    14:38:37 [email protected]:SQL> EXPLAIN PLAN FOR
    14:38:50 2 SELECT lu.LNU_PARCEL_ID
    14:38:50 3 FROM
    14:38:50 4 seventy.PARCEL_OVERLAPS po,
    14:38:50 5 imap_topol.TP$_PARCEL_AREAS pa,
    14:38:50 6 TP$_PARCEL_CENTROID_AREA pca,
    14:38:50 7 TDCR_LAND_UNIT lu
    14:38:50 8 WHERE
    14:38:50 9 sdo_within_distance(pa.area,po.geometry,'distance=0')='TRUE' and
    14:38:50 10 pa.delete_date is null and
    14:38:50 11 Lu.LNU_LAND_UNIT_UNIQUE_NUM = pca.CENTROID_ID and
    14:38:50 12 pa.AREA_ID = pca.AREA_ID and
    14:38:50 13 pca.DELETE_DATE IS NULL and
    14:38:50 14 pa.DELETE_DATE IS NULL;
    is
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 4G|32920G| 547M| | |
    | NESTED LOOPS | | 4G|32920G| 547M| | |
    | MERGE JOIN | | 547M| 2029G| 230124 | | |
    | SORT JOIN | | 1M| 36M| 85014 | | |
    | MERGE JOIN | | 1M| 36M| 50019 | | |
    | SORT JOIN | | 1M| 17M| 21650 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 1M| 17M| 485 | | |
    | SORT JOIN | | 1M| 22M| 28369 | | |
    | TABLE ACCESS FULL |TDCR_LAND | 1M| 22M| 2127 | | |
    | SORT JOIN | | 42K| 160M| 145111 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 42K| 160M| 12697 | | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    14:43:14 [email protected]:SQL> explain plan for
    14:43:23 2 SELECT pa.AREA_ID
    14:43:23 3 FROM seventy.PARCEL_OVERLAPS po,
    14:43:23 4 imap_topol.TP$_PARCEL_AREAS pa
    14:43:23 5 WHERE SDO_RELATE(po.geometry, pa.area,'mask=ANTINTERACT querytype=WINDOW') = 'TRUE'
    14:43:23 6 and pa.DELETE_DATE IS NULL;
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 6M| 50G| 10M| | |
    | NESTED LOOPS | | 6M| 50G| 10M| | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 850K| 3G| 12697 | | |
    14:45:03 [email protected]:SQL> explain plan for
    14:45:04 2 SELECT pa.AREA_ID
    14:45:05 3 FROM seventy.PARCEL_OVERLAPS po,
    14:45:05 4 imap_topol.TP$_PARCEL_AREAS pa
    14:45:05 5 WHERE SDO_RELATE(pa.area, po.geometry,'mask=ANTINTERACT querytype=WINDOW') = 'TRUE'
    14:45:05 6 and pa.DELETE_DATE IS NULL;
    Plan Table
    | Operation | Name | Rows | Bytes| Cost | Pstart| Pstop |
    | SELECT STATEMENT | | 6M| 50G| 863554 | | |
    | NESTED LOOPS | | 6M| 50G| 863554 | | |
    | TABLE ACCESS FULL |TP$_PARCE | 850K| 3G| 12697 | | |
    | TABLE ACCESS FULL |PARCEL_OV | 817 | 3M| 1 | | |
    --------------------------------------------------------------------------------

  • Recover database with corrupt datafile

    I have an Oracle 9.2.0.6.0 database which has crashed due to disk failure & there is no backup. on the disk that failed there is one rollback datafile so I was hoping to be able to just drop this datafile & the related tablespace & recreate on disk that is OK.
    I found the following instructions in a thread on this forum & managed the offline drop of the datafile & the alter database open. However when I tried to drop the rollback tablespace it couldn't find what I though the tablespace was. Now when I try & do anything with the DB is failed with the error -
    Error 376 happened during db open, shutting down database
    USER: terminating instance due to error 376
    Instance terminated by USER, pid = 47050
    ORA-1092 signalled during: ALTER DATABASE OPEN...
    the instructions I was following were :-
    Database was NOT cleanly shut down
    I.e. Datafile was accidentally dropped using operating system command, when the database was not cleanly shutdown using SHUTDOWN ABORT COMMAND.
    * Check the alert.log file for this instance.
    * Comment out the ROLLBACK_SEGMENTS parameter and add the following line: corruptedrollback_segments = ( ,...., ) i.e., the above list should contain all the rollbacks originally listed in the ROLLBACK_SEGMENTS parameter.
    * Mount the database in restricted mode. STARTUP RESTRICT MOUNT
    * Offline drop the lost datafile.
    ALTER DATABASE DATAFILE OFFLINE DROP;
    * Open the database.
    ALTER DATABASE OPEN.
    * Drop the rollback tablespace to which the datafile belonged.
    * Recreate the rollback tablespace with all its rollback segments. Remember to bring the rollbacks online after you create them.
    * Make the database available to all users.
    * ALTER SYSTEM DISABLE RESTRICTED SESSION;
    You should be able to see your database back at this step.
    Any ideas how to indentify the tablespace that I need to drop & how to get the database into a state that will let me attempt this?

    latest entries in alert.log ...
    Mon Jan 18 15:32:33 2010
    Errors in file /dwdb1/u01/oracle/app/oracle/admin/PLYDW/bdump/plydw_smon_33822.t
    rc:
    ORA-01595: error freeing extent (2) of rollback segment (13))
    ORA-00376: file 6 cannot be read at this time
    ORA-01110: data file 6: '/dip3/u07/oradata/PLYDW/dwrbs01.dbf'
    SMON: about to recover undo segment 2
    SMON: mark undo segment 2 as needs recovery
    SMON: about to recover undo segment 3
    SMON: mark undo segment 3 as needs recovery
    SMON: about to recover undo segment 4
    SMON: mark undo segment 4 as needs recovery
    SMON: about to recover undo segment 5
    SMON: mark undo segment 5 as needs recovery
    SMON: about to recover undo segment 6
    SMON: mark undo segment 6 as needs recovery
    SMON: about to recover undo segment 7
    SMON: mark undo segment 7 as needs recovery
    SMON: about to recover undo segment 8
    SMON: mark undo segment 8 as needs recovery
    SMON: about to recover undo segment 9
    SMON: mark undo segment 9 as needs recovery
    SMON: about to recover undo segment 10
    SMON: mark undo segment 10 as needs recovery
    SMON: about to recover undo segment 11
    SMON: mark undo segment 11 as needs recovery
    Mon Jan 18 15:32:46 2010
    Errors in file /dwdb1/u01/oracle/app/oracle/admin/PLYDW/udump/plydw_ora_52948.tr
    c:
    ORA-00376: file 6 cannot be read at this time
    ORA-01110: data file 6: '/dip3/u07/oradata/PLYDW/dwrbs01.dbf'
    Mon Jan 18 15:32:46 2010
    Error 376 happened during db open, shutting down database
    USER: terminating instance due to error 376
    Instance terminated by USER, pid = 52948
    ORA-1092 signalled during: alter database open...

  • Storage clause for locally manged tablespace with unifom size extents

    in oracle 9i PERSONAL EDITION
    I HAVE CREATED A TABLESPACE TEST1 AS LOCALLY MANAGED WITH UNIFORM SIZE AS 256K.MY DB_BLOCK_SIZE IS 4K
    I HAVE CREATED A TABLE XYX IN THE TEST1 TABLESPACE WITH THE STORAGE (INITIAL 52K NEXT 52K)
    WHEN I QUERIED THE DBA_EXTENTS IT SHOWS THE INITAIL EXTENT AS 256 K
    BUT WHEN I QUERIED THE DBA_SEGMENTS IT SHOWS THE INITAL_EXTENT AS 52K.
    IS THEIR ANY SIGNIFICANCE OF SPECIFYING THE STORAGE CLAUSE IN LOCALLY MANAGED TABLESPACES.

    take a example what is effect of set storage parameter in table whoes tablespace is locally manager and have uniform size
    i have a tablespace whoes
    [b]uniform size is 32k
    but when i create a table then i set initial 128k
    now when table is create it create 4 extent
    of 32 each(32*4=128)
    because tablespace uniform size is 32
    if we give intial 256 then it create
    8 extent(32*8=256)
    like
    create tablespace tt_check
    datafile 'E:\ORACLE\SAFE_DATA\tt_check.dbf' size 10m
    extent management local uniform size 32k;
    create table tt_1
    (no number)
    tablespace tt_check
    storage(initial 128k
    next 128k);
    1* select extent_id,segment_name,tablespace_name,bytes from dba_extents where segment_name='TT_1'
    QL> /
    EXTENT_ID SEGMENT_NAME TABLESPACE_NAME BYTES
    0 TT_1 TT_CHECK 32768
    1 TT_1 TT_CHECK 32768
    2 TT_1 TT_CHECK 32768
    3 TT_1 TT_CHECK 32768
    hope it will help you
    kuljeet pal singh

  • Tablespace with too many extents are evil for performance

    I think the tablespace with too many extents are not bad for performance after introduction of LMT tablespace?? May be true with DMT tablespace(earlier versions). This is just observation after reading the LMT vs DMT tablespaces.
    Experts - Please comment on your thoughts.

    Indeed, I work in an environment where there is over 50 databases to be administered and so we have lots of DBAs interacting with each other.
    I'm stunned by this myth of "reorganization". Most of the DBAs move tables + rebuild indexes regularly generating huge redo  on a monthly basis. Also provoking indexes to do all the splits again generating even more redo. They claim "it helps performance a lot" however not one is able to quantify and quite justify it other than "less extents less I/O, good". Even when I bring up the existence of shrink they say "do not like it, prefer the classic move". People really have a way of holding on to their good ol' practices of Oracle 8i.
    For full table scans (which should never be done on a OLTP scenario) this extent issue would be relevant IF data on the table is the victim of large deles and Oracle hasn't re-used that space yet. If your multiblock reads is a multiple of your extent size, than there won't be any overhead of I/O call, no matter the number of your extents. For OLTP this is not relevant because Oracle will access the table via ROWID.
    I rarely have ever seen an index benefit from a rebuild significantly. In my experience what people often understand as "index fragmentation" is often just an unoptimized execution plan due to cardinality issues where oracle ends up fetching a large percentage of the table via single reads on that index.

  • Create tablespace with extend, etc.

    Hi guys,
    I am typing the following commands bellow: (ORACLE_HOME and ORACLE_SID is set up correctly).
    #sqlplus “sys/<sys-password> as sysdba” ==> worked very well, of course !
    SQL> create tablespace imm datafile ‘$ORACLE_HOME/oradata/$ORACLE_SID/imm01.dbf’ size 100M autoextend on next 100M;
    ERROR at line 1:
    ORA-01034: ORACLE not available
    I have the below scripts set up correctly. Any one know how can I solve this problem ?!
    Any help is appreciate !
    # dbstart
    SQL*Plus: Release 9.2.0.1.0 - Production on Fri Apr 7 16:46:24 2006
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    SQL> Connected to an idle instance.
    SQL> ORACLE instance started.
    Total System Global Area 672223892 bytes
    Fixed Size 455316 bytes
    Variable Size 268435456 bytes
    Database Buffers 402653184 bytes
    Redo Buffers 679936 bytes
    Database mounted.
    Database opened.
    SQL> Disconnected from Oracle9i Release 9.2.0.1.0 - Production
    JServer Release 9.2.0.1.0 - Production
    Database "immdb" warm started.
    # lsnrctl start
    LSNRCTL for Solaris: Version 9.2.0.1.0 - Production on 07-APR-2006 16:46:46
    Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
    Starting /apps/oracle/OraHome//bin/tnslsnr: please wait...
    TNSLSNR for Solaris: Version 9.2.0.1.0 - Production
    System parameter file is /apps/oracle/OraHome/network/admin/listener.ora
    Log messages written to /apps/oracle/OraHome/network/log/listener.log
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
    Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gama2)(PORT=1521)))
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for Solaris: Version 9.2.0.1.0 - Production
    Start Date 07-APR-2006 16:46:46
    Uptime 0 days 0 hr. 0 min. 0 sec
    Trace Level off
    Security OFF
    SNMP OFF
    Listener Parameter File /apps/oracle/OraHome/network/admin/listener.ora
    Listener Log File /apps/oracle/OraHome/network/log/listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gama2)(PORT=1521)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "immdb.gama2" has 1 instance(s).
    Instance "immdb", status UNKNOWN, has 1 handler(s) for this service...
    Service "oradb.gama2" has 1 instance(s).
    Instance "oradb", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    Cheers,
    Murilo

    Can i perhaps add Operating system environment variable to DATAFILE value somehow? I don't want to create tablespace with full file path, starting from drive name and ending with file name.You can use variables in dbca when you create a database (I already can hear you say you don't want that)
    You can also use Oracle Managed Files for the entire database ( I already can hear you say you don't want that)
    You can not use relative paths, which begs the question why you don't want to use an absolute path, assuming you seldomly create a tablespace.
    I don't want to see posts like yours with unjustified 'complaints', yet I do respond to it.
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for

  • Calculating the square root...

    Hi all, let me shortly sketch the situation. I have a number of fields that I select from the database (coming from different queries) that I need to do calculations on... so far, I was able to do most of those calculations, but now I'm stuck. One of

  • Business Objects has encountered a problem and need to close

    Hello All, "business objects has encountered a problem and need to close"  is the error message i get whenever i try to import from Desktop Intelligence. I deleted the .LSI files.....but in vain ,i still have the same problem.Please let me know of an

  • How can you transfer over all your pictures from icloud to andriod?

    I just got a new aphone yesterday and its the new LG G2. I used to have an iphone and i have very important pictures on my iphone that i want on my new phone.. how would i go about doing that?

  • Newbie question: how to completely remove audio

    I have some very old footage I've imported that was originally made with a silent 8mm camera in the '50's. At one point years ago it was transferred to video tape on a gizmo that recorded the projector noise. I want to eliminate the audio completely

  • 10.5.2 No option for menu bar transparency on Mac Pro...?

    After updating my MacBook Pro to the latest, I was able to see and use the new menu bar transparency setting. Unfortunately, I cannot see the option on my quad core Mac Pro. Could it be due to the fact that I run multiple monitors? I am quite surpris