Database logical segment details..

db: 11g
OS: unix
friends & gurus,
I am trying to get database logical segment details along with datafile id and tablespace name...
just want to confirm I'm progressing in right direction...
trying to get following
1. owner,
2. segment_name,
3. partition_name,
4. file_id (datafile id)
5. segment_type
6. extent_ct (number of extents occupies in the datafile)
7. size_k (space in kb occupy that this obect is occupying in the datafile)
I have come up with below sql... is it correct or more changes required?
I have got feeling that I'm missing something for 6 & 7
SELECT
dbs.owner, dbs.segment_name, dbs.partition_name, df.file_id, dbs.segment_type, dbs.extents, (dbs.bytes)/1024 size_k
FROM
dba_data_files df,
dba_tablespaces tbs,
dba_segments dbs
WHERE
df.tablespace_name = tbs.tablespace_name
and tbs.tablespace_name = dbs.tablespace_name
and tbs.contents = 'PERMANENT'
order by 1,2
/ thank you...

This is not exactly what you want but is maybe close enough: to get extent numbers and extents size per owner, segment_name, segment_type and datafile:
set echo on
set linesize 132
spool tes.log
column owner format a10
column segment_name format a40
select owner, segment_name, segment_type, file_id, count(*) as ext_nb, sum(bytes/1024/1024) as ext_mb
from dba_extents
group by owner, segment_name, segment_type, file_id
order by 1,2,3,4;
OUTLN      OL$                                      TABLE                       1          1      .0625
OUTLN      OL$HINTS                                 TABLE                       1          1      .0625
OUTLN      OL$HNT_NUM                               INDEX                       1          1      .0625
OUTLN      OL$NAME                                  INDEX                       1          1      .0625
OUTLN      OL$NODES                                 TABLE                       1          1      .0625
OUTLN      OL$NODE_OL_NAME                          INDEX                       1          1      .0625
OUTLN      OL$SIGNATURE                             INDEX                       1          1      .0625
OWNER      SEGMENT_NAME                             SEGMENT_TYPE          FILE_ID     EXT_NB     EXT_MB
OUTLN      SYS_IL0000000453C00021$$                 LOBINDEX                    1          1      .0625
OUTLN      SYS_LOB0000000453C00021$$                LOBSEGMENT                  1          1      .0625
SCOTT      BONUS                                    TABLE                       4          2       .125
SCOTT      DEPT                                     TABLE                       4          1      .0625
SCOTT      EMP                                      TABLE                       4          1      .0625
SCOTT      EMP_RANGE                                TABLE PARTITION             4          5      .3125
SCOTT      PK_DEPT                                  INDEX                       4          1      .0625
SCOTT      PK_EMP                                   INDEX                       4          1      .0625
SCOTT      SALGRADE                                 TABLE                       4          1      .0625
SYS        ACCESS$                                  TABLE                       1         18          3
SYS        ALERT_QT                                 TABLE                       3          3      .1875
OWNER      SEGMENT_NAME                             SEGMENT_TYPE          FILE_ID     EXT_NB     EXT_MB
SYS        APPLY$_CONF_HDLR_COLUMNS                 TABLE                       1          1      .0625
SYS        APPLY$_CONF_HDLR_COLUMNS_UNQ1            INDEX                       1          1      .0625
SYS        APPLY$_CONF_HDLR_COLUMNS_UNQ2            INDEX                       1          1      .0625
SYS        APPLY$_CONSTRAINT_COLUMNS                TABLE                       1          1      .0625
SYS        APPLY$_CONSTRAINT_COLUMNS_IDX1           INDEX                       1          1      .0625
SYS        APPLY$_CONSTRAINT_COLUMNS_UIX1           INDEX                       1          1      .0625
SQL>

Similar Messages

  • Sql for database logical segment details...

    db: 11g
    OS: unix
    friends.. I am trying to get database logical segment details along with datafile id and tablespace name...
    just want to confirm I'm progressing in right direction...
    trying to get following
    1. owner,
    2. segment_name,
    3. partition_name,
    4. file_id (datafile id)
    5. segment_type
    6. extent_ct (number of extents occupies in datafile)
    7. size_k (space in kb occupy in datafile)
    I have come up with below sql... is it correct or more changes required?
    I have got feeling I'm missing something for 6 & 7
    SELECT
    dbs.owner, dbs.segment_name, dbs.partition_name, df.file_id, dbs.segment_type, dbs.extents, (dbs.bytes)/1024 size_k
    FROM
    dba_data_files df,
    dba_tablespaces tbs,
    dba_segments dbs
    WHERE
    df.tablespace_name = tbs.tablespace_name
    and tbs.tablespace_name = dbs.tablespace_name
    and tbs.contents = 'PERMANENT'
    order by 1,2
    /thanks,

    posted in correct segment...

  • Database logical structure

    Anyone know online documentation that explains database logical structure ?
    The relationships between database, tablespace, datafile, segment, extent, and blocks ... storage structure.
    In an easy to understand document :)
    I am learning Oracle 9i, any helps are really appreciated.
    Thanks in advance.

    I'd start with [url http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96524/toc.htm]     Oracle9i Database Concepts

  • Unknown Database Connector Error   Details: "Failed to retrieve SQL Error"

    Hi
    Getting "Failed to retrieve SQL Error" while trying to refresh the Crystal report.
    Unable to create a new report also
    This is my ERROR MESSAGE
    "Unknown Database Connector Error   Details: "Failed to retrieve SQL Error"
    Previous Error: Query generated multiple SQL statements.However multiple SQL is not supported in crystal reports query panel"
    Any Suggestion.

    Hi,
    Please note that any query that generates multiple SQL statements is not supported in the Query Panel in Crystal Reports.
    I guess this Universe is generating multiple SQLs and hence the error.
    I found this option while I was searching for something else: Could you try turning off the "Multiple SQL statement for each measure" in the Universe parameters and see if it works?
    Also, here's the Universe Support Guide, although old, it is still applicable:
    http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/20984c2b-17f1-2b10-1091-d18977f7cd8f?QuickLink=index&overridelayout=true
    -Abhilash

  • Using IDOC FIDCCP02 - Filling Profitability Segment details

    HI Experts,
    Has any one used the Idoc type FIDCC2 for migration purposes and Filled the Profitability segment details with in that IDOC and posted successfully? Please let me know where to fill the profitaility segment fields as there are no relavent fields with in the idoc for these.
    Regards
    Rajeev K

    have you received a reply for this yet. I have the same issue that I am trying to resolve.
    Thanks,
    BG

  • Failed to load database information. Details: The database DLL 'crdb_fielddef.dll' could not be loaded.

    I recently recreated a report using our Crystal Reports XI for .NET upgrade.  The report consists of 6 subreports, all based on dynamic datasets(field defs only) and loaded at runtime.  Problem is that it's not working.  I keep getting the following error when trying to run the asp.net ReportViewer page.   Failed to load database information. Details: The database DLL 'crdb_fielddef.dll' could not be loaded. Error in File C:\DOCUME1\eseidel\LOCALS1\Temp\SupplierReport_Final {02CAA886-3D0C-43E9-8155-EA7E58FAB8C7}.rpt: Failed to load database information.
    Any ideas?  Thanks.  I do have crdb_fielddef.dll in my c:/windows/system32 and I tried to include it in the project as well but with no luck.  Please help.  Thank you.
    Eric

    Looks like these report were created off of a ttx file. What Crystal Reports SDK are you using to develop the app? If you are using the RDC, this has not been tested in .NET and as such is not supported. If you are using teh CR assemblies for .NET, pass a dataset to the report. The dataset must match the structure as defined in the ttx. The report will then use the crdb_adoplus.dlll and you the fielddef dll will not come into play at all.

  • I need to host a website with a SQL database - Azure pricing details are too confusing

    Hello,
    I need to give a potential client a hosting price for a somewhat simple web application they want me to build. I told them it shouldn't be a problem. After gathering the requirements, I figured I would use the following technology to build and host
    it:
    ASP.NET 4.5
    MVC 5
    1 SQL Database ~ 25GB with options to expand and also with a backup
    SSL certificate needed
    Hosting would be on Azure because I have some experience using Visual Studio 2012 and integrating the Visual Studio Online (TFS) source code and scrum web applications. I've never actually spun up a website with a SQL database using Azure before, but I
    imagined it wasn't too difficult to find a general hosting plan to support the above requirements.
    The use of the website will be very simple and limited to the basic CRUD operations. Will support forms authentication using the Identity 2.0 framework. The web applications main purpose is to fill out a form for new accounts, have a search page for
    those accounts, a page to view a created account and add notes to it. So performance wise, it isn't asking for much. I just want it to be fast and secure.
    So I start looking on the Azure's pricing landing page which is here: (can't put links in here, but search Azure pricing on Bing) and I see this Pricing Calculator, so I click it
    First thing I notice is the Websites tab doesn't mention SQL Database - in fact the Data Management is a separate tab from Websites. And if I made my selections on the Websites tab, the estimated monthly price doesn't stay the same when I go to the Data
    Management tab - so I get the illusion I have to have two separate purchases.
    I'm not exactly sure if the Pay as You Go billing feature would be okay because it's just a bit scary to leave every monthly payment up to chance; somewhat. Would love to know if there is other payment options that I could see for what I described above.
    I want to use Azure to host my asp.net website - it makes sense and the integration with Visual Studio is amazing. I love the publish feature for both MVC 5 Projects and SQL Database Projects.
    Thanks in advance for the help!

    Hello jdevanderson,
    I suggest that you start by looking at the pricing TIERS for the Azure website. This link will give you clarity on different Service TIERS that are availaible:
    http://azure.microsoft.com/en-in/pricing/details/websites/
    You can guage your requirement and choose the Service TIER accordingly.
    And regarding the database, you are right about it. You will be charged seperately for the database. You can refer to this link that will give you clarity on SQL database pricing:
    http://azure.microsoft.com/en-in/pricing/details/sql-database/
    Refer to this link for more information on 'How pricing works':
    http://azure.microsoft.com/en-in/pricing/
    Use the full calculator to add your website and the database to get an estimated cost:
    http://azure.microsoft.com/en-in/pricing/calculator/?scenario=full
    Thanks,
    Syed Irfan Hussain

  • Send the OHD database table load details as mail in Process chain

    Hi,
    We have a requirement that after the data is loaded into Open Hub destination we need to send an email to a list of users.
    The mail should contain the Open hub destination name, Calday, Request No, No of records and the message that the load has ended successfully.
    I know how to send an email in the process chain but how to send the details like Open hub destination name, Calday, Request No, No of records in the mail.
    Please suggest.

    Well we got a little idea:
    We have narrowed the req down to the following logic:
    select REQUID,No of records transferre, and the OHD name from RSBKREQUEST table
    where rsbkrequest-requid  = open hub table request
    Also the open hub table should be first sorted in descending order by request ID
    Now the main issue is:
    How to implement this logic and get the details from RSBKREQUEST table and send these details in the mail body.
    This we want to do in the message which is attached to the Open hub DTP load step of the PC. The message will go if the Open hub load is successful.
    In the message we are able to enter the receipient email address but how to add the above mentioned details.
    Actually we are trying to avoid the ABAP code step.
    Please suggest.
    Edited by: Debanshu Mukherjee on Dec 10, 2010 7:45 PM
    Edited by: Debanshu Mukherjee on Dec 10, 2010 7:46 PM

  • How would I unit test database logic?

    I am still having a issue getting over a small issue when it comes to TDD.
    I need a method that will get a certain record set of filtered data from the data layer (linq2SQL). Please note that i am using the linq generated classes from that are generated from the DBML. Now the problem is that i want to write a test for this.
    do i:
    a) first insert the records in the test and then execute the method and test the results
    b) use data that might be in the database. Not to keen on this logic cause it could cause things to break.
    c) what ever you suggest?

    Variation on (a).
    Have a test db or subsection of the db that can be used for testing. When you are setting up your tests, have a routine that initializes the DB as you need it to begin testing (this can be done before each test, as appropriate). This may include deleting data,
    inserting data, etc. Then run your tests. In the Teardown phase, clean up after yourself. Can be repeated as much as is needed, without risk of disrupting live system (not a good idea to test using data in the database that is needed for anything else).
    Really, all one has to do is use System.Transactions and Rollback the transactions at the end of each tests. That's what I have seen done in integration testing, which UT does not apply in testing DB transactions.

  • Master database logical file names are different - Please Help!

    Today I noticed that one of the server in our environment,
    when i run 
    SELECT * 
    FROM sys.database_files
    i got results 
    data_space_id name
    1 master2
    0 master_Log2
    Please note logical name of the master database files.
    But, in SSMS if i right click and choose properties for master database, it shows logical file names are master, mastlog.
    How can this be happened? How can i fix this issue and make it both same names for master database?
    Please help!

    Today I noticed that one of the server in our environment,
    when i run 
    SELECT * 
    FROM sys.database_files
    i got results 
    data_space_id name
    1 master2
    0 master_Log2
    Please note logical name of the master database files.
    But, in SSMS if i right click and choose properties for master database, it shows logical file names are master, mastlog.
    How can this be happened? How can i fix this issue and make it both same names for master database?
    Please help!
    Its nothing to worry about may be master was restored from backup which had logical file name as master2
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • Your experience about Standby Database (Logical).

    Hi,
    As expressed in the subject of the thread, I'd like to get some feedback about Logical Standby.
    One of the databases (A) here has a setup with a Physical Standby (B). In order to lighten the workload on A, i want to "upgrade" B to a Logical Standby. The procedure is already defined, tested and functionnal. But as I never managed a Logical Standby, it would be great if you could share your experience about:
    1/ A's workload: Will there be a big overhead due to log treatments (and supplemental log data)?
    2/ LAS: Will it take longer to apply an archived redo log to Logical B than it takes on the Physical B?
    3/ I can't set the hardware on B's host to the same level as it's on A's host.
    A has (6cpu, 20GiB RAM, half for SGA)
    Physical B has (2cp, 9GiB RAM, 5GiB for SGA)
    Logical B will have (3cpu, 12GiB RAM, xxxGiB SGA)
    The load on B will be very very less than it is on A. Knowing A perfs is O.K., will B perf on reporting be O.K.?
    4/ my target for backup is now B. When the "upgrade" will be finished, would you advise to continue the backup on the Logical Standby, or to switch to a backup via (RMAN/HotBackup/...) ?
    5/ Any other advice you could give :-)
    Thanks,
    Yoann.

    Hi Yoann,
    Some time ago I created a logical database for Oracle 9.2.0.4 db on RH Linux then on 9.2.0.6 ver (same OS). It was very tempting to decrease loading on primary database through using logical standby, but It was not moved to production. I stuck with some problems when transactions stopped because of some inconsistency (I used transaction consistency set to NONE because of performance) and there were a couple of them between a hundred of tables. After that I tried to create a database link upon the primary database, but it was not apt to use with the same procedures to execute.
    Regarding questions:
    1. I did not find the big overhead, but a lot of additional actions should be done due to maintenance tables w/o PK on LGSTBY
    2. Difficult to say ...
    3. I had LGSTBY half of power of primary
    4. I will not you advise to backup LGSTBY because of some possible problems with transactions, maintenance etc. better to use RMAN on primary or physical standby
    5. Try to test 10g logical standby (I have read that there is no need to freeze the primary database during logical standby creation)
    Hope this helps,
    Andrey

  • Reg database logical locks

    hii all,
         I want to keep locks(logically) to the existing database records as my ztables(3 tables with 1 parent table,containing header data and 2 line item tables having the foreign key relationships with header table) are accessed at time by many users(different users might try to change the same record).what is the best way to go ahead.
    with regards,
    sandeep akella.

    Hi,
    check the following link
    http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/content.htm
    Regards,
    Madhu

  • Database tables holding details for a non - released transport request

    Dear All,
    We are implementing SAP ECC 6.0 u2013 ABAP stack, on IBM iSeries / System i, i5/OS V5R4 -
    SAP kernel release 7.00, kernel patch number 173
    Could someone please guide me to the database tables holding the details for a non u2013 released transport request.
    The problem is the following :
    We encountered some data corruption in the database of our development system, so we did a restore from the previous day's backup (RSTLIB  command) for the database library : R3DEVDATA, without restoring the /usr/sap/trans  directory, then we did an APYJRNCHG command for the journal receiver spanning from the previous day's backup until the corruption time (remote journal on a remote system.)
    We are now facing the following conflict :
    One of our programmers is now un-capable of updating an ABAP program, which he previously added in a transport request, which he did not release.
    ( This was done during the day of the data corruption)
    When the programmer is trying to update the ABAP program through the ABAP workbench, he receives the error :
    'Request lock on non u2013 existent task / request DEVK921426'
    No details for the transport request DEVK921426 exist in either of the two directories :
    /usr/sap/trans/data   , /usr/sap/trans/cofiles
    The way I see to solve this conflict (eliminate this lock) is to delete the different entries related to the un-released transport request from the database tables.
    Any clues would be highly appreciated.
    Thank you in advance for your cooperation.
    Best regards.
    Reda Khalifa

    Dear Volker,
    Thank you very much for your interest.
    The transport request of interest did not appear in transaction code SE03
    Eliminating the record from table TLOCK indeed did solve the problem.
    Thank you again.
    Best regards.
    Reda Khalifa

  • MS SQL Server Database software license details

    Hi,
    I have three queries regarding buying license from sap for MS SQL server software which will be used for SAP Businees suite application.
    If we buy database license directly from Microsoft,
    1. Will there be any issue in getting support from sap for database related issues during installation and post go live ?
    2. Do we have access to download the database software CD provided by SAP or do we have to get it from Microsoft ?
    3. Is there any difference in the database software provided by Microsoft and by SAP?
    Please update me as soon as possible.
    Regards,
    Nalla

    > 1. Will there be any issue in getting support from sap for database related issues during installation and post go live ?
    No.
    > 2. Do we have access to download the database software CD provided by SAP or do we have to get it from Microsoft ?
    If you license from Microsoft you will need to get the media from Microsoft.
    > 3. Is there any difference in the database software provided by Microsoft and by SAP?
    No difference but SAP provides a script (sql4sap.vbs) that does necessary setups automatically and installs all patches automatically. You will need to do that then manually.
    Markus

  • [IDOC]  Segment Details

    Hello,
              Can any one help me out .. where [which table ] we can get the Segment related data in R/3.
    Thank you in advance...

    Hi
    Segment definitions are in tables:
      EDISEG
      EDISEGMENT
      EDISEGt
    Segment data of IDOCs is stored in table
    EDID4.
    <b>reward if Helpful.</b>

Maybe you are looking for

  • Prob in configuring Course Catalog

    Dear we have a problem... we are setting up  a new server, I have setup up Academic Institute, Subject, Organization, Group, Location and every thing. But when we are going to create Course Catalog in Curriculum Mgmt, Its "Offering" page is not showi

  • Plan cost is not appearing in claim

    Hi All, after creating one extra WBS and creating claim against that of Rs1000 , i am not able to see the plan cost of that particular amount against that WBS in s_alr_87013542 report. Can u suggest ny soln for that.

  • Reports with prompting stop working when moved from Crystal10 to crystal 11

    Issue: We are having trouble with Crystal Reports XI. It appears that the Crystal 10 runtime included the ability to process reports that used prompting. If we run the same report with the Crystal XI runtime, it fails. I can send a sample of the repo

  • Invalid volume file count/volume directory count - how to fix?

    a run of the disk utility app gave this message: when I attempt to load my Leopard Install Disk 1, all I get is a hardware check. What else can I try?

  • Adding Searx as default engine doesn't work

    Hi Running Firefox 33.0 on Android 4.4.4, and tried to use http://searx.laquadrature.net/ as default search engine. Unfortunately, when I enter terms to be searched in the awesome bar, it always leads to the search home page of searx, but no term are