How to  Find Logical Database with table name

Shankar

Version 4.6x
If you need to find the logical database for a table name, you can used <b>SE36</b> - Logical Database Bulider.
Steps :-
Go to transaction <b>SE36</b>
Click <b>Extras -> Table usage</b>
Supply the Table name and hit enter.
A Display Logical Database will be shown on a pop-up windows.
Reward  points  if it is  usefull ....
Girish

Similar Messages

  • How to find Logical database name using selection view

    Hi Experts,
                      How can we find logical database name using selection view in se36.
    Regards,
    Mani

    Hi,
    If you want to see the logincal database used in the report ( tcode se38) in the intial screen select the attribute tab
    and click display you will bw able to see the logical datbase ysed for the report.
    Thanks.

  • How to create logical directories with same name on two databases

    Hi,
    OS: Windows
    Oracle Version : 10g
    I have to databases in one oracle home. I have created some logical directories in one database. When I am trying to create logical directories with same name in another database, it is overwriting the first database directory paths with the second one
    Can't we create directories with same name but different path in two databases on one machine?
    Pls suggest me on this
    Regards,
    Vijay

    I am trying to create logical directory using CREATE
    DIRECTORY statement. I am very much aware that the
    create directory statement doesn't create directory
    on OS. But we can attach the physical directory on OS
    to logical directory in oracle
    My requirement is to create logical directories in
    oracle mapping the OS directories. Both the
    databases, wil have same logical directory names but
    different OS directory mappingsIf I understand you correctly, you can do this:
    On DB 1
    CREATE OR REPLACE DIRECTORY same_dir_name as 'C:\myoracle\mydir1';
    On DB 2
    CREATE OR REPLACE DIRECTORY same_dir_name as 'D:\myoracle\mydir2';
    What stops you from doing that ?
    Note: If what you have is one database but different connections, then you are connecting to one database. The above second statement will drop and replace with the first one

  • How-To Find the R/3 Table Name for a BW Data Source

    Hi there,
      Please advice how can I find the respective table name in R/3 for a particular BW DataSource ?
      P/S : I would like a technical how-to instead of referring the table names at HELP.SAP.COM
      For instance, for my Standard Business Content Info Cube 0CCA_C03(CO-OM-CCA: Statistical Key Figures) which extracts from BW Data Source: 0CO_OM_CCA_4
      My question is, how can I find out which specific tables in SAP R/3 is this Data Source pulling the data from ?

    Hi Dinesh,
       Data Source: 0CO_OM_CCA_4
       1) In my R/3, I ran SE16 : Table -> ROOSOURCE
       2) OLTPSOURCE -> 0CO_OM_CCA_4
       3) EXMETHOD = F1
         (Hence, I assume the Extraction Method is a Function Module)
       4) So, Function Module = BWOM_RS_GET_CTRSTA
       5) Run SE37 in R/3
          How do I find out the specific tables in this Function Module ?
          Would you please list them for me, so I can further refer to the individual tables ?

  • Given a business object type, how to find out the underlying table name ?

    Hi,
    Given a business object type (e.g. BUSxxx), is there any Function Module that can be used to get the table name for that object ?
    Have been through the SWO* FM's but did not get anything yet.
    Pls let me know how this can be done.
    Regards,
    -Kev.

    >
    Kelevenwise wrote:
    > Thanks Christine for the response..
    > Let me add a few more details to clarify my requirement
    >
    > I need to read the data of business objects (not a specific one, but the application should be able to read data of any business object). Given a table name, I am able to figure out the column information and read that data. But all I have is the business object type, so would need to figure out all the tables (as you helpfully pointed out, there could be more than 1 for a business object) and then read from those tables.
    >
    > The reason I feel I cannot use the business objects methods directly is because I would not know which method to call to get me the relevant data - this is an external application, not called from within the system.
    >
    > Is there another way to achieve this requirement ?
    >
    > Regards,
    > - Kev.
    So, assuming for the moment we are just dealing with the PO BUS2012 business object, your external application will be passing you a BO type and also (presumably- otherwise you could be sending back an awful lot of data) a BO key,  and you then want to send back all the detail for PO - exactly what the GetDetail method that is present on most objects does - is that right?
    Since most BOs have a GetDetail method, can't you just use that? 
    Though I really can't see why your external application would be interested in all SAP BOs - most applications are a bit more specific than that.

  • How to find and replace the table name/column name

    We have just upgraded the application to R12. Have many reports developed in Oracle Reports Builder. There are many changes in R12 table and column names when compare with 11i. Please suggest a solution to change the table name or column name in multiple reports queries instead of doing manually.

    A Google search may turn up a downloadable service manual for the Laserjet 4600.
    You might also ask in the HP Enterprise Business Community Forum here.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • How to write a function with table name as parameter

    I created a function like this:
    create or replace function "GETNAME"
    (did in NUMBER, dtable in VARCHAR2)
    return VARCHAR2
    is
    dname varchar2(200);
    begin
    select lastname || ' ' || firstname
    into dname from dtable
    where id = did;
    return dname;
    end;
    i got an error: table or view does not exist.
    Could somebody tell me how to fix it?
    Thanks,
    Jen

    or by using a reference cursor:  create or replace function dynamic_cursor (pTab varchar2)
        return sys_refcursor as
        c sys_refcursor;
      begin
        open c for 'select * from '|| pTab;
        return c;
      end;
    SQL> exec :c := dnamic_cursor('emp');
    SQL> exec :c := dynamic_cursor('emp');
    PL/SQL procedure successfully completed.
    SQL> print c;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7566 JONES      MANAGER         7839 02-APR-81       2975       1000         20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7788 SCOTT      ANALYST         7566 09-DEC-82       3000                    20
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 12-JAN-83       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
          7945 CINDY      SALESMAN        7698 16-JAN-83       1800                    30
          7950 TINA       SALESMAN        7698 18-JAN-83       1850                    30
    16 rows selected.
    SQL>

  • Tried opening a file in library and it states can't open database with library name? It says Relaunch then will not open? and Blocks me completely from Aperture. I have to go to Finder to Rename it? I need this file how do I get it to open?

    Tried opening a file in library and it states can't open database with library name? It says Relaunch then will not open? and Blocks me completely from Aperture. I have to go to Finder to Rename it? I need this file how do I get it to open?

    Aftershotz,
    You're going to have to give a bit more information.
    What do you mean by "opening a file in library?"  There is no function of Aperture to open files -- you can open (switch) libraries.
    You'll have to be more specific about error messages, too.  Perhaps some screenshots would be useful to diagnose your problem.  "Can't open database with library name" is not enough detail about what Aperture is really telling you.
    nathan

  • How to find the database table behind the xtags  varibles?

    if in xtags we find that some varibles are not having the right data coming from xml -> database tables so how can we find out the names of database table behind it .
    <!-- <xtags:variable id="msds" context="<%=specs%>" select="//header/msds"/>
    <a href="/MSDS/<%=msds%> target="#">MSDS</a>
    -->
    now how to find the database table and the column name of database table from which the value of id msds is coming
    Here they have stored the name of pdf file . from this code pdf file is displayed

    Hi,
    Thanks for your response. It is PM related.  When I run a T Code - IK18,  the field Total Counter Reading field appears. I am looking for that particular fields actual table name and field name.  I think I have found it in IMGR table. Now I want to get IMRG-READG in my report, but there is no common fields in neither MKPF or MSEG table. So what can I do to connect IMRG table with either of them ?

  • How to find a routine with it's technical name

    Hello!
    I am wondering how to find a routine with it's technical name (e.g. "ROUT 7QAXE7SDXIVW4BJ2S2UL3HLAS" as shown in the error message in a transport log).
    So I would like to find out, where this routine is located (w.g. which characteristic/key figure in which transfer/update rule).
    Any ideas welcome. Thanks, Thomas

    Hi Thomas,
    You can try the following:
    Look up table <b>RSUPDROUT</b>with the GUID of your routine (like 7QAXE7SDXIVW4BJ2S2UL3HLAS)in the ABAP Code ID field selection. This will show you the InfoObject it is created on, and the GUID of the update rules. If you click on the Check Table button, you can find out the data target and InfoSource of the Update Rule.
    In table <b>RSAROUTT</b>you can again use the GUID of your routine to check the description assigned to the routine during its creation.
    I am not sure if this works for the routines of transfer rules....still checking it and will update if anything turns up.
    Hope this helps...

  • How to keep same database with two different names in SharePoint 2013 for two different applications

    Hi All,
    I have very strange situation.
    I had SP2010 production database(wss_content_contoso) migrated to SP13 few months back to migrate one site collection only while I have 15 site collections stored in this database and created a site contoso.com
    Now, I want to migrate same(wss_content_contoso) SP2010 database to SP13 and want to create contoso2.com.
    I changed database name from wss_content_contoso to wss_content_contoso2 and assigned newID during mount process.
    After this exercise, I don't see any site for contoso2.com and issue seems to be the same database. 
    My question is!!!!
    How I can keep both databases(actually same database with different names) and run both application simultaneously?
    Any help appreciated!!
    Thank you,
    AM
    AM Senior SharePoint Consultant

    You need to run Backup-SPSite/Restore-SPSite on each Site Collection you want to 'duplicate'. You cannot restore the same Content Database to the same farm as the Site Collections have the same GUID, which is stored globally for the farm.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Why and how we use Logical Database?

    Can anybody explain with example why and how we use logical database?
    Regards,
    Rajan

    Hello,
    SAP comes loaded with all the extras. Among the extras that are most helpful to IT managers are all the access routines needed to pull any business object that managers can think of out of SAP databases. However, SAP has not thought of everything where your particular applications are concerned. SAP organizes its standard database tables to service business units based on conventional business applications. Itu2019s likely your business requires something new, perhaps even something exotic. In that case, you will need to create a new database, using information from different places. Basically, you need a logical database. You need to create a virtual business data object repository consisting of a new kind of record or table that suits your purposes. In addition, the repository should be composed of information that is actually stored in a number of different locations, none of them necessarily logically associated with one another. Letu2019s take a closer look at creating logical databases.
    A case for a logical database
    Suppose my company manufactures widgets of the most obscure variety, and they are components of other widgets. I sell my widgets as raw material for the more sophisticated widgets built by others, but in some cases I actually partner with other manufacturers in creating yet another class of widget. Now, in my world, I consequently have customers who are also partners. I sell to them and I partner with them in manufacturing and distribution. Also, I need an application that uses both of these dual-use relationships.
    Essentially, I have a customer database and a partner database. Neither contains records that are structured to contain the identifying particulars of the other. Thus, I need a hybrid database that gives me tables detailing these hybrid relationships. What can I do? I can go the long way around and write a new database, pulling information from both and creating new objects with a customized program that I write by hand. However, this process is cumbersome and contains maintenance issues. On the other hand, I can use SAPu2019s logical database facility, create my logical database in a couple of minutes, and have no maintenance issues at all.
    Logical database structures
    There are three defining entities in an SAP logical database. You must be clear on all three in order to create and use one.
    u2022     Table structure: Your logical database includes data from specified tables in SAP. There is a hierarchy among these tables defined by their foreign keys (all known to SAP), and you are going to define a customized relationship between select tables. This structure is unique and must be defined and saved.
    u2022     Data selection: You may not want or need every item in the referenced tables that contributes to your customized database. There is a selection screen that permits you to pick and choose.
    u2022     Database access programming: Once youu2019ve defined your logical database, SAP will generate the access subroutines needed to pull the data in the way you want it pulled.
    Creating your own logical database
    ABAP/4 (Advanced Business Application Programming language, version 4) is the language created by SAP for implementation and customization of its R/3 system. ABAP/4 comes loaded with many predefined logical databases that can construct and table just about any conventional business objects you might need in any canned SAP application. However, you can also create your own logical databases to construct any custom objects you care to define, as your application requires in ABAP/4. Hereu2019s a step-by-step guide:
    1.     Call up transaction SLDB (or transaction SE36). The path you want is Tools | ABAP Workbench | Development | Programming Environment | Logical Databases. This screen is called Logical Database Builder.
    2.     Enter an appropriate name in the logical database name field. You have three options on this screen: Create, Display, and Change. Choose Create.
    3.     Youu2019ll be prompted for a short text description of your new logical database. Enter one. Youu2019ll then be prompted to specify a development class.
    4.     Now comes the fun part! You must specify a root node, or a parent table, as the basis of your logical database structure. You can now place subsequent tables under the root table as needed to assemble the data object you want. You can access this tree from this point forward, to add additional tables, by selecting that root node and following the path Edit | Node | Create. Once youu2019ve saved the structure you define in this step, the system will generate the programming necessary to access your logical database. The best part is you donu2019t have to write a single line of code.
    Regards
    Arindam

  • How to find the database growth rate?

    Wanted to do the forecasting of disk growth for one year. How to find the database growth rate?
    Rahul

    This is code authored by Richard Ding that will log database sizes to a table.  If you run it every day, then you can go back and compare the database size differences day to day... week to week... month to month... and year over year.  That is
    how I forecast growth over time.
    Note:  There is a database name required that is local to your environment, so change [YOURDATABASENAME] to whatever local database you wish to use.  I will also post the DDL to create the target table.  Create that table in the database you
    name in the stored procedure code and all should run fine.
    USE [master]
    GO
    /****** Object: StoredProcedure [dbo].[sp_SDS] Script Date: 04/22/2015 09:32:53 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[sp_SDS]
    @TargetDatabase sysname = NULL, -- NULL: all dbs
    @Level varchar(10) = 'Database', -- or "File"
    @UpdateUsage bit = 0, -- default no update
    @Unit char(2) = 'MB' -- Megabytes, Kilobytes or Gigabytes
    AS
    ** author: Richard Ding
    ** date: 4/8/2008
    ** usage: list db size AND path w/o SUMmary
    ** test code: sp_SDS -- default behavior
    ** sp_SDS 'maAster'
    ** sp_SDS NULL, NULL, 0
    ** sp_SDS NULL, 'file', 1, 'GB'
    ** sp_SDS 'Test_snapshot', 'Database', 1
    ** sp_SDS 'Test', 'File', 0, 'kb'
    ** sp_SDS 'pfaids', 'Database', 0, 'gb'
    ** sp_SDS 'tempdb', NULL, 1, 'kb'
    SET NOCOUNT ON;
    IF @TargetDatabase IS NOT NULL AND DB_ID(@TargetDatabase) IS NULL
    BEGIN
    RAISERROR(15010, -1, -1, @TargetDatabase);
    RETURN (-1)
    END
    IF OBJECT_ID('tempdb.dbo.##Tbl_CombinedInfo', 'U') IS NOT NULL
    DROP TABLE dbo.##Tbl_CombinedInfo;
    IF OBJECT_ID('tempdb.dbo.##Tbl_DbFileStats', 'U') IS NOT NULL
    DROP TABLE dbo.##Tbl_DbFileStats;
    IF OBJECT_ID('tempdb.dbo.##Tbl_ValidDbs', 'U') IS NOT NULL
    DROP TABLE dbo.##Tbl_ValidDbs;
    IF OBJECT_ID('tempdb.dbo.##Tbl_Logs', 'U') IS NOT NULL
    DROP TABLE dbo.##Tbl_Logs;
    CREATE TABLE dbo.##Tbl_CombinedInfo (
    DatabaseName sysname NULL,
    [type] VARCHAR(10) NULL,
    LogicalName sysname NULL,
    T dec(10, 2) NULL,
    U dec(10, 2) NULL,
    [U(%)] dec(5, 2) NULL,
    F dec(10, 2) NULL,
    [F(%)] dec(5, 2) NULL,
    PhysicalName sysname NULL );
    CREATE TABLE dbo.##Tbl_DbFileStats (
    Id int identity,
    DatabaseName sysname NULL,
    FileId int NULL,
    FileGroup int NULL,
    TotalExtents bigint NULL,
    UsedExtents bigint NULL,
    Name sysname NULL,
    FileName varchar(255) NULL );
    CREATE TABLE dbo.##Tbl_ValidDbs (
    Id int identity,
    Dbname sysname NULL );
    CREATE TABLE dbo.##Tbl_Logs (
    DatabaseName sysname NULL,
    LogSize dec (10, 2) NULL,
    LogSpaceUsedPercent dec (5, 2) NULL,
    Status int NULL );
    DECLARE @Ver varchar(10),
    @DatabaseName sysname,
    @Ident_last int,
    @String varchar(2000),
    @BaseString varchar(2000);
    SELECT @DatabaseName = '',
    @Ident_last = 0,
    @String = '',
    @Ver = CASE WHEN @@VERSION LIKE '%9.0%' THEN 'SQL 2005'
    WHEN @@VERSION LIKE '%8.0%' THEN 'SQL 2000'
    WHEN @@VERSION LIKE '%10.0%' THEN 'SQL 2008'
    WHEN @@VERSION LIKE '%11.0%' THEN 'SQL 2012'
    WHEN @@VERSION LIKE '%12.0%' THEN 'SQL 2014'
    END;
    SELECT @BaseString =
    ' SELECT DB_NAME(), ' +
    CASE WHEN @Ver = 'SQL 2000' THEN 'CASE WHEN status & 0x40 = 0x40 THEN ''Log'' ELSE ''Data'' END'
    ELSE ' CASE type WHEN 0 THEN ''Data'' WHEN 1 THEN ''Log'' WHEN 4 THEN ''Full-text'' ELSE ''reserved'' END' END +
    ', name, ' +
    CASE WHEN @Ver = 'SQL 2000' THEN 'filename' ELSE 'physical_name' END +
    ', size*8.0/1024.0 FROM ' +
    CASE WHEN @Ver = 'SQL 2000' THEN 'sysfiles' ELSE 'sys.database_files' END +
    ' WHERE '
    + CASE WHEN @Ver = 'SQL 2000' THEN ' HAS_DBACCESS(DB_NAME()) = 1' ELSE 'state_desc = ''ONLINE''' END + '';
    SELECT @String = 'INSERT INTO dbo.##Tbl_ValidDbs SELECT name FROM ' +
    CASE WHEN @Ver = 'SQL 2000' THEN 'master.dbo.sysdatabases'
    WHEN @Ver IN ('SQL 2005', 'SQL 2008', 'SQL 2012', 'SQL 2014') THEN 'master.sys.databases'
    END + ' WHERE HAS_DBACCESS(name) = 1 ORDER BY name ASC';
    EXEC (@String);
    INSERT INTO dbo.##Tbl_Logs EXEC ('DBCC SQLPERF (LOGSPACE) WITH NO_INFOMSGS');
    -- For data part
    IF @TargetDatabase IS NOT NULL
    BEGIN
    SELECT @DatabaseName = @TargetDatabase;
    IF @UpdateUsage <> 0 AND DATABASEPROPERTYEX (@DatabaseName,'Status') = 'ONLINE'
    AND DATABASEPROPERTYEX (@DatabaseName, 'Updateability') <> 'READ_ONLY'
    BEGIN
    SELECT @String = 'USE [' + @DatabaseName + '] DBCC UPDATEUSAGE (0)';
    PRINT '*** ' + @String + ' *** ';
    EXEC (@String);
    PRINT '';
    END
    SELECT @String = 'INSERT INTO dbo.##Tbl_CombinedInfo (DatabaseName, type, LogicalName, PhysicalName, T) ' + @BaseString;
    INSERT INTO dbo.##Tbl_DbFileStats (FileId, FileGroup, TotalExtents, UsedExtents, Name, FileName)
    EXEC ('USE [' + @DatabaseName + '] DBCC SHOWFILESTATS WITH NO_INFOMSGS');
    EXEC ('USE [' + @DatabaseName + '] ' + @String);
    UPDATE dbo.##Tbl_DbFileStats SET DatabaseName = @DatabaseName;
    END
    ELSE
    BEGIN
    WHILE 1 = 1
    BEGIN
    SELECT TOP 1 @DatabaseName = Dbname FROM dbo.##Tbl_ValidDbs WHERE Dbname > @DatabaseName ORDER BY Dbname ASC;
    IF @@ROWCOUNT = 0
    BREAK;
    IF @UpdateUsage <> 0 AND DATABASEPROPERTYEX (@DatabaseName, 'Status') = 'ONLINE'
    AND DATABASEPROPERTYEX (@DatabaseName, 'Updateability') <> 'READ_ONLY'
    BEGIN
    SELECT @String = 'DBCC UPDATEUSAGE (''' + @DatabaseName + ''') ';
    PRINT '*** ' + @String + '*** ';
    EXEC (@String);
    PRINT '';
    END
    SELECT @Ident_last = ISNULL(MAX(Id), 0) FROM dbo.##Tbl_DbFileStats;
    SELECT @String = 'INSERT INTO dbo.##Tbl_CombinedInfo (DatabaseName, type, LogicalName, PhysicalName, T) ' + @BaseString;
    EXEC ('USE [' + @DatabaseName + '] ' + @String);
    INSERT INTO dbo.##Tbl_DbFileStats (FileId, FileGroup, TotalExtents, UsedExtents, Name, FileName)
    EXEC ('USE [' + @DatabaseName + '] DBCC SHOWFILESTATS WITH NO_INFOMSGS');
    UPDATE dbo.##Tbl_DbFileStats SET DatabaseName = @DatabaseName WHERE Id BETWEEN @Ident_last + 1 AND @@IDENTITY;
    END
    END
    -- set used size for data files, do not change total obtained from sys.database_files as it has for log files
    UPDATE dbo.##Tbl_CombinedInfo
    SET U = s.UsedExtents*8*8/1024.0
    FROM dbo.##Tbl_CombinedInfo t JOIN dbo.##Tbl_DbFileStats s
    ON t.LogicalName = s.Name AND s.DatabaseName = t.DatabaseName;
    -- set used size and % values for log files:
    UPDATE dbo.##Tbl_CombinedInfo
    SET [U(%)] = LogSpaceUsedPercent,
    U = T * LogSpaceUsedPercent/100.0
    FROM dbo.##Tbl_CombinedInfo t JOIN dbo.##Tbl_Logs l
    ON l.DatabaseName = t.DatabaseName
    WHERE t.type = 'Log';
    UPDATE dbo.##Tbl_CombinedInfo SET F = T - U, [U(%)] = U*100.0/T;
    UPDATE dbo.##Tbl_CombinedInfo SET [F(%)] = F*100.0/T;
    IF UPPER(ISNULL(@Level, 'DATABASE')) = 'FILE'
    BEGIN
    IF @Unit = 'KB'
    UPDATE dbo.##Tbl_CombinedInfo
    SET T = T * 1024, U = U * 1024, F = F * 1024;
    IF @Unit = 'GB'
    UPDATE dbo.##Tbl_CombinedInfo
    SET T = T / 1024, U = U / 1024, F = F / 1024;
    SELECT DatabaseName AS 'Database',
    type AS 'Type',
    LogicalName,
    T AS 'Total',
    U AS 'Used',
    [U(%)] AS 'Used (%)',
    F AS 'Free',
    [F(%)] AS 'Free (%)',
    PhysicalName
    FROM dbo.##Tbl_CombinedInfo
    WHERE DatabaseName LIKE ISNULL(@TargetDatabase, '%')
    ORDER BY DatabaseName ASC, type ASC;
    SELECT CASE WHEN @Unit = 'GB' THEN 'GB' WHEN @Unit = 'KB' THEN 'KB' ELSE 'MB' END AS 'SUM',
    SUM (T) AS 'TOTAL', SUM (U) AS 'USED', SUM (F) AS 'FREE' FROM dbo.##Tbl_CombinedInfo;
    END
    IF UPPER(ISNULL(@Level, 'DATABASE')) = 'DATABASE'
    BEGIN
    DECLARE @Tbl_Final TABLE (
    DatabaseName sysname NULL,
    TOTAL dec (10, 2),
    [=] char(1),
    used dec (10, 2),
    [used (%)] dec (5, 2),
    [+] char(1),
    free dec (10, 2),
    [free (%)] dec (5, 2),
    [==] char(2),
    Data dec (10, 2),
    Data_Used dec (10, 2),
    [Data_Used (%)] dec (5, 2),
    Data_Free dec (10, 2),
    [Data_Free (%)] dec (5, 2),
    [++] char(2),
    Log dec (10, 2),
    Log_Used dec (10, 2),
    [Log_Used (%)] dec (5, 2),
    Log_Free dec (10, 2),
    [Log_Free (%)] dec (5, 2) );
    INSERT INTO @Tbl_Final
    SELECT x.DatabaseName,
    x.Data + y.Log AS 'TOTAL',
    '=' AS '=',
    x.Data_Used + y.Log_Used AS 'U',
    (x.Data_Used + y.Log_Used)*100.0 / (x.Data + y.Log) AS 'U(%)',
    '+' AS '+',
    x.Data_Free + y.Log_Free AS 'F',
    (x.Data_Free + y.Log_Free)*100.0 / (x.Data + y.Log) AS 'F(%)',
    '==' AS '==',
    x.Data,
    x.Data_Used,
    x.Data_Used*100/x.Data AS 'D_U(%)',
    x.Data_Free,
    x.Data_Free*100/x.Data AS 'D_F(%)',
    '++' AS '++',
    y.Log,
    y.Log_Used,
    y.Log_Used*100/y.Log AS 'L_U(%)',
    y.Log_Free,
    y.Log_Free*100/y.Log AS 'L_F(%)'
    FROM
    ( SELECT d.DatabaseName,
    SUM(d.T) AS 'Data',
    SUM(d.U) AS 'Data_Used',
    SUM(d.F) AS 'Data_Free'
    FROM dbo.##Tbl_CombinedInfo d WHERE d.type = 'Data' GROUP BY d.DatabaseName ) AS x
    JOIN
    ( SELECT l.DatabaseName,
    SUM(l.T) AS 'Log',
    SUM(l.U) AS 'Log_Used',
    SUM(l.F) AS 'Log_Free'
    FROM dbo.##Tbl_CombinedInfo l WHERE l.type = 'Log' GROUP BY l.DatabaseName ) AS y
    ON x.DatabaseName = y.DatabaseName;
    IF @Unit = 'KB'
    UPDATE @Tbl_Final SET TOTAL = TOTAL * 1024,
    used = used * 1024,
    free = free * 1024,
    Data = Data * 1024,
    Data_Used = Data_Used * 1024,
    Data_Free = Data_Free * 1024,
    Log = Log * 1024,
    Log_Used = Log_Used * 1024,
    Log_Free = Log_Free * 1024;
    IF @Unit = 'GB'
    UPDATE @Tbl_Final SET TOTAL = TOTAL / 1024,
    used = used / 1024,
    free = free / 1024,
    Data = Data / 1024,
    Data_Used = Data_Used / 1024,
    Data_Free = Data_Free / 1024,
    Log = Log / 1024,
    Log_Used = Log_Used / 1024,
    Log_Free = Log_Free / 1024;
    DECLARE @GrantTotal dec(11, 2);
    SELECT @GrantTotal = SUM(TOTAL) FROM @Tbl_Final;
    INSERT INTO [YOURDATABASENAME].[dbo].[DBSize]
    ([Weight]
    ,[DBName]
    ,[Used]
    ,[Free]
    ,[Total]
    ,[Data]
    ,[Data_Used]
    ,[Log]
    ,[Log_Used]
    ,[DT])
    SELECT
    CONVERT(dec(10, 2), TOTAL*100.0/@GrantTotal) AS 'WEIGHT (%)',
    DatabaseName AS 'DATABASE',
    CONVERT(VARCHAR(12), used) AS 'USED',
    CONVERT(VARCHAR(12), free) AS 'FREE',
    TOTAL,
    CONVERT(VARCHAR(12), Data) AS 'DATA',
    CONVERT(VARCHAR(12), Data_Used) AS 'DATA_USED',
    CONVERT(VARCHAR(12), Log) AS 'LOG',
    CONVERT(VARCHAR(12), Log_Used) AS 'LOG_USED',
    GETDATE()
    FROM @Tbl_Final
    WHERE DatabaseName LIKE ISNULL(@TargetDatabase, '%')
    ORDER BY DatabaseName ASC;
    IF @TargetDatabase IS NULL
    SELECT CASE WHEN @Unit = 'GB' THEN 'GB' WHEN @Unit = 'KB' THEN 'KB' ELSE 'MB' END AS 'SUM',
    SUM (used) AS 'USED',
    SUM (free) AS 'FREE',
    SUM (TOTAL) AS 'TOTAL',
    SUM (Data) AS 'DATA',
    SUM (Log) AS 'LOG'
    FROM @Tbl_Final;
    END
    RETURN (0)
    GO
    USE [YOURDATABASENAME]
    GO
    /****** Object: Table [dbo].[DBSize] Script Date: 04/22/2015 09:49:10 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    SET ANSI_PADDING ON
    GO
    CREATE TABLE [dbo].[DBSize](
    [UID] [int] IDENTITY(1,1) NOT NULL,
    [Weight] [decimal](18, 2) NULL,
    [DBName] [varchar](250) NULL,
    [Used] [decimal](18, 2) NULL,
    [Free] [decimal](18, 2) NULL,
    [Total] [decimal](18, 2) NULL,
    [Data] [decimal](18, 2) NULL,
    [Data_Used] [decimal](18, 2) NULL,
    [Log] [decimal](18, 2) NULL,
    [Log_Used] [decimal](18, 2) NULL,
    [DT] [datetime] NULL,
    CONSTRAINT [PK_DBSize] PRIMARY KEY CLUSTERED
    [UID] ASC
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    SET ANSI_PADDING OFF
    GO

  • I'm debutante in oracle 10g how to create a database with picture?

    I'm debutante in oracle 10g how to create a database with picture? help please

    d7401ec1-d4d6-4e54-9eb4-2181ac367d0c wrote:
    I'm debutante in oracle 10g how to create a database with picture? help please
    Oracle 10g is obsolete.  Oracle 11g is already at terminal release.
    Have you installed the Oracle rdbms software?
    Installing Oracle and Building the Database
    If you are going to be a professional DBA, you need to learn to
    1) read the documentation
    2) wean yourself from dependence on pictures and GUIs.
    3) read the documentation
    =================================================
    Learning how to look things up in the documentation is time well spent investing in your career.  To that end, you should drop everything else you are doing and do the following:
    Go to  docs.oracle.com.
    Locate the link for your Oracle product and version, and click on it.
    You are now at the entire documentation set for your selected Oracle product and version.
    BOOKMARK THAT LOCATION
    Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab (for 10.x) or the "Master Book List" link (for 11.x) you will find the complete documentation library.
    Spend a few minutes just getting familiar with what kind of documentation is available there by simply browsing the titles under the "Books" tab.
    Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what kind of information is available there.
    Do the same with the SQL Reference Manual.
    Do the same with the Utilities manual.
    You don't have to read the above in depth.  They are reference manuals.  Just get familiar with what is there to be referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.
    Then set yourself a plan to dig deeper.
    - *Read a chapter a day from the Concepts Manual*.
    - Take a look in your alert log.  One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.
    - Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.
    - *When you have finished reading the Concepts Manual, do it again*.
    Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
    =================================

  • Access data on multi-logical database with ad hoc query

    Dear all,
    I would like to know if it is possible to access data in multi-logical database with ad hoc query.
    I recall that I read some document stated that you can access data in multi-logical database with PNP as base.
    But I find no document about how to set it up, any comment?
    Regards
    Bill

    Hi Bill...
    PNP can be accessible..............
    PNP  0000-0999, 2000 to 2999 HR Master Data & Time 
    PCH.... I don't think so....
    Experts please do reply on this please...................
    Vijay
    Edited by: Vijay Shankar on Sep 13, 2011 11:32 AM

Maybe you are looking for

  • Captivate and Flash lite 2.1 for Mobile

    Hi, I need to visualize a SWF file in my Intermec CN3 HH, but when I try to do that, visualization isn't good, i've installed Adobe flash lite 2.1 and MFlashPlayer 7 to visualize my SWF, but doesn't work, do I still need another program?, or what can

  • Problem with CTX_DOC package and Ubuntu 12.04

    I have installed Oracle 11gR2 on Ubuntu 12.04 and also Oracle 12c on another Ubuntu 12.04. I know that this is not a supported distribution, but we have a case where it's necessary to have Ubuntu. Following some instructions, that we have read in som

  • Ppt transfers to keynote in ipad

    Hi: So I have alot of powerpoint presentations I want to put on my kynote application on my ipad, but when I try and transfer them thru the itunes link they come over to the ipad, and fail to be "translated" .. ugh .. I tried lots of different format

  • Strange Insert result in a ProC program

    In the following lines of codes, I tried to insert some records of a table into another. There is a cursor witch has an ORDER BY clause on the field N_RIB. The insert comes after some work. Just a example of what's going bad : Source Table N_RIB : 2,

  • Playhead limited info and auto scroll

    Anyone else having issues with the skimmer info? Creating a music video and it does not seem to show you how far in the song you are etc when you scrub along. Also, when playing clips in my timline, the playhead does not auto-move with the playing of