Query to find a tablespace is autoextensible r not

Hi all,
Can you please help me with a query to get tablespace detail which are autoextensible.
Actually with the below query am able to get results but it is including datafiles that are not autoextensible for a particular tablespace. Therefore it is giving me two results for a particular tablespace. Help me.
SQL> select df.TABLESPACE_NAME,
2 round(((df.BYTES - fs.BYTES) / df.BYTES) * 100) usage_pct,
3 round(decode(df.MAXBYTES, 34359721984, 0, (df.BYTES - fs.BYTES) / df.MAXBYTES * 100)) max_pct,
4 df.AUTOEXTENSIBLE
5 from
6 (
7 select TABLESPACE_NAME,
8 sum(BYTES) BYTES,
9 AUTOEXTENSIBLE,
10 decode(AUTOEXTENSIBLE, 'YES', sum(MAXBYTES), sum(BYTES)) MAXBYTES
11 from dba_data_files
12 group by TABLESPACE_NAME,
13 AUTOEXTENSIBLE
14 )
15 df,
16 (
17 select TABLESPACE_NAME,
18 sum(BYTES) BYTES
19 from dba_free_space
20 group by TABLESPACE_NAME
21 )
22 fs
23 where df.TABLESPACE_NAME=fs.TABLESPACE_NAME
24 order by df.TABLESPACE_NAME asc
25 /
TABLESPACE_NAME USAGE_PCT MAX_PCT AUT
CORE_DATABASE_DATA 95 0 YES
CORE_DATABASE_DATA 96 96 NO
V2_DATA 100 0 YES
V2_DATA 100 100 NO
XDB 94 0 YES

1) What do you believe this query shows?
2) How do you define "bubble fragmentation" and "honeycomb fragmentation"?
3) Why (and when) do you believe a DBA would act to solve either problem?
4) Since your script is identifying tablespaces, how would you propose determining which objects in your estimation need to be rebuilt?
5) How have the answer to these questions changed since the move to locally managed tablespaces a decade ago?
Back in the old days of dictionary managed tablespaces, fragmentation was a real thing that DBAs had to keep track of because every table was potentially allocating differently sized extents in a tablespace, there were lots of odd extent sizes, and it was relatively easy to end up with free space in a data file that no object in the tablespace could ever use because it was smaller than the next extent size of the objects. That is no longer a concern with locally managed tablespace-- it is not (practically) possible to have (a reasonable quantity) of disk space that is free but unusable in a locally managed tablespace, particularly when you are using uniform extents.
Justin

Similar Messages

  • How to find a tablespace is fragmented or not?

    Hi,
    I was aksed to find wether a tablespace is fragmented or not. if fragmented i need to relase the fragmented space. Can any body has solution for the same.
    Regards
    DBA.

    1) What do you believe this query shows?
    2) How do you define "bubble fragmentation" and "honeycomb fragmentation"?
    3) Why (and when) do you believe a DBA would act to solve either problem?
    4) Since your script is identifying tablespaces, how would you propose determining which objects in your estimation need to be rebuilt?
    5) How have the answer to these questions changed since the move to locally managed tablespaces a decade ago?
    Back in the old days of dictionary managed tablespaces, fragmentation was a real thing that DBAs had to keep track of because every table was potentially allocating differently sized extents in a tablespace, there were lots of odd extent sizes, and it was relatively easy to end up with free space in a data file that no object in the tablespace could ever use because it was smaller than the next extent size of the objects. That is no longer a concern with locally managed tablespace-- it is not (practically) possible to have (a reasonable quantity) of disk space that is free but unusable in a locally managed tablespace, particularly when you are using uniform extents.
    Justin

  • SQL Query to find Receipt No.s which are not matched to AP Invoices

    Hi
    Please help me to frame a query to find list of Receipt No.s which are not matched with AP Invoices.
    Please refer to the below query .
    SELECT
    poh.segment1 "PO No.",
    aps.vendor_name "Supplier Name",
    pol.item_description "Item Description",
    rcvh.receipt_num "GRV No.s",
    rcvl.quantity_received "Quantity",
    pol.unit_price "Rate/Unit",
    rcvtl.tax_name||' - '||initcap(rcvtl.tax_type) "Tax",
    (rcvl.quantity_received * pol.unit_price) + nvl(rcvtl.tax_amount,0) "Amount"
    FROM
    po_headers_all poh,
    po_lines_all pol,
    po_distributions_all pod,
    ap_suppliers aps,
    rcv_shipment_headers rcvh,
    rcv_shipment_lines rcvl,
    rcv_transactions rcvt,
    jai_rcv_line_taxes rcvtl
    WHERE
    poh.po_header_id = pol.po_header_id
    AND poh.po_header_id = pod.po_header_id
    AND pol.po_line_id = pod.po_line_id
    AND aps.vendor_id = poh.vendor_id
    AND aps.vendor_id = rcvh.vendor_id
    AND rcvh.shipment_header_id = rcvl.shipment_header_id
    AND poh.po_header_id = rcvl.po_header_id
    AND pol.po_line_id = rcvl.po_line_id
    AND rcvh.shipment_header_id = rcvt.shipment_header_id
    AND rcvl.shipment_line_id = rcvt.shipment_line_id
    AND poh.po_header_id = rcvt.po_header_id
    AND pol.po_line_id = rcvt.po_line_id
    AND aps.vendor_id = rcvt.vendor_id
    AND rcvh.shipment_header_id = rcvtl.shipment_header_id
    AND rcvl.shipment_line_id = rcvtl.shipment_line_id
    AND rcvt.transaction_id = rcvtl.transaction_id
    AND aps.vendor_id = rcvtl.vendor_id
    AND rcvt.transaction_type = 'RECEIVE'
    AND poh.authorization_status = 'APPROVED'
    AND poh.segment1 = '210001079'
    I have'nt included the Invoice Tables in the above query.
    Please help me in that area.
    This is bit urgent.
    Please help me.
    Regards
    Nakul Venkatraman

    I am using ORACLE 11gR2 If you're licensed for Diangnostics pack then you might want to look at the AWR tables, e.g. DBA_HIST_SQLSTAT and cross-reference with DBA_HIST_SNAPSHOT.
    By this will i get the top 5 consumed queries of DEV user in the whole session or its just the top 5 queries at that particular time. The "executions" columns in this query, does it mean that the no. of. times the query has executed... This will get you a random 5 queries that were first parsed by DEV. Depending on your application code/structure, it may well be that all code (except for system-recursive sql) executed by DEV is parsed by DEV, and all code parsed by DEV is executed by DEV but this isn't true for all.
    In terms of top N queries, you need to ORDER BY and then restrict by ROWNUM at an outer level to the ROWNUM otherwise the ROWNUM filter is applied before the ORDER BY.
    i.e.
    SELECT *
    FROM
    (SELECT ...
    FROM ...
    WHERE
    ORDER BY...)
    WHERE ROWNUM <= ....
    The "executions" columns in this query, does it mean that the no. of. times the query has executedYes.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e25513/dynviews_3064.htm#REFRN30259
    Edited by: Dom Brooks on Oct 24, 2011 9:45 AM

  • Sql query to find out the space issues in not able to allocate next extent

    hi,
    i have oracel 11g on linux.
    my datafiles are autoextend off. i am looking for query to make sure the segments does not stop growing by reaching the maximum segment allocated or no free contigous space available in allocating new extent,.
    i need to know periodically the owner,object_name and object type (table or index) which are suffocating for space.
    any ad-hoc sql query exists?
    thanks in advance.

    Connect as sysdba and try..
    To list all objects >100M in size.
    SQL> select owner, segment_type, segment_name, sum(bytes)/(1024*1021) from dba_segments
    group by owner, segment_type, segment_name
    having sum(bytes)/(1024*1021) > 100
    For tablespaces ..
    select tablespace_name, sum(bytes) tablespace_size
    from dba_data_files
    group by tablespace_name
    union all
    select tablespace_name, sum(bytes) tablespace_size
    from dba_temp_files
    group by tablespace_name
    order by tablespace_name

  • Query to find out pertcular schema related datafiles free space????

    hai,
    whats the query to find out free space in datafiles and index files related free space for perticular schmea?
    Regards
    dba

    If you wish to get free space in index tablespace then use following query:
    select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
    from
    (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space
    from dba_free_space group by tablespace_name) a,
    (select tablespace_name, sum(bytes)/1024/1024 as tbs_size
    from dba_data_files group by tablespace_name
    UNION
    select tablespace_name, sum(bytes)/1024/1024 tbs_size
    from dba_temp_files
    group by tablespace_name ) b
    where a.tablespace_name(+)=b.tablespace_name
    and a.tablespace_name='INDX';
    and if you get info for all tablespace then :
    select b.tablespace_name, tbs_size SizeMb, a.free_space FreeMb
    from
    (select tablespace_name, round(sum(bytes)/1024/1024 ,2) as free_space
    from dba_free_space group by tablespace_name) a,
    (select tablespace_name, sum(bytes)/1024/1024 as tbs_size
    from dba_data_files group by tablespace_name
    UNION
    select tablespace_name, sum(bytes)/1024/1024 tbs_size
    from dba_temp_files
    group by tablespace_name ) b
    where a.tablespace_name(+)=b.tablespace_name;

  • Is their,Query to find the which tempfile our Database currently using ?

    Hi All,
    Is their,Query to find the which tempfile our Database currently using ?
    Regards,
    DB

    select property_name,property_value from database_properties where property_name like '%TABLE%';
    John Watson
    Oracle Certified Master DBA
    http://skillbuilders.com
    Edited by: JohnWatson on May 14, 2013 12:27 PM
    (assuming that you mean temporary tablespace rarther thsn tempfile)

  • Find the tablespace usage for the last 6 months time.

    I have an Oracle 9i database. Now, there is a requirement to find the tablespace usage for the last 6 months.
    Can anyone please tell me, how can I achieve this? I do not have EM configured. So please lemme know if there is any script that can give these details?
    Thanks.

    878226 wrote:
    I have an Oracle 9i database. Now, there is a requirement to find the tablespace usage for the last 6 months.
    Can anyone please tell me, how can I achieve this? I do not have EM configured. So please lemme know if there is any s?cript that can give these details?
    Thanks.refer the link:- http://www.dba-oracle.com/t_v_datafile_database_size.htm
    note: i did not check the query and version. please check whether it is applicable to 9i database or not?
    10g and above refer:http://maxwellmiranda.wordpress.com/2011/03/22/segmenttablespace-growth-details-script/
    Edited by: rajeysh on Aug 28, 2011 12:14 PM

  • Query to find the space required to reduce the thershold.

    There are tablespaces where the current usage is crossed 90% and we are getting alerts.
    I want to know how much space required to add for these tablespaces ( datafiles) so that  current usage can be reduced to 80 %. or 70 %
    Is the any SQL query to find this information .
    oracle 10 g database.

    If I got the calculation right, this may be what you are looking for:
    select b.tablespace_name, (b.used_space/b.new_size) * 100 new_used_percent, b.used_percent,
           b.add_size_MB
      from (
            select tablespace_size + (((round(used_percent, 5) - 90)/100) * tablespace_size) new_size,
                   (((round(used_percent, 5) - 90)/100) * tablespace_size) add_size_MB,
                   a.*
              from dba_tablespace_usage_metrics a
           ) b;

  • Query to find out the time used by an user for an application

    Hello All,
    I want to know the query to find out the whole time used by the user for an application. Please view the below data
    Employee:
    SNO EMP_ID EMP_NAME EMP_DATE LOGIN_TIME LOGOUT_TIME
    1 10 Visu 21-Nov-2010 06:30:00 07:30:00
    2 10 Visu 21-Nov-2010 06:40:00 07:20:00
    3 10 Visu 21-Nov-2010 06:50:00 07:50:00
    4 10 Visu 21-Nov-2010 07:30:00 08:30:00
    5 10 Visu 21-Nov-2010 09:30:00 10:30:00
    By checking the above data we can say that the total time Visu used the application is
    8.30 - 6.30 (From 1,2,3,4 records) = 2hrs
    10.30 - 9.30 (Based on 5th rec) = 1hr
    So the total time Visu used the application would be 3 hrs = 180 mins.
    Could you please help me in getting the result from that data using a query?

    odie_63 wrote:
    I think it may be solved with analytics too.
    with t1 as (
                select 1 sno,10 emp_id,'Visu' emp_name,'21-Nov-2010' emp_date,'06:30:00' login_time,'07:30:00' logout_time from dual union all
                select 2,10,'Visu','21-Nov-2010','06:40:00','07:20:00' from dual union all
                select 3,10,'Visu','21-Nov-2010','06:50:00','07:50:00' from dual union all
                select 4,10,'Visu','21-Nov-2010','07:30:00','08:30:00' from dual union all
                select 5,10,'Visu','21-Nov-2010','09:30:00','10:30:00' from dual
         t2 as (
                select  emp_id,
                        emp_name,
                        emp_date,
                        to_date(emp_date || login_time,'DD-MON-YYYYHH24:MI:SS') login_time,
                        to_date(emp_date || logout_time,'DD-MON-YYYYHH24:MI:SS') logout_time
                  from  t1
         t3 as (
                select  t2.*,
                        case
                          when login_time < max(logout_time) over(
                                                                  partition by emp_id,emp_date
                                                                  order by login_time
                                                                  rows between unbounded preceding
                                                                           and 1 preceding
                            then 0
                          else 1
                        end start_of_group
                  from  t2
         t4 as (
                select  t3.*,
                        sum(start_of_group) over(partition by emp_id,emp_date order by login_time) grp
                  from  t3
         t5 as (
                select  emp_id,
                        emp_date,
                        min(login_time) login_time,
                        max(logout_time) logout_time
                  from  t4
                  group by emp_id,
                           emp_date,
                           grp
    select  emp_id,
            numtodsinterval(sum(logout_time - login_time),'day') time_spent
      from  t5
      group by emp_id
      order by emp_id
        EMP_ID TIME_SPENT
            10 +000000000 03:00:00.000000000
    SQL> SY.

  • How to use ONE query to find out tree structure?

    ID------------upperID----------Name------------------------isFolder
    1------------ 0---------- Folder
    1------------------------------------1
    2------------ 1------------ Folder 1- Sub
    Folder--------------------1
    3------------ 2------------
    Folder1-Item1-A--------------------------0
    4------------ 1------------ Folder 1- Sub
    Item-----------------------0
    Hi all, if I have a table like above to demonstrate the
    folders and item relationship. This structure allows the user to
    create unlimited folders and items.
    Now I would like to use one query to find out the tree
    structure of this table, how could I do the query.
    Any help on this will be highly appreciated!
    Thanks,
    ez

    Also, see this thread:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=12 55788&enterthread=y

  • Looking for a query to find first/last dates in overlapping dates...

    Hi,
    I'm looking for a query to find the first dates and last dates in a table conaining overlapping dates.
    I have a subscription table which has for each Customer start and end date for different subscriptions.
    I want to know the different ranges of date where there is subscriptions active.
    so if the table has this:
    CustID, Start date, end date
    1, 2008-01-01, 2012-06-06
    1 ,2009-01-01, 2011-01-01
    1, 2011-01-01, 2013-02-02
    1, 2013-01-01, 2013-08-08
    1, 2014-01-01, 2014-04-04
    I want to produce this result:
    custid, range start, range end
    1, 2008-01-01, 2013-08-08
    1, 2014-01-01, 2014-04-04
    the first row is the range identified from the 4 rows in my subscription table.
    thanks :)

    I think I found it...
    http://stackoverflow.com/questions/5213484/eliminate-and-reduce-overlapping-date-ranges
    let me try this method
    Hi,
    m writing to follow up with you on this post. Thanks for you posting a reply to share your workground. Was the problem resolved after performing the above link? If you are satisfied with the above solution, I’d like to mark this issue as "Answered".
    Please also feel free to unmark the issue, with any new findings or concerns you may have.
    Thanks,
    Sofiya Li
    If you have any feedback on our support, please click here.
    Sofiya Li
    TechNet Community Support

  • Query to find the list of users having access to a particular scenario

    Hi,
    I am learning Hyperion Planning 9.2 x version. I wanted to know the query to find the list of users having access to Plan Iteration - 1 scenarion.
    As I am new to Hyperion Essbase and Hyperion Planning, I am assuming these ideas work out to get the desired result.
    1) As Hyperion Planning uses Relational DB to store the User Security information, we can query the list of users who is having access to Plan Iteration - 1 Scenario.
    I am not sure if this solution works. Please correct me If I am wrong.
    2) We can also query from the essbase editor to find out who all having access to this scenario.
    If the above is correct, can you please provide me the query.
    I am really need of this and I will be happy if any one provide the solution.
    Thanks & Regards,
    Upendra. Bestha

    Hi,
    If you are looking for some SQL to retrieve the access rights by member then you can use something like (SQL Server code though can easily be modified for Oracle)
    SELECT usr.object_name as Username,mem.object_name as Member,
    'Access Rights' = CASE acc.access_mode
    WHEN -1 THEN 'None'
    WHEN 1 THEN 'Read'
    WHEN 2 THEN 'Write'
    WHEN 3 THEN 'Write'
    ELSE 'Unknown' END,
    'Relation' = CASE acc.flags
    WHEN 0 THEN 'Member'
    WHEN 5 THEN 'Children'
    WHEN 6 THEN 'Children (inclusive)'
    WHEN 8 THEN 'Descendants'
    WHEN 9 THEN 'Descendants (inclusive)'
    ELSE 'Unknown' END
    FROM
    hsp_access_control acc, hsp_object mem, hsp_object usr
    WHERE acc.object_id = mem.object_id
    AND acc.user_id = usr.object_id
    AND mem.object_name = 'Plan Iteration - 1'
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Query to find out which workflow(s) use a particular message ? wf_messages

    Hi guys
    Hoping someone can help.
    I've a list of particular notfication messages, which are stored in the WF_MESSAGES_TL and WF_MESSAGES table, and I need to find out which workflows use them.
    Can anyone tell me what table I can query to find this out ?
    There's no referential integrity which I can use to find this out, and google has turned up nothing so far.
    Any ideas ?
    Thanks a lot
    Scott

    You can use this and tweak it around:
    select p.process_item_type, p.process_name, p.activity_name, a.message
    from wf_process_activities p, wf_activities a
    where p.process_item_type=a.item_type and
    p.activity_name=a.name and
    a.end_date is null;-- means the active/current activity
    Regards,
    Alejandro

  • Query to find out the list of user who have delete access

    Hi,
    I need a query to find out the list of users who have delete access on perticular folder/universe/ reports  in infoview.
    Please advice.
    Regards,
    Neo.

    orton607 wrote:
    thanks for replying guys. But the thing is i am using dynamic sql execute immediate in my package, so i want those tables also and the schema name.
    thanks,
    ortonThis is not possible. The best you could do is to have a good guess.
    Or how would you parse some dynamic statement as this:
       v_suffix := 'loyees';
       v_sql := 'Select count(*) from (select ''nonsense'' col1 from emp'||v_suffix||') where col1 = ''Y'''';
       execute_immediate(v_sql);
    ...What is the table name? How do you want to parse that?
    Better rewrite all dynamic SQL statements into non dynamic ones. Or do the source control logic for those dynamic parts in an extra module. For example implement your own dependency table and force every developer to add there all dynamic parts.

  • Query to find the no of columns in a table

    Is there a query to find the total number of columns in a table?

    Dou you know read?
    -- the number of rows in a table named yourtable:
    select count(1) from yourtable;
    -- the number of columns in a table
    -- If is a user's table:
    select count(1)
    from user_tab_columns
    where table_name='YOURTABLE'
    --If it is´t
    select count(1)
    from DBA_tab_columns
    where owner = 'USEROWNER'
    and table_name='YOURTABLE'

Maybe you are looking for

  • Problem installing Flash Player 11

    Hi, When I installed the Flash Player 11, it always stops at 50%, and asking me to close IE, but even I've closed all IE, it still stops there and would not continue installing.  Please help! Thanks!

  • "Look for Apple TVs" is checked, but Apple TVs a No-Show

    My AppleTV refuses to re-unite itself with iTunes. In iTune Prefs the "Look for Apple TVs" is checked, but no Apple TVs show up in the box below. So I can't input the pass-code to get it syncing. It's weird because the network-password info in "Setup

  • View connected users

    hi in server admin for OSX snow leopard server  it says that i have 10 connected users now there is only 2 actual users how to i find out who those connected users are ?? please help

  • Muvo TX SE 1gb squeaks between tra

    hey, just bought the gb Muvo TX SE player. Everythings ok but it makes squeaking noises between tracks. Not sure if its cause I installed the firmware straight away. Anyone have this problem, can it be fixed or is defecti've? cheers

  • Problem restoring files from a Time Machine Backup! HELP!

    Heya, I have Snow Leopard and have been using Time Macine regularly since May.... I never needed to restore any file until now... Deleted some must have stuff.. and emtird the trash (of course!).. so went to time machine to restore it... Looked it up