Query to find the memory of database in oracle,sql

Hi All,
Please let me know the query to find the memory of database in oracle,sql.
Thanks,
sajith

How do I find the overall database size?
The biggest portion of a database's size comes from the datafiles. To find out how many megabytes are allocated to ALL datafiles:
select sum(bytes)/1024/1024 "Meg" from dba_data_files;
To get the size of all TEMP files:
select nvl(sum(bytes),0)/1024/1024 "Meg" from dba_temp_files;
To get the size of the on-line redo-logs:
select sum(bytes)/1024/1024 "Meg" from sys.v_$log;
Putting it all together into a single query:
select a.data_size+b.temp_size+c.redo_size "total_size"
from ( select sum(bytes) data_size
from dba_data_files ) a,
( select nvl(sum(bytes),0) temp_size
from dba_temp_files ) b,
( select sum(bytes) redo_size
from sys.v_$log ) c;
Another query ("Free space" reports data files free space):
col "Database Size" format a20
col "Free space" format a20
select round(sum(used.bytes) / 1024 / 1024 ) || ' MB' "Database Size"
, round(free.p / 1024 / 1024) || ' MB' "Free space"
from (select bytes from v$datafile
union all
select bytes from v$tempfile
union all
select bytes from v$log) used
, (select sum(bytes) as p from dba_free_space) free
group by free.p
This is what I use :P From http://www.orafaq.com/wiki/Oracle_database_FAQ#How_do_I_find_the_overall_database_size.3F

Similar Messages

  • Query to find the user is having access to sql server DB

    Hi,
    Please help me in this.
    Query to find the whether the user is having access to sql server DB.
    Cheers,
    sajith

    TUBBY_ORCL?Select 1 from dual where 'ORACLE' = 'SQL SERVER';
    no rows selected
    Elapsed: 00:00:00.01

  • 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)

  • Query to find the Views and synonyms that are accessing through db_link

    HI all,
    Oracle 10g
    I need a Query to find the Views and synonyms that are accessing through db_link.
    ie.
    database A have the db_link to database B through a schema A
    now i need to find what are the Synonyms and views that are accessing through db_link either directly or indirectly..
    regards,
    Deepak
    Edited by: Deepak_DBA on Dec 10, 2010 5:38 PM

    On the second database (B) use this query to find the SQL which used by the schema A (DB LINK USER). Check the SQL_FULLTEXT column.
    select sql_fulltext,sql_id,module,parsing_schema_name,parsing_user_id,first_load_time,loads,users_executing,rows_processed,plsql_exec_time,sorts,fetches,invalidations,parse_calls,cpu_time,elapsed_time,disk_reads,buffer_gets
    from V$sqlarea
    where parsing_schema_name = 'A' --and to_char(first_load_time,'dd/mm/yyyy') like  '%11/08/2007'
    order by first_load_time desc;
    Regards
    Asif Kabir

  • How to Find the number of Databases in a server.

    HI,
    Please tell me how to find the number of Databases are in a server . when the DB is not up.
    ps -ef | grep ora_
    This i know whether our DB is up or not. But i want to know how many databases are in a server .If the database is down .
    Cheers,
    Gobi.

    Hi,
    [oracle@oralinux admin]$ lsnrctl status
    LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 01-DEC-2006 16:25:41
    Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
    TNS-01169: The listener has not recognized the password
    [oracle@oralinux admin]$
    Plz give me the solution.
    Cheers ,
    Gobi.

  • I opened up a kingston memory stick last week on my computer and it worked fine.  This the memory stick will not open in my computer.  How do I find the memory stick if the icon does not come up on my desktop screen?

    I cannot seem to open back up my memory stick.  I dragged the "icon" to the trash bucket before I pulled the stick out.  The memory stick icon no longer shows up on my computer.  It also will not open on any other computer.  Is there anyway to find the memory stick when its plugged in with out having the icon show up?

    You might try the obvious, although I have seen memory sticks fail.  Good luck.
    1)Remove the memory stick
    2) Shut the computer down
    3) Restart the computer
    4) Login
    5) Re-insert the memory stick

  • 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 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'

  • Query to find the latest record with respect to the current status

    Dear gurus
    I have the following data in a table
    Customernum
    bkcode
    reqtdate
    Prevstat
    currstat
    The data will be like this
    CustomerNum bkcode reqdate prevstat currstat
    5900 1 03-Aug-12 0 1
    5900 1 06-Aug-12 1 0
    5900 5 22-Jun-12 0 1
    If a customer has an issue to solved, a record is added with bkcode , register date and currstat will be 1
    If the issue is resolved for the bookingcode,a new record is added, the currentstatus will become 0. and prev stat will show 1. Row no 1 and 2 reflects this case
    If this table is queried for finding the unresolved issues. the output should be only the Last row of the above example. since issue with bookingcode 1 has been resolved
    I have trying hard to get this thing confused what to use Lead or Max
    Kindly guide me

    Hi,
    one way here:
    WITH mytable(CustomerNum, bkcode, reqdate, prevstat, currstat)
    AS
       SELECT 5900, 1, TO_DATE('03-Aug-12', 'DD-Mon-YY'), 0, 1 FROM DUAL UNION ALL
       SELECT 5900, 1, TO_DATE('06-Aug-12', 'DD-Mon-YY'), 1, 0 FROM DUAL UNION ALL
       SELECT 5900, 5, TO_DATE('22-Jun-12', 'DD-Mon-YY'), 0, 1 FROM DUAL
    SELECT CustomerNum, bkcode, reqdate, prevstat, currstat
      FROM (SELECT a.*
                 , ROW_NUMBER() OVER (PARTITION BY CustomerNum, bkcode
                                           ORDER BY reqdate DESC) AS rn
              FROM mytable a
    WHERE rn=1
       AND currstat=1;
    CUSTOMERNUM     BKCODE REQDATE     PREVSTAT   CURRSTAT
           5900          5 22-JUN-12          0          1Regards.
    Al
    Edited by: Alberto Faenza on Dec 18, 2012 5:23 PM
    Changed again!! Previous logic was wrong

  • Query to find the Salary table details  HRMS 11i

    I am looking  query to find the persons salary details in Oralce EBS 11i.
    I tried the below query bu it didn'ty work.
    SELECT papf.employee_number
    ,papf.full_name
    ,pj.NAME job
    ,haou.NAME ORGANIZATION
    ,ppp.proposed_salary_n salary
    FROM per_all_people_f papf
    ,per_all_assignments_f paaf
    ,per_jobs pj
    ,hr_all_organization_units haou
    ,per_position_definitions ppd
    ,per_all_positions pap
    ,per_pay_proposals ppp
    WHERE 1 = 1
    AND SYSDATE BETWEEN papf.effective_start_date AND papf.effective_end_date
    AND papf.current_employee_flag = 'Y'
    AND papf.employee_number IS NOT NULL
    AND paaf.person_id = papf.person_id
    AND SYSDATE BETWEEN paaf.effective_start_date AND paaf.effective_end_date
    AND paaf.job_id = pj.job_id
    AND paaf.organization_id = haou.organization_id
    AND paaf.position_id = pap.position_id
    AND pap.position_definition_id = ppd.position_definition_id
    AND ppp.pay_proposal_id = (SELECT MAX (pay_proposal_id)
    FROM per_pay_proposals
    WHERE assignment_id = paaf.assignment_id)
    In our case all the below tables have 0 records..
    select count(*) from PER_PAY_PROPOSALS ;
      COUNT(*)
             0
    select count(*) from pay_element_entry_values_f;
      COUNT(*)
             0
    select count(*) from PAY_ELEMENT_ENTRY_VALUES_F;
      COUNT(*)
             0
    select count(*) from PAY_ELEMENT_ENTRIES_F;
      COUNT(*)
             0

    Hi,
    Your results clearly states that there is no salary data which is been captured as well as there are no element entries which are assigned to any assignment.
    Please do the below which will insert records in salary as well as element entries table:
    1. Add a salary proposal to any active employee (People Enter and Maination --> Search for any employee --> Assignment --> Salary) - This will insert a record in PER_PAY_PROPOSALS table
    2. Add an element entry to any active assignment (People Enter and Maination --> Search for any employee --> Assignment --> Entries) - This will insert a record in PAY_ELEMENT_ENTRIES_F and PAY_ELEMENT_ENTRY_VALUES_F table
    Hope this clarifies.
    Thanks,
    Sanjay

  • Query to find the  second maximum date in a table

    please give me the query to find the second maximum date in a table

    You can try with this
    SELECT empno
          ,hiredate
      FROM emp        a
    WHERE 2          = (SELECT COUNT(DISTINCT hiredate)
                           FROM emp        b
                          WHERE b.hiredate      >= a.hiredate
    OR
    SELECT empno
          ,hiredate
      FROM (SELECT ROWNUM      row_num
                  ,empno
                  ,hiredate
              FROM emp        a
          ORDER BY hiredate   ASC
    WHERE row_num             = 2;Regards
    Arun

  • Sql query to find the space in between the sentense

    hi,
    can anybody tell me the query to find the space in between the data
    chandan

    Not sure what you mean, but you might want to take a look at INSTR, like in
    instr (txt, ' ')

  • Sql query to find the balances for a customer account wise.

    Hi,
    Could someone help me with the sql query to find the balances for each customer account wise. This is need to generate the report.
    presently we are using this query, but the output doesnot return the expected result.
    SELECT sum(nvl(ps.acctd_amount_due_remaining,0)) "Balance"
    FROM      ra_cust_trx_line_gl_dist_all gld,
              gl_code_combinations c,
              ar_payment_schedules_all ps,
              RA_CUSTOMER_TRX_ALL rat,
              ra_customers rc
    WHERE      c.CHART_OF_ACCOUNTS_ID = 101
    and gld.code_combination_id = c.code_combination_id
         and rat.CUSTOMER_TRX_ID=gld.CUSTOMER_TRX_ID
         and rat.CUSTOMER_TRX_ID=ps.CUSTOMER_TRX_ID
    and ps.customer_id=rc.customer_id
         and ps.status='OP'
         and ps.gl_date <= :PDATE
         and ps.org_id=:PORGID
         and ps.class in ('GUAR','INV','DM','DEP')
    and c.SEGMENT4=:Account_id
    and ps.customer_id=:Customer_id
    Thanks in advance.
    Kalyan.

    Can someone help us with this.

  • Can anybody provide the SQL query to find the files uploaded in a particular folder?

    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

    Nevin,
    Be great if we could know the version of Portal. For Rel. 1, here's the query
    select id,masterthingid from wwv_things
    where siteid = &site
    and cornerid = &corner
    &site - Content Area id
    &corner - Folder id
    if you don't know the folder id, use
    select id from wwv_corners where siteid = &site
    and name = &folder
    Hope this helps. I have run into this situation before. Usually, the culprits were
    one of the following:
    1. Junk Characters in description of item (caused due to Copy-Paste)
    2. Special Characters in the File name
    Hi All,
    Can anybody provide the SQL query to find the documents (document name) uploaded in a particular folder? While clicking on folder in
    GUI I'm hitting the Timeout error. I would like to find the files uploaded into this folder from SQLPLUS.
    Any help is greatly appreciated.
    With best regards,
    Nevin

  • SQL Query to find the Notify upon Completion employees

    Hi,
    I am looking for a query to find the names of the employees/users who are notified upon the completion of the Concurrent Programs. I know how to find the concurrent program details but not able to find notify upon completion employees details. Please help me.
    Thanks,
    KM

    Thanks Scott for responding. There is no any custom code. Here is the navigation to reach there:
    System Administrator -> Requests -> View -> Specific Requests -> Open any request ->View Details -> Options -> Notify the following people
    I am looking for the query to find these notified people using SQL Query.Query FND_CONCURRENT_REQUESTS table (NOTIFY_ON_PP_ERROR column) -- http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=FND_CONCURRENT_REQUESTS&c_owner=APPLSYS&c_type=TABLE
    Thanks,
    Hussein

Maybe you are looking for

  • Have a problem using flex ui with Java application

    Hi, I have a built a Flex UI for a java project. The UI has some forms which use a servlet for POST and data populated from servlet. I have used HTTP service to make the calls. I have built my application i.e UI in Flex Builder and when I run my appl

  • BI JAVA  incorrect URL while accessing portal from RSPLAN

    Hi   We have implemented BI JAVA by connecting our existing BI ABAP system SP15 to the newly created JAVA server. We installed Netweaver2004s  SR3 SP14 JAVA portal on a seperate server and configured BI JAVA on it.   Now When a user goes to transacti

  • Portal Alignment

    Hi, I am using a portal component (TreeView) in EP6 where the font alignment with the tree node icons is not proper. Can anybody help me in achieving this? You can go in this link to find out the exact alignment problem. <http://www.wikiupload.com/do

  • Firefox 5.0.1 hangs up. Is nonrsponsive requiring a force quit. No crash reporter comes up. Using Mac OS 10.6.7

    Error console is an interesting read. Where do I find the crash reporter log, though I haven't seen it crash per say. Just stop reponding requiring a relaunch.

  • Camera dot on IPad?

    Maybe I am missing something but I just noticed that at the top of my 64GB iPad three is a dot that look almost identical to camera dot on my MacBook Pro, obviously the iPad does NOT have a camera so what is this dot there for?