Calculating Used Space in Tablespace
Is there some way that I could calculate memory used by a particular schema or user in a particual tablespace?
If U meant the size usage of the table space then u can do so by using the following query;
Select bytes/(1024*1024) from dba_ts_quotas where tablespace_name='xyz'(ie,ur tablespace name).
this will give the size in MB .
Similar Messages
-
Hi,
in 10g,
any query to find total used space in tablespaces ?
thank you.user522961 wrote:
Hi,
in 10g,
any query to find total used space in tablespaces ?
thank you.select a.TABLESPACE_NAME,
a.BYTES bytes_used,
b.BYTES bytes_free,
b.largest,
round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used
from
select TABLESPACE_NAME,
sum(BYTES) BYTES
from dba_data_files
group by TABLESPACE_NAME
a,
select TABLESPACE_NAME,
sum(BYTES) BYTES ,
max(BYTES) largest
from dba_free_space
group by TABLESPACE_NAME
b
where a.TABLESPACE_NAME=b.TABLESPACE_NAME
order by ((a.BYTES-b.BYTES)/a.BYTES) desc -
Monitoring Used (%) space for tablespaces
Hi everyone,
I am currently using:
Redhat Linux ES 5 2.6.18 and also
Oracle 10g Release 2 for Linux x86 R10.2.0.3
While monitoring my Tablespaces using OEM Database Control, I notice that two tablespaces were almost full.
[SYSAUX] - Size: 290MB , Used 283MB (97% full)
[SYSTEM] - Size: 320MB, Used 313MB (98% full)
When I try to locate the datafiles of both tablespaces in its directory (/home/dba/oracle/oradata/oracle), it shows the allocated size (290MB for sysaux01.dbf & 320MB for system01.dbf) and not the used space.
I got three questions to ask over here:
1st- Why there isn't any warnings or alarms even though the tablespaces exceeds the critical size?
2nd- How come the datafiles shows the allocated size of the tablespaces and not the Used space?]
3rd- How can I find & monitor the actual used space of the tablespaces?
4th- I have enabled the AutoExtend function but I am worry whether is there any other concern?
I am still very new here.
Please pardon me for anything that is improper.
Looking forward for your expertise, guidance & help.
Thanks for your attention.
-Regards-
++ Kef Lim ++Hi,
Here you have some scripts:
TABLESPACE USAGE NOTES:
Tablespace Name - Name of the tablespace
Bytes Used - Size of the file in bytes
Bytes Free - Size of free space in bytes
Largest - Largest free space in bytes
Percent Used - Percentage of tablespace that is being used - Careful if it is more than 85%
select a.TABLESPACE_NAME,
a.BYTES bytes_used,
b.BYTES bytes_free,
b.largest,
round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used
from
select TABLESPACE_NAME,
sum(BYTES) BYTES
from dba_data_files
group by TABLESPACE_NAME
a,
select TABLESPACE_NAME,
sum(BYTES) BYTES ,
max(BYTES) largest
from dba_free_space
group by TABLESPACE_NAME
b
where a.TABLESPACE_NAME=b.TABLESPACE_NAME
order by ((a.BYTES-b.BYTES)/a.BYTES) desc
SET SERVEROUTPUT ON
SET PAGESIZE 1000
SET LINESIZE 255
SET FEEDBACK OFF
PROMPT
PROMPT Tablespaces nearing 0% free
PROMPT ***************************
SELECT a.tablespace_name,
b.size_kb,
a.free_kb,
Trunc((a.free_kb/b.size_kb) * 100) "FREE_%"
FROM (SELECT tablespace_name,
Trunc(Sum(bytes)/1024) free_kb
FROM dba_free_space
GROUP BY tablespace_name) a,
(SELECT tablespace_name,
Trunc(Sum(bytes)/1024) size_kb
FROM dba_data_files
GROUP BY tablespace_name) b
WHERE a.tablespace_name = b.tablespace_name
AND Round((a.free_kb/b.size_kb) * 100,2) < 10
PROMPT
SET FEEDBACK ON
SET PAGESIZE 18
Set Termout On
Set Heading On
clear breaks
break on contents -
skip 1
compute Sum of alloc used free nbfrag on contents
column tblsp format a20 wrap heading "Tablespace Name"
column Alloc format 999,999 heading "Alloc|(Mb)"
column Free format 999,999 heading "Free|(Mb)"
column used format 999,999 heading "Used|(Mb)"
column pused format 990.9 heading "%|Used|Space"
column fragmax format 99,999.9 heading "Largest|Free|Ext.(Mb)"
column nbfrag format 99999 heading "Nb|frag"
column contents format a10 heading "Content"
column pct_ext_coal format 999 heading "% Ext.|Coal."
column ext_manage format a7 wrap heading "Ext.|M."
column autoext format a7 wrap heading "Auto|Ext."
select
contents
, nvl (dt.tablespace_name, nvl (fsp.tablespace_name, 'Unknown')) tblsp
, alloc
, alloc - nvl (free, 0) Used
, nvl (free, 0) Free
, ((alloc - nvl (free, 0)) / alloc) * 100 pused
, nbfrag
, fragmax
, dfsc.pct_ext_coal pct_ext_coal
, dt.ext_manage
, df.inc autoext
from
( select sum (bytes)/1048576 free
, max (bytes)/1048576 fragmax
, tablespace_name
, count(*) nbfrag
from sys.dba_free_space
group by tablespace_name
) fsp
, ( select sum(bytes)/1048576 alloc
, tablespace_name
, Decode(((inc * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes') inc
from sys.dba_data_files sddf
, sys.filext$ aut
where sddf.file_id = aut.file# (+)
group by tablespace_name
, Decode(((inc * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes')
Union
select sum(bytes)/1048576 alloc
, tablespace_name
, Decode(((increment_by * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes') inc
from sys.dba_temp_files sddf
group by tablespace_name
, Decode(((increment_by * &Var_DB_BLOCK_SIZE)/1024), Null, 'No', 'Yes')
) df
, ( select contents
, tablespace_name
, initial_extent/1024 initial_ext
, next_extent/1024 next_ext
, pct_increase
, max_extents
, min_extents
, Substr(extent_management,1,5) ext_manage
from dba_tablespaces
) dt
, ( select percent_extents_coalesced pct_ext_coal
, tablespace_name
from dba_free_space_coalesced
) dfsc
where
fsp.tablespace_name (+) = dt.tablespace_name
and
df.tablespace_name (+) = dt.tablespace_name
and
dfsc.tablespace_name (+) = dt.tablespace_name
order
by contents
, pused desc
;Cheers,
Francisco Munoz Alvarez
http://www.oraclenz.com -
Calculating free space in tablespace
Oracle 11.0.1.7:
I am trying to calculate free space in the tablespace but I am not sure if Allocated Space (bytes_used) also has some free space that doesn't get reflected in the query below. Is it correct to assume that bytes_used is the space allocated to extents but may not have been really used (no data or LOB) yet? How do I calculate space that's currently been used by row data, index data or blob data?
I am currently using below query:
select a.TABLESPACE_NAME,
a.BYTES bytes_used,
b.BYTES bytes_free,
b.largest,
round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used
from
select TABLESPACE_NAME,
sum(BYTES) BYTES
from dba_data_files
group by TABLESPACE_NAME
a,
select TABLESPACE_NAME,
sum(BYTES) BYTES ,
max(BYTES) largest
from dba_free_space
group by TABLESPACE_NAME
b
where a.TABLESPACE_NAME=b.TABLESPACE_NAME
order by ((a.BYTES-b.BYTES)/a.BYTES) descDBA_FREE_SPACE give you the free space information which has not been allocated to any segment. The segments can also have free space in their allocated space and in order to find that, use DBMS_SPACE.SPACE_USAGE procedure. To find out free space in LOB segments refer to metalink doc: 386341.1
Thanks
Daljit Singh -
To determine the amount of space currently used in each tablespace
I am preparing for OCA and came through a question.
QUESTION 389
You need to determine the amount of space currently used in each tablespace.
You can retrieve this information in a single SQL statement using only one DBA view in
the FROM clause providing you use either the _______ or _______ DBA view.
A. DBA_EXTENTS.
B. DBA_SEGMENTS.
C. DBA_DATA_FILES.
D. DBA_TABLESPACES.
Answer mentioned: A, C.
My doubt is that DBA_EXTENTS, DBA_SEGMENT,DBA_DATA_FILES all three contained column "BYTES" which shows size in bytes. Then why B is not an option.
Plz help.
Thanx
AshutoshOf these 4 answers, I'd say A and B will give the info asked for in the question.
DBA_DATA_FILES only tells you the file size. That's not of much value because it doesn't tell you how much space is consumed by objects (there may be none).
DBA_TABLESPACES has no storage info.
DBA_EXTENTS and SEGMENTS show the amount of space consumed by objects.
Even then, I'd say none of the above and use: DBA_TABLESPACE_USAGE_METRICS -
Rapid and Huge growth of of used space of temporary tablespace
Hi,
Have a query (select) that run quick (no more than 10 seconds).
As soon I insert the data into a temporary table or even on physical table, the temporary table used space starts to growth very fast. The used space is totally used and the query crash since e reach the limit (65GB), or even more if I add more table files to temporary tablespace!
The problem also happen only if the period (dates) is one year (2013). If the period is the first trimestre of 2013 (same amount of data), the problem does not happen!!
I also confirm that on another instance ( a test one), even with less resources this ORACLE behavior do not happen. I confirm differente execution plan queries, between the two instances .
What I really do not understant is the behavior of the ORACLE with the huge and rapid growth!!!
Any one experiment such a similiar situation?
Thanks in advance,Rui
Plan
INSERT STATEMENT ALL_ROWSCost: 15.776 Bytes: 269 Cardinality: 1
28 LOAD TABLE CONVENTIONAL MIDIALOG_OLAP.MED_INVCOMP_FACTTMP_BEFGROUPBY
27 FILTER
26 NESTED LOOPS
24 NESTED LOOPS Cost: 15.776 Bytes: 269 Cardinality: 1
22 NESTED LOOPS Cost: 15.775 Bytes: 255 Cardinality: 1
19 NESTED LOOPS Cost: 15.774 Bytes: 205 Cardinality: 1
17 NESTED LOOPS Cost: 15.773 Bytes: 197 Cardinality: 1
14 NESTED LOOPS Cost: 15.770 Bytes: 180 Cardinality: 1
11 NESTED LOOPS Cost: 15.767 Bytes: 108 Cardinality: 1
9 HASH JOIN Cost: 15.757 Bytes: 8.346.500 Cardinality: 83.465
7 HASH JOIN Cost: 13.407 Bytes: 6.345.012 Cardinality: 83.487
5 HASH JOIN Cost: 11.163 Bytes: 5.010.550 Cardinality: 100.211
3 HASH JOIN Cost: 5.642 Bytes: 801.288 Cardinality: 22.258
1 INDEX RANGE SCAN INDEX MIDIALOG.IX_INSCOMP_DTCEIDICIDLCPECIDOP Cost: 120 Bytes: 489.676 Cardinality: 22.258
2 INDEX FAST FULL SCAN INDEX (UNIQUE) MIDIALOG.IX_LINHACOMPRADA_IDLCIDOPSEQ Cost: 5.463 Bytes: 123.975.530 Cardinality: 8.855.395
4 INDEX FAST FULL SCAN INDEX (UNIQUE) MIDIALOG.IX_LINHACOMPRADA_IDLCIDOPSEQ Cost: 5.463 Bytes: 123.975.530 Cardinality: 8.855.395
6 TABLE ACCESS FULL TABLE MIDIALOG.ITEM_AV Cost: 1.569 Bytes: 6.963.736 Cardinality: 267.836
8 TABLE ACCESS FULL TABLE MIDIALOG.ITEM_AV Cost: 1.572 Bytes: 7.713.672 Cardinality: 321.403
10 INDEX UNIQUE SCAN INDEX (UNIQUE) MIDIALOG.IX_BOFINALBO_IDBOIDFINALBO Cost: 0 Bytes: 8 Cardinality: 1
13 TABLE ACCESS BY INDEX ROWID TABLE MIDIALOG.INSERCAO_COMPRADA Cost: 3 Bytes: 72 Cardinality: 1
12 INDEX RANGE SCAN INDEX (UNIQUE) MIDIALOG.IX_INSCOMPRADA_IDLCDATAPECAINS Cost: 2 Cardinality: 1
16 TABLE ACCESS BY INDEX ROWID TABLE MIDIALOG.INSERCAO_ITEMFACTURA Cost: 3 Bytes: 17 Cardinality: 1
15 INDEX RANGE SCAN INDEX MIDIALOG.IX_INSITFACT_INSCOMPRADA Cost: 2 Cardinality: 1
18 INDEX RANGE SCAN INDEX (UNIQUE) MIDIALOG.UQ_ITEMFACTURA_IDITF_IDFACT Cost: 1 Bytes: 8 Cardinality: 1
21 TABLE ACCESS BY INDEX ROWID TABLE MIDIALOG.FATURA Cost: 1 Bytes: 50 Cardinality: 1
20 INDEX UNIQUE SCAN INDEX (UNIQUE) MIDIALOG.PK_FATURA Cost: 0 Cardinality: 1
23 INDEX UNIQUE SCAN INDEX (UNIQUE) MIDIALOG.PK_TIPO_ESTADO Cost: 0 Cardinality: 1
25 TABLE ACCESS BY INDEX ROWID TABLE MIDIALOG.TIPO_ESTADO Cost: 1 Bytes: 14 Cardinality: 1
Edited by: rr**** on 19/Fev/2013 15:25I run the select with sucess, no more that 1 minute from on year of data. Few temporary used space used.
As soon I plug the insert (global temporary table, also experiment with physical table) the used space of temporary table space start to grow crazy!!
insert into midialog_olap.med_invcomp_facttmp_befgroupby
select fac.numefatura,
fac.codpessoa,
fac.dtemiss,
tef.nome as estado_factura,
opsorig.demid,
opsorig.anoplano,
opsorig.numplano,
opsorig.numplanilha,
ops.nome as ordem_publicidade,
ops.external_number as numero_externo,
ops.estado,
lic.seq,
inc.data,
inc.peca,
fac.id_versao_plano,
fac.ano_proforma || '.' || fac.numrf as num_proforma,
iif.tipo_facturacao,
opsorig.codveiculo as id_veiculo,
opsorig.codfm as id_fornecedor_media,
icorig.chkestado as id_estado_checking,
0 as percentagem_comissao_agencia,
0 as valor_pbv,
0 as valor_stxtv,
0 as valor_ptv,
0 as valor_odbv,
0 as valor_pbbv,
0 as valor_dnv,
0 as valor_pbnv,
0 as valor_stxv,
0 as valor_pbtv,
0 as valor_dav,
0 as valor_plv,
0 as valor_odlv,
0 as valor_pllv,
0 as valor_ca,
0 as valor_trv,
0 as valor_txv,
0 as valor_base_facturacao,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pb_compra * fac.percentagem_facturada / 100))
as valor_pbc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_stxt_compra * fac.percentagem_facturada / 100))
as valor_stxtc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pt_compra * fac.percentagem_facturada / 100))
as valor_ptc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_odb_compra * fac.percentagem_facturada / 100))
as valor_odbc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pbb_compra * fac.percentagem_facturada / 100))
as valor_pbbc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_dn_compra * fac.percentagem_facturada / 100))
as valor_dnc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pbn_compra * fac.percentagem_facturada / 100))
as valor_pbnc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_stx_compra * fac.percentagem_facturada / 100))
as valor_stxc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pbt_compra * fac.percentagem_facturada / 100))
as valor_pbtc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_da_compra * fac.percentagem_facturada / 100))
as valor_dac,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pl_compra * fac.percentagem_facturada / 100))
as valor_plc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_odl_compra * fac.percentagem_facturada / 100))
as valor_odlc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_pll_compra * fac.percentagem_facturada / 100))
as valor_pllc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_transcricoes * fac.percentagem_facturada / 100))
as valor_trc,
decode(ops.estado, :WKFOPR_BOOKINGORDER_CANCELED, 0,
decode(iif.tipo_facturacao, :BILLING_TYPE_ONLYCOMISSION, 0,
inc.total_tx_compra * fac.percentagem_facturada / 100))
as valor_txc,
--nvl((select cfm.total_comprado
-- from fin_custos_facturados_media cfm
-- where cfm.id_factura = fac.id_factura and
- -- cfm.id_op = ops.id_op
-- ), 0) / opsorig.number_of_bought_insertions as custos_associados,
0 as custos_associados,
fac.iss as percentagem_iva,
fac.percentagem_facturada,
fac.currency_exchange as taxa_cambio,
iif.associated_code as insertions_associated_code
from fatura fac, item_fatura itf, insercao_itemfactura iif,
insercao_comprada icorig, linha_comprada lcorig, item_av opsorig,
med_bookingorder_finalbo opfin,
insercao_comprada inc,
linha_comprada lic, item_av ops,
--veiculo vei,
tipo_estado tef
where fac.id_factura = itf.id_factura and
itf.id_itemfactura = iif.id_itemfactura and
iif.id_ic = icorig.id_ic and
icorig.id_lc = lcorig.id_lc and
lcorig.id_op = opsorig.id_op and
opsorig.id_op = opfin.id_booking_order and
opsorig.number_of_bought_insertions > 0 and
opfin.id_final_booking_order = ops.id_op and
-- ops.id_op = (
-- select max(ops.id_op)
-- from item_av ops
-- start with ops.id_op = opsorig.id_op
-- connect by prior ops.id_opsubstituicao = ops.id_op) and
ops.id_op = lic.id_op and
lic.seq = lcorig.seq and
lic.id_op = inc.id_op and
lic.id_lc = inc.id_lc and
inc.data = icorig.data and
inc.peca = icorig.peca and
--opsorig.codveiculo = vei.codveiculo and
fac.estado = tef.estado and
fac.estado != 305 and
ops.estado != 223 and
iif.tipo_facturacao != 'SO_CA' and
icorig.data between :dtBeginDate and :dtEndDate and
(fac.codagenciafat = :iIdAgency or :iIdAgency is null); -
Checking tablespace used space, free space in ASM
Hi,
I want to find the tablespace used space, free space, total space in an ASM (Automatic Storage Management) environment. What is the query for that ?
Thankswant to find the tablespace used space, free spaceUse same script that u are used in non-asm environment.
dba_data_files
dba_free_space
total space in an ASM (Automatic Storage Management) environment.select name, type, total_mb, free_mb, required_mirror_free_mb,
usable_file_mb from v$asm_diskgroup;
Thanks
Kuljeet -
Use of DEFAULT tablespace while re-enabling constraint
Using 8.1.7.2.
While trying to re-enable a constraint on a table, we hit a ORA-01630. According to the error message, Oracle was trying to use the DEFAULT tablespace (USERS) instead of the TEMPORARY tablespace (TEMP) to do the work.
Why would Oracle use a tablespace other than TEMP to do work that needed temporary space?
[email protected]What is the 'temporary_tablespace' value when you query user_users as this user?
Oracle will use the tablespace that is specified as the users TEMPORARY_TABLESPACE for all sorts. If that tablespace does not exists, it uses SYSTEM. -
What is the use of SYSAUX Tablespace in Oracle 10G
Dear Experts,
Please Tell me What is the use of SYSAUX Tablespace in Oracle 10G Because
during Web Load Testing It is going to increase countinuosly.Although i am not using this with any tables.
How Can I find out the what is gong on in this.
Can I Remove this tablesspace and other non using Schemas like FLOWS_020100,MDSYS,OUTLN,DIP and TSMSYS etc.What is SYSAUX?
The SYSAUX tablespace provides storage of non-sys-related tables and indexes that traditionally were placed in the SYSTEM tablespace. For example, the tables and indexes that were previously owned by the system user can now be specified for a SYSAUX tablespace. Unfortunately, Oracle still places the SCOTT schema and the other demonstration schemas in the SYSTEM tablespace. Go figure.
The SYSAUX tablespace is specified with the CREATE DATABASE command. This is demonstrated in the example database creation script in Figure 1.1.
CREATE DATABASE test
MAXINSTANCES 1
MAXLOGHISTORY 1
MAXLOGFILES 5
MAXLOGMEMBERS 3
MAXDATAFILES 100
DATAFILE '/usr/oracle/OraHome1/oradata/aultdb1/test/system01.dbf' SIZE 300M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
EXTENT MANAGEMENT LOCAL
SYSAUX DATAFILE '/usr/oracle/OraHome1/oradata/aultdb1/test/sysaux01.dbf' SIZE 120M REUSE AUTOEXTEND ON NEXT 10240K MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/usr/oracle/OraHome1/oradata/aultdb1/test/temp01.dbf' SIZE 20M REUSE AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL
UNDO TABLESPACE "UNDOTBS1" DATAFILE '/usr/oracle/OraHome1/oradata/aultdb1/test/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED
CHARACTER SET WE8ISO8859P1
NATIONAL CHARACTER SET AL16UTF16
LOGFILE GROUP 1 ('/usr/oracle/OraHome1/oradata/aultdb1/test/redo01.log') SIZE 10240K,
GROUP 2 ('/usr/oracle/OraHome1/oradata/aultdb1/test/redo02.log') SIZE 10240K,
GROUP 3 ('/usr/oracle/OraHome1/oradata/aultdb1/test/redo03.log') SIZE 10240K
USER SYS IDENTIFIED BY "password" USER SYSTEM IDENTIFIED BY "password";
Oracle10g sysaux
With the new SYSAUX tablespace, Oracle comes closer to providing all the needed tablespaces for a truly OFA-compliant database right out of the box. With just one CREATE DATABASE command we can specify the SYSTEM tablespace, the TEMPORARY tablespace, the AUXSYS tablespace, the default UNDO tablespace, and the redo logs.
Of course, with the Oracle Managed Files option you can create an entire database with a single command, but the database created is not suitable for production use and is not OFA-compliant.
The SYSAUX tablespace is required in all new 10g databases. Only the SYSAUX tablespace datafile location is specified. Oracle specifies the remainder of the tablespace properties including:
online
permanent
read write
extent managment local
segment space management auto
If a datafile is specified for the SYSTEM tablespace, then one must be specified for the SYSAUX tablespace as well. If one is not specified, then the CREATE DATABASE command will fail. The only exception is for an Oracle Managed File system.
During any update of a database to Oracle Database 10g, a SYSAUX tablespace must be created or the upgrade will fail. The SYSAUX tablespace has the same security profile as the SYSTEM tablespace. However, loss of the SYSAUX tablespace will not result in a database crash, only the functional loss of the schemas it contains.
Can I drop SysAux?
DROP DATAFILE
Read this... -
Finding the size of db and size of used space
Greetings all good people.
Can you please help me find out about 2 database information?
One, I want to find out the size of a database =size of physical files.
and the size of data which is the size occupied in physical files.
We are about to start a new project and there is a table on the database but it is empty.
We want to be exporting data into this table but we want to make sure that there is enough space on the db before we start populating the table with data.
I believe the code below just gives me the size of the database.
select (bytes/1024/1024) as total_gigs from dba_segments where owner='BELL' and segment_name='$TABLE_NAME
But I want to know the total size of the database and how much size has been used already, much the same as you would want to know the size capacity of a hard drive and how much of the size has been used.
Sorry if my request is confusing.
Thanks a lot in advancedb size can be found out
select sum(bytes)/1024/1024/1024 from dba_data_files ;
and size of data is -- in the datafiles
select sum(bytes)/1024/1024/1024 from dba_segemnts ;
You can find out by below query .. the tablespace sizes -- would be DBSIZE
used space -- would be the actual occupied space.
select t.tablespace, t.totalspace as " Totalspace(MB)",
round((t.totalspace-nvl(fs.freespace,0)),2) as "Used Space(MB)",
nvl(fs.freespace,0) as "Freespace(MB)"
from
(select round(sum(d.bytes)/(1024*1024)) as totalspace,d.tablespace_name tablespace
from dba_data_files d
group by d.tablespace_name) t, (select round(sum(f.bytes)/(1024*1024)) as freespace,f.tablespace_name tablespace
from dba_free_space f
group by f.tablespace_name) fs
where t.tablespace=fs.tablespace (+)
order by t.tablespace -
How can free + used space tbs size, can someone explain
Hi Gurus
Can someone explain this, How can free + used space in a tablespace can be greater than size of a tablespace. What am I missing here . Thanks a lot .
I am on 10.2.0.1, HP-UX
14:38:52 SQL> select owner,sum(bytes), sum(BYTES) /1024/1024 "MB" from dba_segments where tablespace
name='USERDB1ADATA' group by owner;
OWNER SUM(BYTES) MB
USERDB1A 839680000 800.78125
1 row selected.
14:40:42 SQL> select bytes, BYTES /1024/1024 "MB" from dba_data_files where tablespace_name='USERDB1
A_DATA';
BYTES MB
3758096384 3584
1 row selected.
14:40:42 SQL> select sum(bytes) , sum(BYTES) /1024/1024 "MB"from dba_free_space where tablespace_nam
e='USERDB1A_DATA';
SUM(BYTES) MB
3067412480 2925.3125
1 row selected.
14:40:43 SQL> select 839680000 + 3067412480 "used + free space" from dual;
used + free space
3907092480
1 row selected.
New DBAGood point, Howard, about the recycle bin. So I cleaned up, recreated the table, filled it, dropped it but did not purge it, and ...
SQL> create table test.x tablespace test as select * from dba_objects where 1=2;
Table created.
SQL> insert into test.x select * from dba_objects;
12617 rows created.
SQL> commit;
Commit complete.
SQL> drop table test.x;
Table dropped.
SQL> with
2 dbf_size as (select sum(bytes) size_
3 from dba_data_files where tablespace_name='TEST'),
4 dbf_free as (select sum(bytes) free_
5 from dba_free_space where tablespace_name='TEST'),
6 dbf_used as (select sum(bytes) used_
7 from dba_segments where tablespace_name='TEST')
8 select size_, free_, used_, (size_ - free_ - used_) left_
9 from dbf_size, dbf_free, dbf_used
10 /
SIZE_ FREE_ USED_ LEFT_
5242880 5177344 2162688 -2097152
SQL>and then I played around with my SQL and came up with
WITH
dbf_size AS (SELECT SUM(bytes) size_
FROM dba_data_files
WHERE tablespace_name='TEST'),
dbf_free AS (SELECT SUM(bytes) free_
FROM dba_free_space
WHERE tablespace_name='TEST'),
dbf_used AS (SELECT SUM(bytes) used_
FROM dba_segments
WHERE tablespace_name='TEST'),
dbf_fbin AS (SELECT SUM(bytes) fbin_
FROM dba_segments
INNER JOIN
dba_recyclebin
ON (tablespace_name=ts_name
AND segment_name=object_name)
WHERE tablespace_name='TEST')
SELECT size_, -- tablespace size
free_, -- free space reported
used_, -- segment space used
fbin_, -- segment space in recycle bin
(size_ - free_ - used_ + fbin_) left_ -- 64K overhead per data file
FROM dbf_size, dbf_free, dbf_used, dbf_fbin
/which does
SQL> WITH
2 dbf_size AS (SELECT SUM(bytes) size_
3 FROM dba_data_files
4 WHERE tablespace_name='TEST'),
5 dbf_free AS (SELECT SUM(bytes) free_
6 FROM dba_free_space
7 WHERE tablespace_name='TEST'),
8 dbf_used AS (SELECT SUM(bytes) used_
9 FROM dba_segments
10 WHERE tablespace_name='TEST'),
11 dbf_fbin AS (SELECT SUM(bytes) fbin_
12 FROM dba_segments
13 INNER JOIN
14 dba_recyclebin
15 ON (tablespace_name=ts_name
16 AND segment_name=object_name)
17 WHERE tablespace_name='TEST')
18 SELECT size_,
19 free_,
20 used_,
21 fbin_,
22 (size_ - free_ - used_ + fbin_) left_
23 FROM dbf_size, dbf_free, dbf_used, dbf_fbin
24 /
SIZE_ FREE_ USED_ FBIN_ LEFT_
5242880 5177344 2162688 2162688 65536
SQL> alter tablespace test add datafile 'C:\ORACLE\ORADATA\XE\TEST2.DBF' size 5m;
Tablespace altered.
SQL> WITH
2 dbf_size AS (SELECT SUM(bytes) size_
3 FROM dba_data_files
4 WHERE tablespace_name='TEST'),
5 dbf_free AS (SELECT SUM(bytes) free_
6 FROM dba_free_space
7 WHERE tablespace_name='TEST'),
8 dbf_used AS (SELECT SUM(bytes) used_
9 FROM dba_segments
10 WHERE tablespace_name='TEST'),
11 dbf_fbin AS (SELECT SUM(bytes) fbin_
12 FROM dba_segments
13 INNER JOIN
14 dba_recyclebin
15 ON (tablespace_name=ts_name
16 AND segment_name=object_name)
17 WHERE tablespace_name='TEST')
18 SELECT size_, -- tablespace size
19 free_, -- free space reported
20 used_, -- segment space used
21 fbin_, -- segment space used in recycle bin
22 (size_ - free_ - used_ + fbin_) left_
23 FROM dbf_size, dbf_free, dbf_used, dbf_fbin
24 /
SIZE_ FREE_ USED_ FBIN_ LEFT_
10485760 10354688 2162688 2162688 131072Message was edited by:
Hans Forbrich
Cleaned up the script and tested with second data file added to verify LMT overhead. -
Calculate used space in database!
Hi all,
I can calculate used space by using the following ways:
1. Calculate allocated size by issuing
SELECT SUM(d.bytes/1024/1024/1024)
FROM dba_data_files;
2. Calculate free space by issuing
SELECT SUM(bytes/1024/1024/1024)
from dba_free_space;
Used space will be the value from first statement - value of the second statement! This is manual way!
Is this possible to combine the two above queries?
Thank you!
Dan.You can certainly combine the 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) freeNormally, you'd group by tablespace as well.
But if you just want the amount of space used, it's probably easier to just
SELECT sum(bytes)/1024/1024/1024 used_gb
FROM dba_segmentsJustin -
Used space -230MB ??
I have a tablespace splitted in several datafiles and one datafile is showing that i have -230MB Used space? The other data files were correctly displayed. At first I thought it was a bug of another software i used, but i was surprised to see the same thing on Enterprise Manager...Is this a bug? (Mind you i had only around 10MB of used space, and 10GB free on that datafile)
Go to $ORACLE_HOME/bin
run
./nmupm filesystems
This data is what is passed back to OEM. See if there is an error there or not.
HPUX has been a bit buggy for OEM so do take a look for patches .. -
Find the used space in datafile on any specific date
Hi,
We have a datafile created on 2-11-2009.
I wish to find the used space in that datafile on 13-12-2009.
From v$datafile and dba_data_files from the "BYTES" column it wld give me the current used space in the datafile.
But how to find the used space in datafile on any specific date.
Thanks.Hello,
It depends on your Oracle release, starting with Oracle 10.1, you have the View dba_hist_tpspc_space_usage which may give you an history of the space used by the Tablespaces:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_3195.htm#I1023456
You may have to pay for specific license to be allowed to access to this View which belongs to AWR (Automatic Workload Repository).
Hope this help.
Best regards,
Jean-Valentin -
Manual segment space managed tablespaces , How tune?
I use Manual segment space managed tablespaces.
How I can tuning for high performance?
What's advantage and disavantage of Manual segment space managed tablespaces and Auto segment space managed tablespaces?
if I used more data.
I'll use Auto or manual?
Please introduce me.ASSM deal with freelist, freelist group(RAC) storage parameters. If you use ASSM you dont need to worry about adjusting freelist and group, oracle will automatically deal with it. If you are using manual storage segment management there would no problem unless you you see heavy buffer busy waits on your tables. You may also play with freelist value for tables which have concurrent inserts and access to avoid buffer busy waits.
From oracle 9i Rel 2 onwards, you have segment level statistics to find out which segments causing more buffer busy waits and tune them accordingly. There are other meaning for buffer busy waits, check v$event_name for buffe busy waits and find out the reason code for the cause of buffer busy waits event.
Jaffar
Maybe you are looking for
-
CS5 or Elements for Drawing?
hello everyone. I know this doesn't sound original but I have yet to find an answer so I came here. I am hoping to get a Wacom Bamboo Fun tablet soon and it includes Adobe Elements 8. I am an artist and browsing around places like DeviantArt i find t
-
Dear All, Scenario:- File to Proxy and Acknowledgement SAP to File. Once the file is received by SAP and first ack is send as recepit of file to Legacy system, after that the process goes ahead and do other validation and the same outbound proxy is t
-
Send XML and receive binary data via SOAP
Hi folks, following idea (Client-Server-Rendering-Architecture): 1. Send XML as JavaScript variable via SOAP to the InDesign Server 2. Attached the XML String to a new document or template 3. Apply several XMLRules to the docuument 4. Render to docum
-
Help with JAVA StringObject - & assign user input; StringMethod
Hi Everyone! I need help with this Java Program, I need to write a program, single class, & file. That will prompt the user to enter a word. The output will be separted by hypens and do this until the user enters exit. I think this is done by using a
-
Hello, I have a few questions regarding storing of inbound emails in CRM4.0. Can anbybody help to understand how the inbound emails are stored in CRM System? Are they stored in content management? I think that when they arrive, they are associated to