Query for database size

I need a query which should display the current size of database and the size of the database one month back. I have tried with OEM but if the database goes down in between, it won't display the result.(OS-HP-Unix, Linux, Ver-8i,9i,10g)

user10929871 wrote:
My friend,
I have a query to find out the size one month back (Note: It doesn't include temp and redo logs size)
select sum(bytes)/1073741824 from v$datafile where
creation_time<to_date('01-03-2009','dd-mm-yyyy');That assumes that the only way you are adding space to the database is to add new data files which doesn't seem realistic. It's rather common to increase the size of the database by adding space to an existing data file or allowing a data file to autoextend at least to a point. Are you certain that, for the databases you're working with, the only way that anyone ever adds space to a database is to add new data files?
and for view the current size
select sum(bytes)/1073741824 from v$datafile ;
I have tested and it worked hope I am right if this queries are wrong plz let me know, now what I am looking for is a query where I don't need to provide the specific date just something like add_months function to this query and I want the above two queries into one, something like this but its giving me the wrong result
select sum(a.bytes)/1024/1024/1024, sum(b.bytes)/1024/1024/1024 from v$datafile a,v$datafile b where a.creation_time<to_date('01-03-2009','dd-mm-yyyy') and b.creation_time<=sysdate
/If you're sure that the "prior month" query is correct for your environment
SELECT a.gb old_size, b.gb new_size
  FROM (SELECT sum(bytes)/1073741824
          FROM v$datafile
         WHERE creation_time < trunc(sysdate,'MM')) a,
       (SELECT sum(bytes)/1073741824
          FROM v$datafile ) bJustin

Similar Messages

  • Query on Database Size

    Hi all,
    I have a question regarding database size of my SAP Instance. My database by the way is Oracle 10g. I used the db02old transaction code. I got the ff: data in the space statistics:
    Scale: Month                                            Database
        Date               Values             SIze/kb                      Free/kb
    01.09.2009         Total            258744,320                 27,741,824
    01.08.2009         Total            258744,320                 30,568,320
    01.07.2009         Total            258744,320                 34,444,288
    01.06.2009         Total            258744,320                 38,159,168
    01.05.2009         Total            247152,640                 29,041,344
    01.04.2009         Total            247152,640                 35,197,184
    01.03.2009         Total            235560,960                 39,262,144
    01.02.2009         Total            205455,360                 14,124,224
    01.01.2009         Total            201175,040                 14,463,168
    01.12.2008         Total            197324,800                 14,466,112
    01.11.2008         Total            193474,560                 14,282,560
    01.10.2008         Total            188907,520                 13,716,736
    Note that the size from 01.06.2009 to 01.09.2009 has not changed. Does this mean that my database hasnt grown at all?
    How can I determine the exact growth of my database? Im planning to do some projection on how long will it take before my entire disks are consumed so I need to gather some data with respect to my database growth per month.
    Thanks in advance
    Jun

    >
    Aurelio Tadlas wrote:
    > HI Anjali,
    >
    > Yes, that's precisely what happened. Now I know that the size indicated in db02old is not actually the size of the data contained in the database but rather, its the size of the tablespaces in my database.
    >
    > Thank you very much for the enlightenment.
    >
    > Best regards
    Hi,
    Sorry for "interrupt" here.
    I'd recommend you to read the Oracle Database Concept Guide or go to any initial training (like ADM505)
    There you will find out that with "database" Oracle refers to the physical files.
    You can create a DB of 1 TB and that will be the database size, regardless of the data that is "inside".
    That means that, at the end, you more or less understood.
    DB02 shows the database size, not the amount of data that is inside the database

  • Query regarding database size

    hi,
    ( sap 4.7c + sql server 2000 (Module:sd/mm/fi )
    ( data : 1 & half year - no BI )
    our database size is around 50 GB
    and log size is around 30 GB
    I doubt that something is wrong.
    can anyone explain to me what is right and
    what action one should take on this type of scenario.
    thanks in advance
    raj

    Hi Raj,
    My database size is about 30GB (3 years of usage) and log file is about 12GB.
    My database settings (recomendent by SAP and Early watch) are:
    I shrinked database to minimum size and set following settings:
    Database (mdf and ndf):
    - growth activated: checked
    - growth not restricted: checked
    - next step possible: checked
    - next step size: 60MB
    tempdb and log file:
    - growth activated: checked
    - growth not restricted: checked
    - next step possible: checked
    - next step size: 10%
    Regards,
    Marcin Gajewski

  • SQL Query for Database Connections

    What would be the proper syntax or DBA table to query and find out how many database connections there are currently? Thanks for all of your help!!
    Marlan

    select * from v$session;Some entries in this view are dynamic processes (type = 'BACKGROUND') and you may want to exclude those depending on your requirements.

  • Query for total size of the spatial data

    Hi,
    I found some posts to determine the size of the spatial table but is there a query I can use to determine the exact size of my spatial column. I have about 2 mil. geometry points and I would like to know exactly how many bytes it is.
    Thanks in advance.
    Aarthi

    Hi,
    I have an old analysis I did several years ago. I couldn't get size for the SDO_GEOMETRY column per se, but I could calculate the approximate size required (not including extra space required for block boundaries, etc.). Note this info is quite old, so your milage may vary...
    This is the summary:
    SDO_GTYPE 3 bytes plus 1 byte for every two numeric places  (four digit gtype=5 bytes)
    SDO_SRID 1 byte if NULL; or 3 bytes plus 1 byte for every two numeric places 
    SDO_POINT 1 byte if NULL; or for each of the three numeric values, 1 byte if
                 NULL, or 3 bytes plus 1 byte for every two numeric places 
    SDO_ELEM_INFO 1 byte if NULL; or for each numeric value, 3 bytes plus
                 1 byte for every two numeric places, plus 40 bytes overhead for the VARRAY. 
    SDO_ORDINATES 1 byte if NULL; or for each numeric value, 3 bytes plus
                 1 byte for every two numeric places, plus 40 bytes overhead for the VARRAY. 

  • Tsql for database , size , free space or used space in database

    hi,
     i want to know how to find out database size

    use master
    declare @PageSize varchar(10)
    select @PageSize=v.low/1024.0
    from master..spt_values v
    where v.number=1 and v.type='E'
    select name as DatabaseName, convert(float,null) as Size
    into #tem
    From sysdatabases where dbid>4
    declare @SQL varchar (8000)
    set @SQL=''
    while exists (select * from #tem where size is null)
    begin
    select @SQL='update #tem set size=(select round(sum(size)*'+@PageSize+'/1024,0) From '+quotename(databasename)+'.dbo.sysfiles) where databasename='''+databasename+''''
    from #tem
    where size is null
    exec (@SQL)
    end
    select * from #tem order by DatabaseName
    drop table #tem
    The first select statement is to get how many kilobytes a data page has. SQL Server allocates disk space in the unit of data page. Currently each SQL server data page contains 8k bytes. The number of data pages allocated to each database file is recorded
    in the sysfiles system table. With this information on hand the script creates a temporary table #tem and update the temporary table with size information which is gathered by querying the sysfiles table.
    thx benedikt

  • Query for  to get  database size, used size, freesize, db size after drop

    Pls give me a query for to get database size, used size, freesize, tablespacesize of sometables which is starting with 'RQ%'
    I have to get result like this
    Total size, used size, free size ,tablespace size of RQ tables alone
    Reason why i go for "tablespace size of RQ tables" i want to know the size of database after deleting the rq tables
    Pls reply
    S

    i tried with
    SELECT
    --fs.tablespace_name name,
    df.totalspace/1024/1024 mbytes,
    (df.totalspace - fs.freespace)/1024/1024 used,
    fs.freespace/1024/1024 free
    FROM
    (SELECT
    --tablespace_name,
    ROUND(SUM(bytes)) TotalSpace
    FROM
    dba_data_files
    ) df,
    (SELECT
    --tablespace_name,
    ROUND(SUM(bytes)) FreeSpace
    FROM
    dba_free_space
    ) fs
    i AM GETTING total bytes, used bytes, free bytes
    I WANT TO include one more column.. database size after deleting rq tables
    Pls reply
    S
    Edited by: AswinGousalya on Jul 10, 2009 2:17 PM

  • Sql 2008 r2 property size is not available for database

    Nightly whenever index rebuild process runs My data file and log file gets full and when right click properties on database then I get the error: Property size is not available for database.This property may not exist for this object.
    What is the error means? What is my database state at that time?
    Thanks

    Nightly whenever index rebuild process runs My data file and log file gets full and when right click properties on database then I get the error: Property size is not available for database.This property may not exist for this object.
    What is the error means? What is my database state at that time?
    Thanks
    Hi Ajay
    Firstly, I have seen this before. Even though you have permissions to the database, when there is heavy load (Index rebuilds), I cannot access the database. Usually in this case, I just query the system tables for whatever I need.
    Secondly, your transaction log should not be filling up.
    What recovery model are you using?
    Do you have regular log backups? How often do they run?
    You need to plan properly for your transaction log growth.
    The data file fills up because the immediate sort of the index rebuild is being done in the database itself. You can change this to run in TempDB, provided your TempDB has been configured properly.
    Regards

  • QUERY TO GET database size, used size, freesize, tablespacesize of RQ table

    Pls give me a query for to get database size, used size, freesize, tablespacesize of sometables which is starting with 'RQ%'
    I have to get result like this
    Total size, used size, free size ,tablespace size of RQ tables alone
    Reason why i go for "tablespace size of RQ tables" i want to know the size of database after deleting the rq tables
    ( Since i am not getting any reply i go for database forum)
    Pls reply
    S
    Edited by: AswinGousalya on Jul 8, 2009 3:41 PM

    Hello,
    This question looks like it is really for the Oracle RDBMS and not for Berkeley DB. In BDB, we do not have a notion of tablespace size. What database product are you using?
    regards,
    mike brey
    BDB engineering

  • How to use scheduled agent for query in database

    Hi there I'm working with database on my app and when use the query for search in the database the application freeze for a maximum of one minute I want change that why I want what runs ok and I wonder if I can use a background agent for do that manage
    the queries .
    But I don't know how can I call the queries from the other project if the files are in the main project.

    Hi OzkarLeo,
    Background task provides functionality to do work when your app not in foreground, it need some conditions to trigger.
    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/Hh977056(v=win.10).aspx. If you need scheduled query when app is active in foreground, then it’s no need to use background task.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • Best practice on mailbox database size & we need how many server for deployment exchange server 2013

    Dear all,
    We have  an server that runs Microsoft exchange server 2007 with the following specification:
    4 servers: Hub&CAS1 & Hub&CAS2 & Mailbox1 & Mailbox2 
    Operating System : Microsoft Windows Server 2003 R2 Enterprise x64
    6 mailbox databases
    1500 Mailboxes
    We need to upgrade our exchange server from 2007 to 2013 to fulfill the following requirment:
    I want to upgrade the exchange server 2007 to exchange server 2013 and implement the following details:
    1500 mailboxes
    10GB or 15GB mailbox quota for each user
    How many
    servers and databases  are
    required for this migration<ins cite="mailto:Mohammad%20Ashouri" datetime="2014-05-18T22:41"></ins>?
    Number of the servers:
    Number of the databases:
    Size of each database:
    Many thanks.

    You will also need to check server role requirement in exchange 2013. Please go through this link to calculate the server role requirement : http://blogs.technet.com/b/exchange/archive/2013/05/14/released-exchange-2013-server-role-requirements-calculator.aspx
    2TB is recommended maximum database size for Exchange 2013 databases.
    Here is the complete checklist to upgrade from exchange 2007 to 2013 : http://technet.microsoft.com/en-us/library/ff805032%28v=exchg.150%29.aspx
    Meanwhile, to reduce the risks and time consumed during the completion of migration process, you can have a look at this proficient application(http://www.exchangemigrationtool.com/) that would also be
    a good approach for 1500 users. It will help you to ensure the data security during the migration between exchange 2007 and 2013.

  • One of the BizTalk Server processes in the affected computer is being throttled for significant periods because of high database size exceeding the threshold

    Hello Experts,
    I have complex Biz Talk 2013 farm having 20 servers,15 Hosts. In my production environment even if there is no traffic i am getting throttling errors from SCOM for my all the production hosts.
    Error : One of the BizTalk Server processes in the affected computer is being throttled for significant
    periods because of high database size exceeding the threshold
     I checked following things:
    1. MsgBoxDB size 748732 KB
    2. Spool table size  53 MB
    3. Tracking DB size 26724 KB
    4. Host settings --  Message Queue Size = 100, MsgCount = 50000 , Spool MP = 10 , Tracking MP = 10
    5. Ran Message Box viewer  and did not found any error related to DB size. (which counter i should focus on in MBV)
    Note -- for DB i am sharing full backup size because it does not have log file size.
    Please suggest where i should focus?
    Is SCOM reporting correctly because everything is fine in biztalk ?
    Thanks
    Yagya
    https://www.mcpvirtualbusinesscard.com/VBCServer/card.aspx?tag=YagyaDattMishra&wa=wsignin1.0

    Hi Yagyam
    I remember this error from SCOM when you use the standard SCOM BizTalk pack.
    Check the eventlog of the server, do you see any errors in event log, this could give some clue to the root cause. Whenever you have this alert from SCOM, you must have
    some entries in eventlog relating to the alert raised by SCOM.
    Is your message processing by BizTalk hosts are normal? Run the performance monitor to see the bottleneck. Check if there is really throttling.
    As mentioned in this blog, check the state of the SQL Agent on BizTalk's SQL database server, may be try restart the SQL Agent on BizTalk's SQL database server.
    http://blogs.msdn.com/b/timdel/archive/2008/11/19/why-i-love-scom.aspx
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Re: Query for logical database

    Hi Experts,
    can anybody giveme any link of step-by-step how to create a query from sq03,sq02,sq01 with logical database for CIK.
    if anybody have done the query for logical databse for CIK give me ur input how to create.
    Thanks in advance,
    KK.

    Hi
    Go to SQ01 -- Enviornment --Query area - select Standard area or global as you require.
    Then go to Enviornment - Infoset - search for the existing infoset if available as per your requirement or create an infoset here.
    Write the name of Infoset and click on create . Fill all the required field like name , logical database - CIK, press enter it will populate the structure of logical database CIK, you may include /exclude here the nodes, or keep it as it is.
    And press enter.
    Now you have to create Field group and the fields inside the each group.
    You may create thefield group by clicking the create icone in the right hand side of teh screen and may drag the then fields by double clicking inside the group.
    Please mainatin sequence as per the characteristic of the table, like first select masterdata then transactuional!
    Save it. It will ask you for package, but click on local object and save it.
    Go back , it will prompt for generate infoset, say yes.
    Now your new infoset is coming among other infosets. (it is advisable to search for the existing infoset if available to avoide inconsistency in infosets).
    Now select your infoset and assign this to user groups by clicking the tab for this, you need to select user groups for this infoset here, who will be authorised to use this query.You need to take care about the user group, as this will allow you to see your infoset at the time of query generation / display.
    Save it and go back and again go back.Cross check that you are in standard query area (as selected in first step)
    Now give the query name and click on create. It will show you your infoset , select that.
    It will propmt you the next screen for name , no.of columns required, output formats etc.
    Fill as required and go to basic list now you will have screen as SQVI and have to select your selection field and output filed. After selecting the required fileds save it and execute this .
    Cheers
    Mukta
    Edited by: MUKTAKUMARI on Aug 3, 2009 11:45 AM

  • Calculate the database size for a particular company code in SAP

    Hi Experts,
    We have 30 company codes in our FI production system. So to plan another new company code to be deployed into the system, we need to know exact data capacity (database) of the previous company code that we already deployed. Kindly let me know whether it possible to calculate the database size occupied for a particular company code in a SAP system.

    >
    Kalyan Kumar Bandlamudi wrote:
    > Hi Experts,
    >
    > We have 30 company codes in our FI production system. So to plan another new company code to be deployed into the system, we need to know exact data capacity (database) of the previous company code that we already deployed. Kindly let me know whether it possible to calculate the database size occupied for a particular company code in a SAP system.
    Its not possible to calculate data size based on company code.
    By creating company code It will not occupy much space. Depends on your posting documents for particular company codes.
    Thanks
    Siva

  • Calculate database size for a particular company code

    Hi Experts,
    We have 30 company codes in our FI production system. So to plan another new company code to be deployed into the system, we need to know exact capacity (database) of the previous company code that we already deployed. Kindly let me know whether it possible to calculate the database size for a particular company code in a ERP system.

    >
    Kalyan Kumar Bandlamudi wrote:
    > Hi Experts,
    >
    > We have 30 company codes in our FI production system. So to plan another new company code to be deployed into the system, we need to know exact data capacity (database) of the previous company code that we already deployed. Kindly let me know whether it possible to calculate the database size occupied for a particular company code in a SAP system.
    Its not possible to calculate data size based on company code.
    By creating company code It will not occupy much space. Depends on your posting documents for particular company codes.
    Thanks
    Siva

Maybe you are looking for

  • Command+Delete not working in iTunes 10.1.2

    Just noticed this since updating. The 'Delete' option under 'Edit' is not selectable and the Command+Delete option yields no results. Anyone else have this problem?

  • CS4 is adding a blank page, throwing off the printing

    I am creating a 40-page booklet to be printed 2-up saddle-stitch In the Pages layout, it says i have 40 pages in 21 spreads. 1 page on the top is the front cover and 1 page on the bottom is the back cover and 19 double-page spreads inbetween. Pages 2

  • Open & Save Dialog Window Location

    It's a hard one to give a name to, that's why I can't seem to find it on a search. Basically, I'm wondering if anyone knows of a way to get the "save dialog" to not sit over the top of a program when it comes up. Best example is MS Word 2008 (mac) -

  • Iphone shuts down when making a call

    Please help my iphone shuts down when making a call restored and set to new phone but still shuts down after 2 to 3 mins  HELP

  • IOS 5 not showing for upgrade

    My current software version for my iTouch says 4.2.1 and when I click on "Check for Update" its saying it is the current version. Tips on how to proceed would be great.