Doubt in considering temp tablespace's free space
Hi All,
Database: oracle 11.2
Operating System: AIX
I want to know how much free space available in my temp tablespace
I ran below scripts
select sum((bytes_free)/1024/1024/1024) GB from v$temp_space_header
+52.904296875+
select (tablespace_size)/1024/1024/1024 tablespace_size_in_gb,
+(allocated_space)/1024/1024/1024 allocated_space_in_gb,+
+(free_space)/1024/1024/1024 free_space_in_gb+
from dba_temp_free_space
tablespace_size_in_gb: 98.9990234375
allocated_space_in_gb: 46.0947265625
free_space_in_gb:151.81640625
So my doubt is which one from above two script gives actual free space information ?
Also in dba_temp_free_space view why free space size > tablespace size ?
v$temp_space_header shows you how big the temp tablespace has got since the database was restarted. It doesn't give you the current free/used space.
See the link for dba_temp_free_space, but I think it may be the way it reports free space which is why you're seeing it as more than the actual tablespace. As you can see form the description "space that is currently allocated and available for resuse" is calculated for both allocated space and free space.
http://docs.oracle.com/cd/B28359_01/server.111/b28320/statviews_5056.htm
>
ALLOCATED_SPACE = space that is currently allocated and used + space that is currently allocated and available for reuse
FREE_SPACE = space that is currently allocated and available for reuse + space that is currently unallocated>
I use the below script which I've plagiarised from somewhere ages ago to get the used/free temp space.
SELECT A.tablespace_name tablespace, D.mb_total,
SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_used,
D.mb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024 mb_free
FROM v$sort_segment A,
SELECT B.name, C.block_size, SUM (C.bytes) / 1024 / 1024 mb_total
FROM v$tablespace B, v$tempfile C
WHERE B.ts#= C.ts#
GROUP BY B.name, C.block_size
) D
WHERE A.tablespace_name = D.name
GROUP by A.tablespace_name, D.mb_total;
Similar Messages
-
Administer datafiles, tablespaces and free space
Hi all,
Firstly i want to apologize if my English is not very good, and secondly for if there is such topic already. I tried the "search" but didn't find something that suits my requirements...
We are using Oracle9i.
Here is the (potential) problem:
I noticed that the some of the filesystems soon will run out of space.
Example:
/dev/vg07/lv_data7 71671808 68657701 2825782 96% /var/application/oracle/data07
/dev/vg07/lv_data6 71671808 58102994 12720766 82% /var/application/oracle/data06
/dev/vg07/lv_data5 71671808 69448894 2084034 97% /var/application/oracle/data05
/dev/vg07/lv_data4 71671808 67765635 3662100 95% /var/application/oracle/data04
/dev/vg06/lv_data3 71675904 65840498 5470722 92% /var/application/oracle/data03
/dev/vg05/lv_data2 71675904 65730929 5573472 92% /var/application/oracle/data02
/dev/vg03/lv_data1 70656000 65924095 4436216 94% /var/application/oracle/data01
/dev/vg10/lv_data10 292929536 7301210 267776605 3% /var/application/oracle/data10
/dev/vg10/lv_data11 292929536 0 292929536 0% /var/application/oracle/data11
Lets for example take a look at data05:
/var/application/oracle/data05 > ls -l
There are many tablespaces and some of their datafiles there.
-rw-r----- 1 oracle dba 367005696 Jul 21 13:19 e1_data_d_d_11.dbf
-rw-r----- 1 oracle dba 209719296 Jul 21 13:20 e1_data_d_d_12.dbf
-rw-r----- 1 oracle dba 1022365696 Jul 21 13:19 m_data_d_07.dbf
-rw-r----- 1 oracle dba 812650496 Jul 21 13:19 m_data_d_08.dbf
-rw-r----- 1 oracle dba 707792896 Jul 21 13:19 m_data_d_09.dbf
-rw-r----- 1 oracle dba 2097156096 Jul 21 13:19 e_data_d_30.dbf
-rw-r----- 1 oracle dba 734007296 Jul 21 13:20 e_data_d_38.dbf
-rw-r----- 1 oracle dba 629149696 Jul 21 13:20 e_data_d_39.dbf
-rw-r----- 1 oracle dba 419434496 Jul 21 13:20 e_data_d_40.dbf
-rw-r----- 1 oracle dba 812650496 Jul 21 13:25 m1_data_d_03.dbf
-rw-r----- 1 oracle dba 393220096 Jul 21 13:27 m1_data_d_04.dbf
-rw-r----- 1 oracle dba 209719296 Jul 21 13:20 m1_data_d_05.dbf
-rw-r----- 1 oracle dba 2097160192 Jul 21 13:19 m1_data__03.dbf
-rw-r----- 1 oracle dba 2097160192 Jul 21 13:39 m1_data__04.dbf
-rw-r----- 1 oracle dba 2097160192 Jul 21 13:19 m1_data__05.dbf
-rw-r----- 1 oracle dba 2097160192 Jul 21 13:39 m1_data__06.dbf
-rw-r----- 1 oracle dba 2097160192 Jul 21 13:19 m3_data_d_d_03.dbf
-rw-r----- 1 oracle dba 2097160192 Jul 21 13:42 m3_data_d_d_04.dbf
-rw-r----- 1 oracle dba 1572872192 Jul 21 13:20 m3_data_d_d_05.dbf
drwxr-xr-x 2 root root 96 Nov 21 2006 lost+found
-rw-r----- 1 oracle dba 942678016 Jul 21 13:19 system02.dbf
-rw-r----- 1 oracle dba 72359936 Jul 21 13:20 system04.dbf
The situation is similar in the other filesystems - various tablespaces and a lot of datafiles.
Perhaps you've noticed that /data10 and /data11 are empty.
What is the best approach in this situation so that we start using those two filesystems .
Is moving datafiles from heavily used filesystems to the empty ones there is a good solution?
My idea is to make Oracle to automatically extend the tabespaces over the empty volumes and start creating the new datafiles there, but i am not sure how exactly to do that.
Any help will be appreciated.
Regards.
/R
Message was edited by:
user648100Thanks for the quick reply.
MYH,
Yes, the tablespaces are autoextend on. Here is the information about one of them from the GridControl:
Name e1_data_d_d
Status ReadWrite
Type Permanent
Extent Management local
Storage
Allocation Type Automatic
Segment Space Management Automatic
Enable logging Yes
Block Size (B) 4096
I did not understand the second question - about partition a datafile?!? I can move datafiles but i'm still learning... never heard of partitioning a file, sorry.
Yas, i think the datafiles are Oracle Managed and oracle, after filling up a file, creates the new datafile automatically. I can create new file within the empty filesystems, but isn't it dangerous.
And with regards to same question - if i create a new datafiles, or move old datafiles - will Oracle start to use the new filesystems automatically? -
How does repeated snapshot import impact tablespace free space?
Hello,
Our client is doing DEC-2014 reconciliation in FCM. Every time he changes profile mappings he has to do snapshot import again. So far he did at least ten times snapshot import for DEC-2014 period. In our FCM database Tablespace FCM_TX_TS_DATA free space is reduced 7 GB for this period already by querrying dba_free_space table.
By my understanding during the repeated snapshot import for the same period, the previous load data is deleted and the current load data is inserted. After data delete the table space will not be set free, and high water mark will not be reset.
During snapshot import will the deleted blocks from the previous load be reclaimed when new load data is inserted in the table? If not, what is the best way to reclaim the free space in FCM_TX_TS_DATA tablespace?
Thanks,
Hongfei Liu (AT&T)Przemek P wrote:
Hallo. I need to replace all schemas from one server to another. I want to know how much free space will be left on /data after this kind of refresh. Both servers are Oracle 9 so I will use exp/imp. Here is how I do it. Could you check if I think good? On target server there is 72 GB free space on /data.
Filesystem Size Used Avail Capacity Mounted
/dev/vgsmxdata/lvsmxcopy 194.74G 122.56G 72.18G 63% /data
Overall size of schemas to be exported from SOURCE_DB is 150 GB. The same schemas on TARGET_DB takes 90GB. So difference is 60GB. Free space in datafiles in TARGET_DB is 30GB. Does it mean that in first place the free space in datafiles will be filled and after that datafiles would be extended? That would mean that a database would extend to 150GB and free space on /data would be 40 GB after refresh. Am I right?
yes -
SQL> show parameter block
NAME TYPE VALUE
db_block_buffers integer 0
db_block_checking boolean FALSE
db_block_checksum boolean TRUE
db_block_size integer 8192
db_file_multiblock_read_count integer 8
SQL> SELECT tablespace_name,
total_blocks,
used_blocks,
free_blocks,
(total_blocks*8)/1024 as total_MB,
(used_blocks*8)/1024 as used_MB,
(free_blocks*8)/1024 as free_MB
FROM v$sort_segment;
2 3 4 5 6 7 8
TABLESPACE_NAME TOTAL_BLOCKS USED_BLOCKS FREE_BLOCKS TOTAL_MB USED_MB FREE_MB
TEMP 72704 2944 69760 568 23 545
SQL> select (sum(bytes_free)/1024/1024) Size_MB from v$temp_space_header
order by file_id 2
3 /
SIZE_MB
1479
SQL>
My version is 9.2.0.7
why temp free space is different in both queries above..
which one is correct.....why temp free space is different in both queries above..Because you are looking at two different values.
V$SORT_SEGMENT gives details about the sort segment created in a temporary tablespace. The sort segment created may or may not be of the same size as the complete temporary tablespace. In your case, the sort segment has a total size of 568 MB but only 23 MB is being used.
V$TEMP_SPACE_HEADER refers to the physical files allocated to the temporary tablespace; so the other query is giving you the free bytes in those files. -
Performance problem - Tablespace Free Space
Hi,
Version 10204
I am running the following statment in order to monitor tablespace free space.
There are some tablespaces that i am not interesting to monitor , and i also whant to be alert
only when less than 4 GB left in the tablespace.
I build the following statment.
Using the hint : /*+ NO_CPU_COSTING */ gave me the best performance but there are alot of time
that its took to this statment few minute to run befor it finished.
Could one help to improve its performance ?
Please note that it performe even less good when i used the RULE hint or not using hint at all.
SELECT /*+ gather_plan_statistics */ 'tablespace_free_space;'||to_char(pct_used,'999.99')||','||TBSNAME
FROM( SELECT *
FROM( SELECT NVL(b.tablespace_name, NVL(a.tablespace_name,'UNKOWN')) TBSNAME,
MBytes_alloc,
maxbytes,
MBytes_max,
ROUND(MBytes_alloc-NVL(MBytes_free,0),2) used,
ROUND(NVL(MBytes_free,0),2) free,
MBytes_free,
ROUND(DECODE( MBytes_max, 0,((MBytes_alloc-NVL(MBytes_free,0))/MBytes_alloc)*100,100*(MBytes_alloc) / maxbytes),2)PCT_USED
FROM ( SELECT /*+ NO_CPU_COSTING */ SUM(bytes)/1024/1024 MBytes_free,
MAX(bytes)/1024/1024 largest,
tablespace_name
FROM sys.DBA_FREE_SPACE
WHERE TABLESPACE_NAME NOT IN
('Q405_CALLS_TS','Q405_ICALLS_TS',
'Q305_CALLS_TS','Q305_ICALLS_TS',
'Q205_ICALLS_TS','Q306_CALLS_TS',
'Q406_CALLS_TS','Q206_CALLS_TS',
'Q205_CALLS_TS','Q105_CALLS_TS',
'Q105_ICALLS_TS','Q206_CALLS_TS','Q106_CALLS_TS',
'Q306_ICALLS_TS','Q107_ICALLS_TS','Q406_ICALLS_TS',
'Q206_ICALLS_TS','UNLMT_INTERNET_CALLS_2006_TS',
'UNLMT_INTERNET_CALLS_2007_TS',
'UNLMT_INTERNET_CALLS_2008_TS',
'Q107_ICALLS_TBS','Q107_CALLS_TBS',
'Q207_ICALLS_TBS','Q207_CALLS_TBS',
'Q307_ICALLS_TBS','Q307_CALLS_TBS',
'Q407_ICALLS_TBS','Q407_CALLS_TBS',
'Q408_ICALLS_TS','Q408_CALLS_TS',
'Q308_ICALLS_TS','Q308_CALLS_TS',
'Q208_ICALLS_TS','Q208_CALLS_TS',
'Q108_ICALLS_TS','Q108_CALLS_TS',
'Q109_ICALLS_TS','Q109_CALLS_TS',
'UNLMT_INT_CALLS_Q308_TS',
'UNLMT_INT_ICALLS_Q308_TS',
'UNLMT_INT_CALLS_Q408_TS',
'UNLMT_INT_ICALLS_Q408_TS'
GROUP BY tablespace_name ) a,
( SELECT SUM(bytes)/1024/1024 MBytes_alloc,
SUM(maxbytes)/1024/1024 MBytes_max,
SUM(DECODE (autoextensible,'YES',maxbytes/1024/1024,'NO', BYTES/1024/1024 )) maxbytes,
tablespace_name
FROM DBA_DATA_FILES
WHERE TABLESPACE_NAME NOT IN
('Q405_CALLS_TS','Q405_ICALLS_TS',
'Q305_CALLS_TS','Q305_ICALLS_TS',
'Q205_ICALLS_TS','Q306_CALLS_TS',
'Q406_CALLS_TS','Q206_CALLS_TS',
'Q205_CALLS_TS','Q105_CALLS_TS',
'Q105_ICALLS_TS','Q206_CALLS_TS',
'Q106_CALLS_TS','Q306_ICALLS_TS',
'Q107_ICALLS_TS','Q406_ICALLS_TS',
'Q206_ICALLS_TS','UNLMT_INTERNET_CALLS_2006_TS',
'UNLMT_INTERNET_CALLS_2007_TS',
'UNLMT_INTERNET_CALLS_2008_TS',
'Q107_ICALLS_TBS','Q107_CALLS_TBS',
'Q207_ICALLS_TBS','Q207_CALLS_TBS',
'Q307_ICALLS_TBS','Q307_CALLS_TBS',
'Q407_ICALLS_TBS','Q407_CALLS_TBS',
'Q408_ICALLS_TS','Q408_CALLS_TS',
'Q308_ICALLS_TS','Q308_CALLS_TS',
'Q208_ICALLS_TS','Q208_CALLS_TS',
'Q108_ICALLS_TS','Q108_CALLS_TS',
'Q109_ICALLS_TS','Q109_CALLS_TS',
'UNLMT_INT_CALLS_Q308_TS',
'UNLMT_INT_ICALLS_Q308_TS',
'UNLMT_INT_CALLS_Q408_TS',
'UNLMT_INT_ICALLS_Q408_TS'
GROUP BY tablespace_name) b
WHERE a.tablespace_name (+) = b.tablespace_name
AND (a.MBytes_free<4000 or a.MBytes_free is null)
ORDER BY PCT_USED DESC
WHERE TBSNAME not in (select tablespace_name from dba_tablespaces where contents in ('UNDO'))
and ROWNUM =1;
select * from table(dbms_xplan.display_cursor('42hppgtx2h1gb',0,'ALLSTATS LAST'));
Plan hash value: 2979461796
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | Reads | OMem | 1Mem | Used-Mem |
|* 1 | COUNT STOPKEY | | 1 | | 1 |00:00:15.52 | 146K| 8927 | | | |
|* 2 | FILTER | | 1 | | 1 |00:00:15.52 | 146K| 8927 | | | |
| 3 | VIEW | | 1 | 3 | 1 |00:00:15.52 | 146K| 8927 | | | |
| 4 | SORT ORDER BY | | 1 | 3 | 1 |00:00:15.52 | 146K| 8927 | 2048 | 2048 | 2048 (0)|
|* 5 | FILTER | | 1 | | 16 |00:00:15.52 | 146K| 8927 | | | |
|* 6 | HASH JOIN OUTER | | 1 | 3 | 25 |00:00:15.52 | 146K| 8927 | 561K| 561K| 982K (0)|
| 7 | VIEW | | 1 | 2 | 25 |00:00:02.95 | 105K| 0 | | | |
| 8 | HASH GROUP BY | | 1 | 2 | 25 |00:00:02.95 | 105K| 0 | 447K| 447K| 977K (0)|
| 9 | VIEW | DBA_DATA_FILES | 1 | 2 | 217 |00:00:03.25 | 105K| 0 | | | |
| 10 | UNION-ALL | | 1 | | 217 |00:00:03.25 | 105K| 0 | | | |
| 11 | NESTED LOOPS | | 1 | 1 | 0 |00:00:00.67 | 219 | 0 | | | |
| 12 | NESTED LOOPS | | 1 | 1 | 0 |00:00:00.67 | 219 | 0 | | | |
| 13 | MERGE JOIN CARTESIAN | | 1 | 1 | 52297 |00:00:00.22 | 0 | 0 | | | |
|* 14 | FIXED TABLE FULL | X$KCCFN | 1 | 1 | 217 |00:00:00.01 | 0 | 0 | | | |
| 15 | BUFFER SORT | | 217 | 100 | 52297 |00:00:00.06 | 0 | 0 | 11264 | 11264 |10240 (0)|
| 16 | FIXED TABLE FULL | X$KCCFE | 1 | 100 | 241 |00:00:00.01 | 0 | 0 | | | |
|* 17 | TABLE ACCESS BY INDEX ROWID| FILE$ | 52297 | 1 | 0 |00:00:00.52 | 219 | 0 | | | |
|* 18 | INDEX UNIQUE SCAN | I_FILE1 | 52297 | 1 | 217 |00:00:00.24 | 2 | 0 | | | |
|* 19 | TABLE ACCESS CLUSTER | TS$ | 0 | 1 | 0 |00:00:00.01 | 0 | 0 | | | |
|* 20 | INDEX UNIQUE SCAN | I_TS# | 0 | 1 | 0 |00:00:00.01 | 0 | 0 | | | |
| 21 | NESTED LOOPS | | 1 | 1 | 217 |00:00:02.58 | 105K| 0 | | | |
| 22 | NESTED LOOPS | | 1 | 1 | 52297 |00:00:01.89 | 104K| 0 | | | |
| 23 | MERGE JOIN CARTESIAN | | 1 | 1 | 52297 |00:00:00.22 | 217 | 0 | | | |
| 24 | NESTED LOOPS | | 1 | 1 | 217 |00:00:00.02 | 217 | 0 | | | |
|* 25 | FIXED TABLE FULL | X$KCCFN | 1 | 1 | 217 |00:00:00.01 | 0 | 0 | | | |
|* 26 | FIXED TABLE FIXED INDEX | X$KTFBHC (ind:1) | 217 | 1 | 217 |00:00:00.01 | 217 | 0 | | | |
| 27 | BUFFER SORT | | 217 | 100 | 52297 |00:00:00.11 | 0 | 0 | 11264 | 11264 |10240 (0)|
| 28 | FIXED TABLE FULL | X$KCCFE | 1 | 100 | 241 |00:00:00.01 | 0 | 0 | | | |
|* 29 | TABLE ACCESS CLUSTER | TS$ | 52297 | 1 | 52297 |00:00:01.41 | 104K| 0 | | | |
|* 30 | INDEX UNIQUE SCAN | I_TS# | 52297 | 1 | 52297 |00:00:00.37 | 2 | 0 | | | |
|* 31 | TABLE ACCESS BY INDEX ROWID | FILE$ | 52297 | 1 | 217 |00:00:00.57 | 219 | 0 | | | |
|* 32 | INDEX UNIQUE SCAN | I_FILE1 | 52297 | 1 | 217 |00:00:00.28 | 2 | 0 | | | |
| 33 | VIEW | | 1 | 1401 | 25 |00:00:12.56 | 40846 | 8927 | | | |
| 34 | HASH GROUP BY | | 1 | 1401 | 25 |00:00:12.56 | 40846 | 8927 | 465K| 465K| 982K (0)|
| 35 | VIEW | DBA_FREE_SPACE | 1 | 1401 | 73133 |00:00:14.19 | 40846 | 8927 | | | |
| 36 | UNION-ALL | | 1 | | 73133 |00:00:14.04 | 40846 | 8927 | | | |
| 37 | NESTED LOOPS | | 1 | 1 | 0 |00:00:00.01 | 45 | 0 | | | |
| 38 | NESTED LOOPS | | 1 | 1 | 0 |00:00:00.01 | 45 | 0 | | | |
| 39 | TABLE ACCESS FULL | FET$ | 1 | 1 | 0 |00:00:00.01 | 45 | 0 | | | |
|* 40 | INDEX UNIQUE SCAN | I_FILE2 | 0 | 1 | 0 |00:00:00.01 | 0 | 0 | | | |
|* 41 | TABLE ACCESS CLUSTER | TS$ | 0 | 1 | 0 |00:00:00.01 | 0 | 0 | | | |
| 42 | NESTED LOOPS | | 1 | 5 | 7271 |00:00:00.20 | 1156 | 0 | | | |
| 43 | NESTED LOOPS | | 1 | 6 | 7271 |00:00:00.14 | 1154 | 0 | | | |
|* 44 | TABLE ACCESS FULL | TS$ | 1 | 2 | 25 |00:00:00.01 | 45 | 0 | | | |
|* 45 | FIXED TABLE FIXED INDEX | X$KTFBFE (ind:1) | 25 | 3 | 7271 |00:00:00.11 | 1109 | 0 | | | |
|* 46 | INDEX UNIQUE SCAN | I_FILE2 | 7271 | 1 | 7271 |00:00:00.04 | 2 | 0 | | | |
| 47 | NESTED LOOPS | | 1 | 1394 | 65862 |00:00:17.73 | 39476 | 8927 | | | |
| 48 | NESTED LOOPS | | 1 | 30528 | 65862 |00:00:16.94 | 39474 | 8927 | | | |
|* 49 | HASH JOIN | | 1 | 2540 | 8927 |00:00:00.03 | 90 | 0 | 811K| 811K| 1397K (0)|
| 50 | TABLE ACCESS FULL | RECYCLEBIN$ | 1 | 8319 | 8935 |00:00:00.01 | 45 | 0 | | | |
|* 51 | TABLE ACCESS FULL | TS$ | 1 | 2 | 25 |00:00:00.01 | 45 | 0 | | | |
|* 52 | FIXED TABLE FIXED INDEX | X$KTFBUE (ind:1) | 8927 | 12 | 65862 |00:00:11.66 | 39384 | 8927 | | | |
|* 53 | INDEX UNIQUE SCAN | I_FILE2 | 65862 | 1 | 65862 |00:00:00.45 | 2 | 0 | | | |
|* 54 | TABLE ACCESS BY INDEX ROWID | RECYCLEBIN$ | 1 | 1 | 0 |00:00:00.01 | 169 | 0 | | | |
| 55 | NESTED LOOPS | | 1 | 1 | 1 |00:00:00.01 | 169 | 0 | | | |
| 56 | NESTED LOOPS | | 1 | 1 | 0 |00:00:00.01 | 169 | 0 | | | |
| 57 | NESTED LOOPS | | 1 | 1 | 0 |00:00:00.01 | 169 | 0 | | | |
| 58 | TABLE ACCESS FULL | UET$ | 1 | 1 | 0 |00:00:00.01 | 169 | 0 | | | |
|* 59 | INDEX UNIQUE SCAN | I_FILE2 | 0 | 1 | 0 |00:00:00.01 | 0 | 0 | | | |
|* 60 | TABLE ACCESS CLUSTER | TS$ | 0 | 1 | 0 |00:00:00.01 | 0 | 0 | | | |
|* 61 | INDEX UNIQUE SCAN | I_TS# | 0 | 1 | 0 |00:00:00.01 | 0 | 0 | | | |
|* 62 | INDEX RANGE SCAN | RECYCLEBIN$_TS | 0 | 1188 | 0 |00:00:00.01 | 0 | 0 | | | |
|* 63 | TABLE ACCESS FULL | TS$ | 1 | 1 | 0 |00:00:00.01 | 45 | 0 | | | |
Predicate Information (identified by operation id):
1 - filter(ROWNUM=1)
2 - filter( IS NULL)
5 - filter(("A"."MBYTES_FREE"<4000 OR "A"."MBYTES_FREE" IS NULL))
6 - access("A"."TABLESPACE_NAME"="B"."TABLESPACE_NAME")
14 - filter(("INST_ID"=USERENV('INSTANCE') AND "FNNAM" IS NOT NULL AND BITAND("FNFLG",4)<>4 AND "FNTYP"=4))
PLAN_TABLE_OUTPUT
17 - filter(("F"."SPARE1" IS NULL AND "F"."TS#" IS NOT NULL))
18 - access("FE"."FENUM"="F"."FILE#")
filter("FNFNO"="F"."FILE#")
19 - filter(("TS"."NAME"<>'Q405_CALLS_TS' AND "TS"."NAME"<>'Q405_ICALLS_TS' ... AND "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
20 - access("F"."TS#"="TS"."TS#")
25 - filter(("INST_ID"=USERENV('INSTANCE') AND "FNNAM" IS NOT NULL AND BITAND("FNFLG",4)<>4 AND "FNTYP"=4))
26 - filter("FNFNO"="HC"."KTFBHCAFNO")
29 - filter(("TS"."NAME"<>'Q405_CALLS_TS' AND "TS"."NAME"<>'Q405_ICALLS_TS' AND ... AND "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
30 - access("HC"."KTFBHCTSN"="TS"."TS#")
31 - filter("F"."SPARE1" IS NOT NULL)
32 - access("FE"."FENUM"="F"."FILE#")
filter("FNFNO"="F"."FILE#")
40 - access("F"."TS#"="FI"."TS#" AND "F"."FILE#"="FI"."RELFILE#")
PLAN_TABLE_OUTPUT
filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
41 - filter(("TS"."TS#"="F"."TS#" AND "TS"."BITMAPPED"=0 AND "TS"."NAME"<>'Q405_CALLS_TS' AND "TS"."NAME"<>'Q405_ICALLS_TS' AND
"TS"."NAME"<>'Q305_CALLS_TS' AND "TS"."NAME"<>'Q305_ICALLS_TS' AND ... "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
44 - filter(("TS"."BITMAPPED"<>0 AND INTERNAL_FUNCTION("TS"."ONLINE$") AND .... "TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
45 - filter("TS"."TS#"="F"."KTFBFETSN")
46 - access("F"."KTFBFETSN"="FI"."TS#" AND "F"."KTFBFEFNO"="FI"."RELFILE#")
filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
49 - access("TS"."TS#"="RB"."TS#")
51 - filter(("TS"."BITMAPPED"<>0 AND INTERNAL_FUNCTION("TS"."ONLINE$") AND...."TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
52 - filter(("U"."KTFBUESEGTSN"="RB"."TS#" AND "U"."KTFBUESEGFNO"="RB"."FILE#" AND "U"."KTFBUESEGBNO"="RB"."BLOCK#"))
53 - access("RB"."TS#"="FI"."TS#" AND "U"."KTFBUEFNO"="FI"."RELFILE#")
filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
PLAN_TABLE_OUTPUT
54 - filter(("U"."SEGFILE#"="RB"."FILE#" AND "U"."SEGBLOCK#"="RB"."BLOCK#"))
59 - access("U"."TS#"="FI"."TS#" AND "U"."SEGFILE#"="FI"."RELFILE#")
filter(("FI"."TS#" IS NOT NULL AND "FI"."RELFILE#" IS NOT NULL))
60 - filter(("TS"."BITMAPPED"=0 AND "TS"."NAME"<>'Q405_CALLS_TS' AND .... AND "TS"."NAME"<>'UNLMT_INT_CALLS_Q408_TS' AND
"TS"."NAME"<>'UNLMT_INT_ICALLS_Q408_TS'))
61 - access("TS"."TS#"="U"."TS#")
62 - access("U"."TS#"="RB"."TS#")
63 - filter((DECODE("TS"."CONTENTS$",0,DECODE(BITAND("TS"."FLAGS",16),16,'UNDO','PERMANENT'),1,'TEMPORARY')='UNDO' AND "TS"."ONLINE$"<>3 AND
BITAND("FLAGS",2048)<>2048 AND LNNVL("TS"."NAME"<>:B1)))
Note
PLAN_TABLE_OUTPUT
- cpu costing is off (consider enabling it)Version 10204
I am running the following statment in order to monitor tablespace free space.
There are some tablespaces that i am not interesting to monitor , and i also whant to be alert
only when less than 4 GB left in the tablespace.
And just adding to Dan's reply, if you are on 10g as you mentioned, why not to use the built in Alert mechanism to monitor and get alerts about the tablespace usage using the GC or Database Console than creating a home grown solution like the one you have posted?
Aman.... -
To know the amount of free space in a tablespace
hi,
I'm learning oracle 9i release 9.2.0.1.0 .I'd created a tablespace 'TOOLS' for being used as the default tablespace for Statspack.
I wish to know the amount of free space available in this tablespace. For this purpose I ran the following query but there was no rows selected :-
SQL> select tablespace_name,bytes from dba_free_space
2 where tablespace_name='TOOLS';
no rows selected
SQL> select name from v$tablespace;
NAME
CWMLITE
DRSYS
EXAMPLE
INDX
ODM
SYSTEM
TOOLS
UNDOTBS1
USERS
XDB
TEMP
Can anyone tell the reason for this.I tried your query
SQL> select TABLESPACE_NAME,
2 sum(BYTES) Total_free_space,
3 max(BYTES) largest_free_extent
4 from dba_free_space
5 group by TABLESPACE_NAME;
♀TABLESPACE_NAME TOTAL_FREE_SPACE LARGEST_FREE_EXTENT
CWMLITE 11141120 10878976
DRSYS 10813440 10813440
EXAMPLE 131072 131072
INDX 26148864 26148864
ODM 11206656 11206656
SYSTEM 3211264 3080192
UNDOTBS1 199229440 196149248
USERS 26083328 26083328
XDB 196608 196608
9 rows selected.
Again there were no rows for TOOLS tablespace. -
Free space in temport tablespaces
Hi. In my database i have TEMP tablespace with extent management LOCAL.
In DBA studio it shows total space 8000M and free space 7996
when i query v$sort_segment
select substr(TABLESPACE_NAME,1,10) ts_name,EXTENT_SIZE,CURRENT_USERS,
TOTAL_EXTENTS,TOTAL_BLOCKS,FREE_EXTENTS,FREE_BLOCKS
from v$sort_segment;
it shows
TS_NAME EXTENT_SIZE CURRENT_USERS TOTAL_EXTENTS TOTAL_BLOCKS FREE_EXTENTS
FREE_BLOCKS
TEMP 128 0 7996 1023488 7996
1023488
where as when i query v$temp_space_header
select TABLESPACE_NAME,BYTES_USED,BLOCKS_USED,BYTES_FREE,BLOCKS_FREe
FROM v$temp_space_header;
TABLESPACE_NAME BYTES_USED BLOCKS_USED BYTES_FREE BLOCKS_FREE
TEMP 2097152000 256000 0 0
TEMP 2097152000 256000 0 0
TEMP 2097152000 256000 0 0
TEMP 2097152000 256000 0 0
I have no active queries going on in database.
i would like to know few things..
a). why there is a discrepency between free_extents,free_blocks of v$sort_segment
and bytes_free_blocks_free of v$temp_space_header.
b). if i shutdown the database and restart will this v$emp_space_header view gets updated and thus shows actual free space.
please let me have the answers at the earliest.
thanks in advance..Hi. In my database i have TEMP tablespace with extent management LOCAL.
In DBA studio it shows total space 8000M and free space 7996
when i query v$sort_segment
select substr(TABLESPACE_NAME,1,10) ts_name,EXTENT_SIZE,CURRENT_USERS,
TOTAL_EXTENTS,TOTAL_BLOCKS,FREE_EXTENTS,FREE_BLOCKS
from v$sort_segment;
it shows
TS_NAME EXTENT_SIZE CURRENT_USERS TOTAL_EXTENTS TOTAL_BLOCKS FREE_EXTENTS
FREE_BLOCKS
TEMP 128 0 7996 1023488 7996
1023488
where as when i query v$temp_space_header
select TABLESPACE_NAME,BYTES_USED,BLOCKS_USED,BYTES_FREE,BLOCKS_FREe
FROM v$temp_space_header;
TABLESPACE_NAME BYTES_USED BLOCKS_USED BYTES_FREE BLOCKS_FREE
TEMP 2097152000 256000 0 0
TEMP 2097152000 256000 0 0
TEMP 2097152000 256000 0 0
TEMP 2097152000 256000 0 0
I have no active queries going on in database.
i would like to know few things..
a). why there is a discrepency between free_extents,free_blocks of v$sort_segment
and bytes_free_blocks_free of v$temp_space_header.
b). if i shutdown the database and restart will this v$emp_space_header view gets updated and thus shows actual free space.
please let me have the answers at the earliest.
thanks in advance.. -
How to find free space in a Tablespace?
Hi,
I have a limited access to objects in my database ( do not have access to many tables).
I have been allocated 300GB of size in my tablespace which allows me to create my objects.
Now, I want to find out how much of this tablespace size allocated to me have been used up. I do not have access to dba_data_files or dba_segments.
Is there a way out for me? Could anyone show me a way please?This query will give you the required information but it makes use of DBA tables.
SELECT B.TABLESPACE_NAME, TBS_SIZE SIZEGB, A.FREE_SPACE FREEGB
from (select tablespace_name, round(sum(bytes)/1024/1024/1024 ,2) as free_space
from dba_free_space
GROUP BY TABLESPACE_NAME) A,
(select tablespace_name, sum(bytes)/1024/1024/1024 as tbs_size
from dba_data_files
group by tablespace_name) b
where a.tablespace_name(+)=b.tablespace_name;
However, you said that you are aware of your tablespace details so the above query can be modified to get the free space in your tablespace. Now I am using user_frees_space and not dba_free_space. Generally user* tables are and should be made accessible to the users.
select tablespace_name, round(sum(bytes)/1024/1024/1024 ,2) as free_space
from user_free_space
where tablespace_name = 'Your tablespace name'
GROUP BY TABLESPACE_NAME;
Ishan -
Hi All,
Is it possible to collect data about free space in tablespaces in GC (in some table)?
I'd like to have history of free space in tablespaces. Now I have some sql script which is triggered once per day and store output in the file.Hi All,
Is it possible to collect data about free space in tablespaces in GC (in some table)?
I'd like to have history of free space in tablespaces. Now I have some sql script which is triggered once per day and store output in the file. -
Hi,
in DB version 9.2.0, after all transactions are committed, the occupied blocks in UNDO tablespace will be free or not ?
The same just after startup, before any transaction the free space in UNDO tablespace would be at max ?
Many thanks.Hello Dear copy this script and paste in the sql prompt and it will show your how much total space table have, or how much is used and how much it is free
SELECT Total.name "Tablespace Name",
nvl(Free_space, 0) Free_space,
nvl(total_space-Free_space, 0) Used_space,
total_space
FROM
(select tablespace_name, sum(bytes/1024/1024) Free_Space
from sys.dba_free_space
group by tablespace_name
) Free,
(select b.name, sum(bytes/1024/1024) TOTAL_SPACE
from sys.v_$datafile a, sys.v_$tablespace B
where a.ts# = b.ts#
group by b.name
) Total
WHERE Free.Tablespace_name(+) = Total.name
ORDER BY Total.name -
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 -
Set tablespace free space (mb) for a single large tablespace?
It seems that in EM, setting the free space (mb) for locally managed tablespaces affects all of my locally managed tablespaces in the database and not just one.
I clicked on Tablespace, Edit (button), Thresholds and set the Free Space (MB) Warning and Critical. I thought I was setting it for a particular tablespace (because I chose Edit on a single tablespace). But then I got alerts from much smaller tablespaces because those tablespaces had much smaller MB than the thresholds that I just set.
Using EM GC, is there a way to set the free space (mb) to alert for a single large tablespace where defining a critical free space mb is better than setting a free space percent?ok, go to the database you want to manage.
Then click on Metric and Policy Settings (link at the very bottom).
Scroll down to the 'Tablespace Space Used (%)' metric, and click on the edit button
Now, click on the 'add' button to setup settings for individual tablespaces.
Bazza -
Stange free space in tablespace
Checking a space usage of my tablespace using those queries http://vsbabu.org/oracle/sect03.html (especially query which name USAGE) shows me that one of my table is about 100GB big, but 90GB is free space?! So only 10% of space is used. Can I do something with this "empty" space?
Sure. Below is listing from my all tablespaces files:
'FILE_NAME' USER_BYTES/1024/1024 BYTES/1024/1024 MAXBYTES/1024/1024 AUTOEXTENSIBLE
file_name_1 4,9375 5 32767,984375 YES
file_name_2 32767,875 32767,984375 32767,984375 YES
file_name_3 613,125 613,1875 32767,984375 YES
file_name_4 5219,9375 5220 32767,984375 YES
file_name_5 32767,875 32767,984375 32767,984375 YES
file_name_6 9071,625 9071,6875 32767,984375 YES
file_name_7 74,9375 75 32767,984375 YES
file_name_8 32767,875 32767,984375 32767,984375 YES
file_name_9 32767,875 32767,984375 32767,984375 YES
file_name_10 24,9375 25 32767,984375 YES
file_name_11 32767,875 32767,984375 32767,984375 YES
file_name_12 191,75 191,8125 32767,984375 YES
file_name_13 124,9375 125 32767,984375 YES
file_name_14 9669,9375 9670 32767,984375 YES
file_name_15 29851,875 29852 32767,984375 YES
file_name_16 1000,6875 1000,75 32767,984375 YES
file_name_17 32767,875 32767,984375 32767,984375 YES
file_name_18 32761,9375 32762,0625 32767,984375 YES
file_name_19 20031,9375 20032 32767,984375 YES
file_name_20 22171,9375 22172 32767,984375 YES
file_name_21 3999,9375 4000 0 NO
file_name_22 49,9375 50 32767,984375 YES
22 rows selected At this output it doesn't look as bad as in previous queries, does it?
Edited by: lesak on Jun 18, 2011 11:29 AM -
Find the free space of autoextensible enabled tablespaces
Hi All,
I need to create a shell script to find the free space of an autoextensible tablespaces and send an alert when the free space is < 700MB.
I tried checking with the dba_free_space, but I did not get the exact free space.
Can someone tell me the logic to find the exact free space of autoextensible enabled tablespaces?
Thanks,
VBKYou may want to look into dba_free_space_coalesced table.
SQL> desc dba_free_space_coalesced;
Name Null? Type
TABLESPACE_NAME VARCHAR2(30)
TOTAL_EXTENTS NUMBER
EXTENTS_COALESCED NUMBER
PERCENT_EXTENTS_COALESCED NUMBER
TOTAL_BYTES NUMBER
BYTES_COALESCED NUMBER
TOTAL_BLOCKS NUMBER
BLOCKS_COALESCED NUMBER
PERCENT_BLOCKS_COALESCED NUMBERTablespace Name - Name of tablespace
Total Extents - Total number of free extents in tablespace
Extents Coalesced - Total number of coalesced free extents in tablespace
% Extents Coalesced - Percentage of coalesced free extents in tablespace
Total Bytes - Total number of free bytes in tablespace
Bytes Coalesced - Total number of coalesced free bytes in tablespace
Total Blocks - Total number of free oracle blocks in tablespace
Blocks Coalesced - Total number of coalesced free Oracle blocks in tablespace
% Blocks Coalesced - Percentage of coalesced free Oracle blocks in tablespace
so for getting the usage you can query like
select a.TABLESPACE_NAME,
2 a.BYTES bytes_used,
3 b.BYTES bytes_free,
4 b.largest,
5 round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used
6 from
7 (
8 select TABLESPACE_NAME,
9 sum(BYTES) BYTES
10 from dba_data_files
11 group by TABLESPACE_NAME
12 )
13 a,
14 (
15 select TABLESPACE_NAME,
16 sum(BYTES) BYTES ,
17 max(BYTES) largest
18 from dba_free_space
19 group by TABLESPACE_NAME
20 )
21 b
22 where a.TABLESPACE_NAME=b.TABLESPACE_NAME
23 order by ((a.BYTES-b.BYTES)/a.BYTES) desc
24 ;I think this is what you were asking. -
Temp Tablespace space needed to create an index of 52GB - preventing 01652
Hi,
I've seen quiet a few threads on the subject, but could not find a clear (to me) answer on the subject.
We have a huge table made by 30/40 partitions of roughly 20M records each (each record being about 1k of size), overall 800GB.
The index we already have shows:
1* select sum(bytes/1024/1024) from dba_segments where segment_name like 'CALL_LOG_I0'
SQL> /
SUM(BYTES/1024/1024)
52088
so that I assume it's 52GB in size. Since we have to create another very similar one I would assume the size would be similar.
Command would be:
create index call_log_i0_new on call_log (msisdn, generation_timestamp, cdr_reference_number, Multiple_AMA_Sequence_Number) NOLOGGING online;
Tried the NOSORT option but it's not compatible with the online option.
After a while the TEMP tablespace got filled up (we have about 20GB space in there).
My question is if I need to have a temp tablespace at least as big as the index size (52GB) to let the index be built online.
Thanks in advance !
Cheers,
MikeThanks to all, found useful information in Metalink following your suggestions:
You need to add more space to the tablespace where the index is created.
A possible option to reduce sort space usage is to use the NOSORT option.
Your table contains 66 million rows. The average row length is
50-60 bytes and you are indexing 4 of 5 columns in the table.
Example space calculation:
66 million rows * 50 (avg row length) = 3.3 gig of data
Rule of thumb:
upper bound for sort (not guaranteed) is 3 times data_
= about 10 gig of sort space needed
These numbers are scaring since assume that I may need much more space than the index size (about 3x) which is something we cannot afford. Will go with the NOSORT option once the system is brought down and we could skip the online option.
Thanks to all !
Mike
Maybe you are looking for
-
Hi all, Previously, we were using OBIEE 11.1.1.5.0 and we were able to assign users to application roles by using the initialization block to assign the ROLES session variables. 1. My USER_SECURITY table in Oracle database: USER_NAME | USER_ID | ROL
-
Java Plug-in 1.4.2_01 error
Hi, Sometimes when I access certain websites with java programs I get the following pop-up error "Java Plug-in 1.4.2_01 is not installed properly". It then asks if I would like to open a new browser as the one I'm using apparently won't support the v
-
Help! Frameworks accidentally changed
Using Mac OSX Leopard. Accidentally I moved, not copied, a framework from one place to another, now, not suprisingly, no applications will start. I have started the computer in single user mode but I can't get the syntax right to copy the folder back
-
Regarding Oracle Apps Financial Training
Dear All, Can anyone tell me which is the Best Oracle Apps Financial Training Institute in Mumbai or Pune. Apart from iWareLogic and Oracle University i.e Oracle Authorised Education Partner. Regards Hitesh Parsawala
-
Hi all, I am creating one ALE connection.In this connection error is occurs.The error No is 29( Error in ALE service). 1.How to resolve the this error. 2.If any ALE&IDOC creation error occurs,How to resolve. 3. ALE creation single cleint is wo