Calculate the space used in the database!

Hi all

I can calculate the space used by using one of the following ways:

1. determine the size allocated by issuing

SELECT SUM(d.bytes/1024/1024/1024)
FROM dba_data_files;

2 calculate the free space by issuing

SELECT SUM(bytes/1024/1024/1024)
from dba_free_space;

Space used will be the value of the first statement - value of the second statement. This is manually!

Is it possible to combine these two queries?

Thank you!

Dan.

You can certainly combine queries

SELECT (allocated.bytes - free.bytes )/1024/1024/1024 used_gb
  FROM (select sum(bytes) bytes from dba_data_files) allocated,
      (select sum(bytes) bytes from dba_free_space) free

Normally, you could group tablespace as well.

But if you want just the amount of space used, it is probably easier to just

SELECT sum(bytes)/1024/1024/1024 used_gb
  FROM dba_segments

Justin

Tags: Database

Similar Questions

  • calculate disk space total used by databases oracle across the company

    Hello

    If we want to know the number of instances, the number of RAC databases and disk space around total used by oracle (not the size of file system),

    1. any script can be run to grid control OEM against all instances/databases?

    or

    2. we have a unix server that has the entire databases tnsnames, any script that we can run from there?

    Thank you very much!!

    This is not a difficult task.

    What OEM version you have?

    (i) connection in OEM

    (2) create a Group and add all of the databases in this group

    3) go to the "Reports" section in OEM and GO to 'Oracle database space use (group)'

    4) click on this link

    (5) select the group that you created in the previous step and see the report.

    (6) it will show you the TOTAL space, space allocated and free space of all databases in the group together.

  • Calculate the space used by an individual/idebtifying partition in the partitions belonging to a partition - possible?

    Hello

    Using oracle 11.2.0.3 and have a partitioned table, some of the partitions use their own tablespace for to use WHERE user_segments but many partitions share the same tablespace.

    We wish to place each partition to a tablepsace of dedicatde and seek to identify the space used by a single partition.

    What is the best way to do this?

    See user_tatb_partitions ha snum_rows + blocks.

    Can see WHERE user_segments door secondary partition names.

    Is that a query can use for secondary idnentify belonging to a partition

    Thank you

    See halfway down the page below for SQL XML util to convert a string of high_value.

    http://OraStory.WordPress.com/2013/12/12/SQL-utils-using-XML/

  • Calculate the material database

    Hi all

    I'm new Oracle DBA in the industry, not a lot of experience in the database. I have some confusion. Maybe it's stupid question but this turning point in my mind. Please help to solve these.

    (1) for new projects comes, I'm confusing all cache/RAM required and CPU. Although I can calculate the capacity of the hard drive.  for example - my Application user say we have total TPS (transactions per second) is 1000 (200 update, delete 300, 100 and 200 insertion selects), so in this case how can I calculate hardware capacity, and how I can answer for them.

    (2) this is the reverse of the first question.  Suppose a database running, and everything works fine. I want to calculate the GST (transactions per second). means how select/update/insert/delete running in the second. How to calculate or identified TPS.

    Thanks in advance...

    Reg,

    Hard

    Thank you all, I got my answer...

    Oracle Capacity Planning

    Introduction - Database management

    The best way to perform the Oracle capacity planning is with planningsof the worksheet of the ability of the Oracle. Database management has increased over the years to the simple management of a few tables and indexes to a complex of interlocking responsibilities ranging from management of objects of database to participate in decisions large enterprise on hardware, software and development tools.

    In order to fully discharge these functions the modern Oracle DBA needs one big together skills. In the last hours, we will discuss the skills needed, and specifically how they apply to an Oracle DBA.

    Capacity planning system

    In a green field operation (the one where you're here in front of the equipment and the database), a DBA will have a critical role to play in planning and configuration of the new system. Even in existing environments the ability to predict new servers, new databases, or improvements to existing databases and systems is crucial.

    Essentially the DBA should be concerned with two main questions:

    1. Get enough server to ensure an adequate return
    2. Sufficient backup and power of recovery for backup and restoration carried out respecting the time constraints required.

    All this is actually under the heading planning resources and capabilities. Resources and capacity planning Oracle is a database intensive resources system. The more CPU, memory and disk resources, you can provide Oracle, better it performs. Planning with Oracle resources becomes more a game of "How can we afford to buy" instead of "what is the minimum configuration. A minimally configured Oracle server won't work effectively. Specification of resource for Oracle In the specification of resources, there are several questions that should be answered.

    1. How many users will use the system today and in the future?
    2. Data will include the system contain both now and in the future, we don't know the growth rate?
    3. What response time are expected?
    4. The availability of this system is planned?

    Why are these issues important?

    1. How many users will use the system today and in the future?

    This issue is important, because it effects how much processing power is going to be necessary. The number of users will determine the number and speed of the processors, memory, the related network configuration size.

    1. Data will include the system contain both now and in the future, we don't know the growth rate?

    This issue is important because it determines the disk needs, how much storage will need to take the data we have today and how it will be necessary for the growth. The answer to this question also allows to determine how much memory will be needed.

    1. What response time are expected?

    This question is important because it pushes the number, type and speed of CPU resources, but also of network problems. He will lead also issues such as the number and speed disk configuration disks, number and speed of the controllers, disk partitioning decisions.

    1. The availability of this system is planned?

    This question is important because the availability of the system grows the type of RAID (1, 0, 0/1, RAID5) configuration, the type of scheduled backup (cold, warm) and parallel server problems. Requirements change if all that is expected is the system to be available during business hours from Monday to Friday, or if the system is supposed to be available 24 X 7 seven days a week. This also leads the type of backup media, be it a single tape drive is all that is necessary or is it a hi-speed, tape-stacker, multichannel, solution based silo?

    To properly perform a capacity planning cooperative efforts should be made between system administrators, database administrators, and network administrators.

    Step 1: Size of the Oracle database

    A starting point for the whole process of capacity planning is to know how many and what size, databases will be based on a given server resource. The physical size of the tables, indexes, clusters, and LOB storage areas will play an essential role in the sizing of the overall database, including areas of shared global memory and disk farm. DBAS and developers must work together in order to properly size the physical files of the database. The design of the database will also lead the placement and the number of storage spaces and other resources of database such as the size and quantity of newspapers of recovery, rollback segments and their associated buffers.

    Typically areas of buffer of data to an LMS database block size out to between 1/20 to 1/100 the physical sum relative to the total number of database file sizes. For example, if the physical size of the database is 20 gigabytes the database block buffers should on about 200 megabytes to 1 gigabyte in size depending on the how the data is used. In most cases the LMS shared pool would be size out to about 20-150 megabytes maximum according to the usage model for the common areas of SQL (see next lesson). For a system of 20 gigabytes the redo logs would most likely run between 20 and 80 megabytes, you want mirrored volumes and probably not less than 5 groups. The pad of paper to support a 50 megabyte redo log file would be a minimum of 5 megabytes may be as large as 10 megabytes. The last major factor for BMG would be the size of the sorting box, for this size of a database, a sort of 10 to 20 megabytes field is on the right (according to the number and size of all kinds). Remember that sort areas can be a part of the shared pool or a part of the large pool, so we'll cover in a future lesson.

    So on that basis we've determined? Gives a choice of 400 megabytes for our size memory buffer of data block, 70 megabytes for the shared pool, buffers of the newspaper of 4 to 10 MB (40 MB) and a size of 10 megabytes sort field. We look at a megabyte of 500-600 LMS with the important factors of non - DBA added in. Since you are not supposed to use more than 60% of the physical memory (according to the interviewee) it means w will need at least a gigabyte of RAM. With this size of database a single UC probably won? t give enough performance so we are probably looking at least a 4-processor machine. If we have more than one instance installed on the server, the memory requirements will increase.

    Step 2: Determine the number and Type of users:

    Of course, a database of a user will require fewer resources than the user database of a thousand. Generally, you will need to take a LOOT at how many memory resources and drive each user will need. An example would be to assume that a user installed 1,000 users base, only 10 percent of them at the same time will use the database. That leaves 100 concurrent users, those who perhaps a second 10 percent will do the activity requiring sorting areas, this brings the number up to 10 users each use (in our previous example) 10 megabytes of memory each (100 MB). In addition each of the 100 users simultaneous need about 200 k of space (depending on the activity, BONE, and other factors) process so there is an additional charge of 20 megabytes just for the user process space. Finally, each of these users will require probably some amount of disk resource (or less if they are client-server or web-based) let? s give them 5 meg of disk to start each, which adds up to 5 gigabytes of disk (give or take a meg or two.)

    Step 3: Determine the hardware requirements for the required response time meet and support of user Support:

    This step is the system administrator and maybe the seller of equipment. Given our mix of 1000:100:10 users and any required response time numbers, they should be able to configure a server that will obtain good results. Usually, this will require several, interfaces multi-lane disks and several separate physically the drive bays.

    Step 4: Determine the material backup to support the requirements of availability required:

    Here again the admin system and hardware vendor will have a helping hand in the decision. Based on the size of the disks and the speed of the maximum recovery time backup solution should be developed. If there is no way to meet your requirements of availability required using backup schemas simple more esoteric architectures can be specified as strips of multiple channels, hot databases in standby or even Oracle Parallel Server. Let? s say we need a requirement of availability 24 X 7 with instant failover (no recovery time because of the critical nature of the mission of the system). This type of specification would require Oracle Parallel Server in a configuration of automated failover. We also use either a double or triple mirror on disk so that we could divide the mirror to perform backups without losing the protection of mirroring.

    Let? s compile what we have determined so far:

    Material: 2-4 CPU (for higher-speed CPU we can) with at least 1 gigabyte (preferably 2) of RAM shared, at least 2 disk controllers each with many channels, 90 gigabytes of disk resource using a three way mirror to give us a matrix to mirror a triple 30 concert. The systems themselves should have a sufficient internal disk subsystem to support the operating system and the swap and the requirements of pagination. Systems must be able to share the disk resources so should support clustering. High-speed tape backup to minimize the folding times mirror.

    Software: Oracle Parallel Server, Cluster, the network management software, software backup management software to support backup material.

    Capacity and resource planning is not an exact science. Basically, look for a moving target. Dual Pentium II 200 NT Server with 10 GB of 2 GB SCSI disks for $5 k, I bought 2 years ago has a modern equivalent in the Pentium III 400 with the builtin 14 concert my father-in-law just bought for $1 k. At the time where we specify and purchase of a system, it is already replaced. You should insist on power substitute options more effective, more inexpensive they are available during the phases of specification and procurement.

    Reg,

    Hard...

  • Reading large data using the database connectivity

    Hello

    I use the Labview database connectivity toolkit to connect to my database sqlitev3 (I'm using ODBC). I just have to connect to the database (using the block of open_connection) and read all the values inside (using the select_data block). The problem is that my database is huge (about 2 GB), and I get this error:

    . VI NI_Database_API.lvlib:Rec FETCH Recordset Data (R)-> NI_Database_API.lvlibB Tools Select Data.vi-> real_web.vi-> real_web.vi.ProxyCallerADO error: 0x8007000E Exception occurred in provider: not enough memory is available to complete this operation. in .vi NI_Database_API.lvlib:Rec Fetch Recordset Data (R)-> NI_Database_API.lvlibB Tools Select Data.vi-> real_web.vi-> real_web.vi.ProxyCaller

    What should I do? It seems that he reads the data in the memory and it doesn't have enough space for it. When I read the data I want to write to a file.

    Read it in pieces. Write each piece to the file, and then repeat with the next segment. Try to read and process all data in one shot is not very practical and you found out will not work.

  • Connection to the database to Oracle using Oracle Apex 5.0.1

    Hi all

    Is it possible to connect to the Oracle (Oracle SQL Developer 4.1.1) database using Oracle Apex 5.0.1 instead of using the object browser. As he was more workspace after you have downloaded the data we have on CSV Excel.

    For example: regardless of the tables I've created in the Application Builder is created in the object browser. We have limited the workspace of 500 MB. This is the reason why we cannot use this method to load the data and retrieve it. (Note: can I ask 2 GB of space to work on the approval of the Director, who is still not sufficient)

    Is it possible that I will create an apex.oracle.com application by using the application builder and I will create in the database tables. When I load the file in application, data will be stored in the database Oracle instead of the object browser.

    Well let me know is possible, if yes, how can I proceed.

    If this isn't the case, please let me know how I can get more workspace.

    According to my understanding, other possibilities are: 1) taking backup of old files and free up space, 2) create another workspace and get extra work space.

    Thanks for your help!

    Kind regards

    Vinod

    Hello

    When you load data using APEX SQL Workshop utilities for example, the data is stored in your database tables.

    Object browser is just seen tool your schema as the table objects and the data in the tables, just as SQL Developer.

    If you have no good reason to keep these files that you downloaded in the workspace, delete those. Data is stored in database tables.

    Kind regards

    Jari

  • Check the installed oracle components are actually used in the database

    I got a new database I have to optimize. So I think to delete some installed components that I think are not be used somehow in the database (IE procedures calls etc.). I see a whole bunch of components as "ODD", 'ORDIM', which I think are not used, but previous DBAs have installed them. So, is it possible to make sure that no part of the database are actually using these components so that I can remove these components. Also, what are your expert comments on it?

    Is it a production or a development environment? If an object is not used then this isn't necessarily a problem (performance wise) unless it is either cluttering up your dictionary or raising concerns regarding the consumption of unnecessary space. Personally, I would recommend that it is preferable to resolve what is to be used / taken of resources. It is maybe once a year report or a few old utility out once a year, the best monitoring, why those things are there.

    If you go down the road of a fall, rather than drop anything immediately block accounts for an agreed period to ensure that the scheme is not used & check all references other schemas of objects in the schema that you intend to drop, potentially of audit to check if they are being called by other patterns / verification dba_dependencies between schemas and objects using a hierarchical query to check the sub-levels.

    There are also quite a few standard Oracle components that are installed by default that have interdependencies and not necessarily be used in the dictionary (control dba_features_usage_statistics)

  • Calculate the free space of the lob segment / reclaim space?

    Friends...

    DB: 11 GR 2

    OS: Linux

    I am trying shrink lob segment and recover the free space between the business segments.

    This area in Oracle DB is new to me so try to learn and to shrink the segment.

    I went through various metalink doco (386341.1) but not be able to get answers for below...

    Issues related to the:

    1. how much free space is available in the lob segment?

    2 can I assume 'no LOB DATA' as the free space currently and even will be recovered once the segment will be shrunk?

    3. no disadvantage of using "ALTER TABLE... SHRINK SPACE.

    4. is it true if storage segment is 100 GB as many redo will be generated when trying to alter table... shrink the space?

    I'm following the steps below.

    1 find Segment name-> sys_lob123

    2. find the size of storage - > 100 GB

    3. find the size of the LOB data-> 70

    4. find the size of the data not LOB-> 30

    2. the storage size

    Select 'storage' from dba_extents bytes

    where nom_segment = 'sys_lob123. '

    100 GB

    3. the size of the LOB

    Select dbms_lob.getlength (col_lob) in the table_lob;

    70 GB

    4. the size of the LOB data not

    100-70 = 30 GB (i.e. #3 - #2)

    Thanks in advance and enjoy your time looking into this...

    Use DBMS_REDEFINITION to reorganize the LOB segment, it is the best way to retrieve a LOB segment space. Also use the clause "MEANS of COMPRESS" and SECURE LEADER, creating the temp table. There is no reason that you can use the BASIC FILE. It's online process, which means that your app can stay up to... However, make sure that monitor you the database when executing redef, as it can cause conflicts and slow down your application, in which case you must kill the reorg...

    If this process is not feasible or overwhelms you, "ALTER TABLE MOVE" is another option.

    With 'Displacement of Alter table', you need to rebuild all indexes after you move the LOB segment. Don't forget this is an offline process and your application needs a time out while you do this.

    Here is the query to list the 10 LOBs albums in your database-

    fixed line 160

    Col a20 PROPRIETARY format

    Col TABLE_NAME format a30

    Col COLUMN_NAME format a30

    Col nom_segment format a30

    size col 999 999 999 format

    SELECT *.

    FROM (SELECT b.owner,

    b.table_name,

    b.column_name,

    a.segment_name,

    SUM (a.bytes) / (1024 * 1024) "size".

    FROM dba_segments a, b dba_lobs

    WHERE a.segment_name LIKE '% SYS_LOB '.

    AND a.segment_name = b.segment_name

    AND a.owner NOT IN ('SYS', 'SYSTEM', 'GENERAL', "OUTLN")

    B.owner GROUP,

    b.table_name,

    b.column_name,

    a.segment_name

    ORDER BY DESC 5)

    WHERE ROWNUM<>

  • Is there a way to change the connection string to the database by using the command line on the virtual machine?

    Hi, I use 1.5 space Horizon

    can someone help me by telling me where I can change the connection string for the database on the virtual machine itself.

    I was away, and our stuff has been migrated databases to another server. Now my horizon does not connect because it can not find the database. I can either on the hwconfigurator.xxx.com.

    Thank you

    What do you see when you go to https://hwconfigurator.xxx.com?

    You can try to change this property in /usr/local/horizon/conf/runtime-config.properties on your service - will (s) and the server restart of tc by using the command "/etc/init.d/horizon-frontend restart".

    datastore. JDBC. URL = jdbc:PostgreSQL: / //saas? = stringtype unspecified

  • How to free up disk space for the database file

    Hi experts BDB.

    I use bdb4.6.21 transaction Btree access method, found that after vacuum db db-> truncate, the size of the db file has changed. How to free up disk file db space? It can be configured?

    Thank you

    Min

    Hi Min,

    What Mike says is that you do not expect that the empty space after an operation of truncation (for example a delete or update that empties a page) in the database (empty pages) to return to the file system and therefore to see the physical file size decreases.

    The next section of the documentation explaining this: required disk space

    Space released by removing the key/data pairs in a Btree database or Hash is never returned in the file system, even if it is reused when possible. This means that the databases Btree and hash are to develop alone. If enough key is deleted from a database which shrinks the underlying file is desirable, use the DB-> compact() method to recover disk space. Alternatively, you can create a new database and copy the folders of the former into it.


    So, as Mike suggested, you can dump and reload the data into a new database, or copy data from the existing/old database to a new (to remove the old database and rename a new one the old name), or you can try to compact the database using the method compact().

    If you use compact(), then in order to force the return of empty for the file system pages when possible, use the DB_FREE_SPACE flag and try to avoid using an explicit transaction (use a NULL tnxid pointer, so this BDB will use internally of several transactions that will be engaged periodically to avoid locking large sections of the tree).

    When you use the compaction in order to free up space and return pages from database empty in the file system that it is generally recommended to repeat Compact with a value low 'compact_fillpercent '.  In addition, the following output statistics fields in the structure DB_COMPACT, compact_pages_truncated and compact_pages_free should be examined to determine if there is a point, continuing to run the compaction with the same compact_fillpercent.  If the values are strict positive it is then compact() calling again with the same compact_fillpercent (and specify the DB_FREE_SPACE flag).  The compact algorithm allows a single pass on the pages of the database;  pages so not empty at the end of the file will prevent the free pages (which are placed on the free list) to be returned to the file system.

    Kind regards

    Andrei

  • How to calculate the total memory used by oracle under Linux?

    Hi all

    In one of my server have 148 GB of total physical memory and 12 databases are running. For capacity planning, I need to know how the Oracle server use.

    How to calculate the use oracle database? I was perplexed because Yop out his show off 148 gb 128 GB are used.

    Below for your reference:
    ++++++++++++++++++++
    == > back to top
    top - 09:52:32 up to 151 days, 15:20, 3 users, load average: 6.11, 6.00 6.05
    Tasks: 7 running, 1314, 1321 total sleep, stopped 0, 0 zombie
    CPU: 37.8%us, 1.4%sy, 0.0%ni, 55.0%id, 5.6%wa, 0.1%hi, 0.2%si, 0.0%st
    MEM: 148290444 k total, 129368792 k used, 18921652 k free, 1450292 k buffers
    Swap: 50331632 k total, 1296188 k used, 49035444 k free, 114733336 k cached


    The memory allocated to each instance is: sga total == > 34 pga = > 48 GB gb
    +++++++++++++++++++++++++++++

    SGA PGA
    4 GB 4 gb
    4 GB 4 gb
    2 GB, 4 GB
    2 GB, 4 GB
    2 GB, 4 GB
    2 GB, 4 GB
    2 GB, 4 GB
    3 gb 4 gb
    3 gb 4 gb
    4 GB 4 gb
    3 gb 4 gb
    3 gb 4 gb

    Thank you

    Try this - http://www.pythian.com/news/29703/oracle-instance-memory-usage/ for each of your instances.

    As far as I know, different instances may share only the binary code oracle and using libraries, so you should be able to easily understand the amount of memory of all instances of 12.

    Lordane Iotzov
    http://iiotzov.WordPress.com/

  • short of space locks roll FORWARD the database

    Hi all

    My database RAC 11 GR 2 running on both nodes RH5.7 got locked. I tell the cause the disk space RECOVERY satiety than the execution of what the ASMCA shows that the entire roll FORWARD is used (40 GB!)

    Furthermore, I try to access the database via sqlplus, I get ORA-00257 (http://ora-00257.ora-code.com/) that mentions

    "The most likely cause of this message, it is that the destination device is out of space to store the redo log file.

    Now is it possible that an Oracle RAC is unrecoverable, simply because he can't write newspapers? And as we cannot access, we cannot remove these logs?

    Help, please

    920550 wrote:
    Now is it possible that an Oracle RAC is unrecoverable, simply because he can't write newspapers?

    No, it is the opposite: Oracle instance blocked any new database entry to be recoverable.

    And as we cannot access, we cannot remove these logs?

    Even if archive destination is stored in ASM you can access (for example with the utility asmcmd command line interface).

    What you need to do is:
    1 backup archived redo logs
    2. Remove archived redo logs that have been saved.

    For example if you use RMAN, you can try

    backup archivelog all delete input;
    
  • Identify a tablespace that is not used in the database

    Hello

    How to find the tablespace that is not assigned to any user? Note that I have a table partition in which there is table space where the records will be placed in the future based on the requirement on this partition table. I gave the unlimited tablespace on these tablespace privilege for the user. How to find storage space that is not used at any time in the database?


    Kind regards

    007

    007 wrote:
    Hello

    How to find the tablespace that is not assigned to any user? Note that I have a table partition in which there is table space where the records will be placed in the future based on the requirement on this partition table. I gave the unlimited tablespace on these tablespace privilege for the user. How to find storage space that is not used at any time in the database?

    Kind regards

    007

    According to my understanding of your question

    To check the quota on the tablespace use query below:

    SELECT * FROM dba_ts_quotas WHERE username = "XXXX";

    to check the default tablespace use the following query:

    Select USER_USERS from dba_users where username = 'XXXX '.

    How to find storage space that is not used at any time in the database?

    Use view dba_data_files for space used for the tablespace.

    I hope this help you

    Neeraj-

    Published by: Virginia October 22, 2011 14:35

  • How do we calculate the growth of the database?

    I have the situation where I have to calculate the growth of the database. I'm new to this business. We have implemented new indexes on the database of production where it took freespace all that remains. So, we have increased tablespace because we still have a few clues more to compile. Unfortunately, we ran out of space on the server. I asked for more space on the server that is to say 50% of the current database size. Of course, there are other databases on the same server and management wants to know why I need that a lot of space. Now my question is

    1. How do we calculate the growth of the database?
    2. How do we know how much table space is necessary for the given index.
    3. while maintaining growth increased from DB in calculating how we predict future growth.

    Any help much appreciated. Thank you.

    Hello

    Please visit the following link.

    http://www.DBA-Oracle.com/t_database_growth_reports.htm

    I hope this will help you.

    Thank you

  • You do not have enough disk space to create the database...

    Hi all

    During the creation of the database, I received this message:

    + "You don't have enough disk space to create the database. +
    + You must at least 939008 on/U01 KB, you only 1981480960 available KB. +

    + Please allow more free disk space. » +

    I checked:
    Root@server# df h
    Size of filesystem used avail capacity mounted on
    / dev/dsk/c4t600A0B800033696A000017534E2F6F67d0s0
    2.2 T 2.2 G 2.2 T 1% / U01

    My Info:
    DB-INSUP2-C2VAS of SunOS 5.10 Generic_142909-17 sun4u sparc SUNW, Sun-Fire-V890
    Oracle database: 10.2.0.1


    Help, please!
    Thank you!
    Dan.

    Thank you all,

    I got the same warning messages and I created the point of editing/U01 with 50 GB for installation of Oracle and creation of database with no caveat. In my opinion, the warning appeared as the point of Assembly/U01 is too large (2.2 T).

    Sorting.

    Published by: hqtri on August 4, 2011 23:33

Maybe you are looking for