Temp tablespace - why so big?
Temp tablespace (size 6gb) is twice the size of my data and index tablespace combined. I am running into space issues and am wondering is it possible to resize this tablespace and/or take some other action to prevent the temp tablespace getting so relatively large?
Thanks in advance.
The Temporary Tablespace holds only 1 Temporary Segment shared all by all user sessions. Each session takes one or more extents. When a session finishes its operation, it "releases" the extent it used for use by another session but the size of the Segment does NOT shrink.
Therefore, the Segment would grow to the peak concurrent temporary extent usage -- eg at some point in time, if you had 4 very large queries running concurently taking up 8GB then the segment would have grown to 8GB. However, even if you never have such concurrent usage (for example the normal load is for 20 users concurrently taking up 500MB only !), the segment remains at 8GB.
In some environments, the Temporary tablespace could grow during periodic (say Monthly Reporting) batch jobs after which it is dropped and recreated again.
This segment is used not just for "SORT" operations. It is also used for HASH JOIN overflows to disk and also for SORT MERGE operations.
You can monitor the size of the segment in V$SORT_SEGMENT. You can monitor users currently using it in V$SORT_USAGE or V$TEMPSEG_USAGE.
Hemant K Chitale
http://hemantoracledba.blogpsot.com
Similar Messages
-
Temp tablespace grow too big???
we have EBS R12.1 on LINUX X86_64 with ORACLE database version 11.1.0.7. every week we have temporary tablespace grow too big (> 32 GB) and out of extent.
Based on our research some some sql statement or report cause this issue. if we 'analyze stratistics", most time problem can fix. It cause us some time need run "analyze statistics" several times in one day.
Does anyone have solution for this?
Thanks.Please see if these docs help.
Temporary Segments: What Happens When a Sort Occurs [ID 102339.1]
Queries to monitor Temporary Tablespace usage [ID 289894.1]
How Can Temporary Segment Usage Be Monitored Over Time? [ID 364417.1]
Thanks,
Hussein -
Can you tell me why my temp tablespace can not release automatically?
when i up the database, the temp tablespace is used by o,but after some time it is used 99.99%,even all the task are finished,it is still used 99.99%,and can not release automatically!
who can tell me than is why?Are you receiving an error ?
A "Temporary" tablespace manages it's allocation differently than a normal tablespace. The idea is to avoid the overhead of extent allocation, etc.
Take a look at:
http://asktom.oracle.com/pls/ask/f?p=4950:8:134496932618587661::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:108812348061,
or
http://asktom.oracle.com/pls/ask/f?p=4950:8:134496932618587661::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1384603628260,
or (these URLs don't seem to be pasting correctly)
go to Ask Tom and search on "temporary" in the "page contains" option in advance search.
Ken -
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; -
Generating xml using PL/SQL taking a lot of space in TEMP tablespace
We wrote a stored procedure that generate xml which will be stored in a CLOB column. Environment is 9i on Windows 2003.
The gnerated xml is about 800K. In the procedure there is one big cursor that will retrieve 200 records of 55 fields and many other small dynamic cursors that open and close here and there. The fields are pretty small. Biggest ones are like varchar2(30). The query for the big cursor does using union and need sorting.
Can anyone explain why it takes about 15G of TEMP tablespace to accomplish this job and is there a way to avoid this?The version is Enterprise Edition 9.2.0.1.0.
Below is the query.
SELECT ROWNUM + ( SELECT NVL(MAX(WQX_ACTIVITY_GEN_ID), 0) FROM WQX_ACTIVITY ) as WQX_ACTIVITY_GEN_ID
, A.ACTIVITYIDENTIFIER2 as ACTIVITY_IDENTIFIER
, (SELECT MAX(O.ORGANIZATION_NAME) FROM SYS_ORGANIZATION O WHERE O.ORGANIZATION_ID = 111242) as ORGANIZATION_NAME
, (SELECT MAX(P.PROJECT_IDENTIFIER) FROM SYS_PROJECT P WHERE P.PROJECT_ID = 111242) as PROJECT_IDENTIFIER
, A.ACTIVITYTYPECODE as ACTIVITY_TYPE_CD
, A.ActivityMediaName as ACTIVITY_MEDIA_NAME
, A.ActivityMediaSubDivisionName as MEDIA_SUB_DIVISION
, A.ActivityStartDate as ACTIVITY_START_DATE
, CASE WHEN A.ActivityStartTime is not NULL THEN
substr(A.ActivityStartTime,1,2)||':'||substr(A.ActivityStartTime,3,2)||':00'
WHEN A.ActivityStartTime is NULL THEN ''
END as ACTIVITY_START_TIME
-- , substr(A.ActivityStartTime,1,2)||':'||substr(A.ActivityStartTime,3,2)||':00' as ACTIVITY_START_TIME
, A.ACTIVITYENDDATE as ACTIVITY_END_DATE
, CASE WHEN A.ACTIVITYENDTIME is not NULL THEN
substr(A.ACTIVITYENDTIME,1,2)||':'||substr(A.ACTIVITYENDTIME,3,2)||':00'
WHEN A.ACTIVITYENDTIME is NULL THEN ''
END as ACTIVITY_END_TIME
-- , substr(A.ACTIVITYENDTIME,1,2)||':'||substr(A.ACTIVITYENDTIME,3,2)||':00' as ACTIVITY_END_TIME
, A.TIMEZONECODE1 as TIME_ZONE_CD
, A.ActivityRelativeDepthName as RELATIVE_DEPTH_NAME
, NULL as DEPTH_HEIGHT_MEASURE
, NULL as DEPTH_HEIGHT_UNIT
, 111242 as MONITORING_LOC_ID
, A.ACTIVITYCOMMENTTEXT as COMMENT_
, A.SamplerName as SAMPLER_NAME
, A.ActivityArea as ACTIVITY_AREA
, A.ReportingRound as REPORTING_ROUND
, A.SamplePanel as SAMPLEPANEL
, A.DataIncludedinReport as DATA_INCLUDED_IN_REPORT
, A.FlowStatusIndicator as FLOW_STATUS_IND
, A.SampleChainOfCustody as SAMPLE_COC
, A.ActivitySeason as ACTIVITY_SEASON
, A.RunoffImpact as RUNOFF_IMPACT
, (111242) as MONI_LOC_ID
, (SELECT MAX(B.MONI_LOC_IDENTIFIER) FROM WQX_MONITORING_LOC B WHERE B.MONI_LOC_IDENTIFIER = A.MONITORINGLOCATIONIDENTIFIER) as MONI_LOC_IDENTIFIER
, 111242 as PROJECT_ID
, NULL as BIO_ASSEMB_SAMPLED_NAME
, NULL as BIO_TOXICITY_TEST_TYPE
, A.METHODIDENTIFIER1 as SAMPLE_COLLECT_METHOD_IDENTIFI
, A.METHODIDENTIFIERCONTEXT1 as SAMPLE_COLLECT_METHOD_CONTEXT
, A.METHODNAME1 as SAMPLE_COLLECT_METHOD_NAME
, NULL as SAMPLE_COLLECT_QUALIFIER_TYPE
, A.METHODDESCRIPTIONTEXT1 as SAMPLE_COLLECT_DESC
, A.SampleCollectionEquipmentName as SAMPLE_COLLECT_EQUIP_NAME
, A.SAMPLECOLLECTIONEQUIPMENTTXT as SAMPLE_COLLECT_EQUIP_DESC
, A.METHODNAME2 as SAMPLE_PREP_METHOD_NAME
, A.METHODIDENTIFIER2 as SAMPLE_PREP_METHOD_IDENTIFIER
, A.METHODIDENTIFIERCONTEXT2 as SAMPLE_PREP_METHOD_CONTEXT
, NULL as SAMPLE_PREP_QUALIFIER_TYPE
, A.METHODDESCRIPTIONTEXT1 as SAMPLE_PREP_DESC
, A.SampleContainerTypeName as SAMPLE_CONTAINER_TYPE
, A.SampleContainerColorName as SAMPLE_CONTAINER_COLOR
, A.ChemicalPreservativeUsedName as CHEM_PRESERVATIVE_USED
, A.ThermalPreservativeUsedName as THERMAL_PRESERVATIVE_USED
, A.SAMPLETRANSPORTSTORAGEDESC as SAMPLE_TRANS_STORAGE
, A.AnalysisStartTime as AnalysisStartTime
, A.AnalysisEndTime as AnalysisEndTime
, A.MethodSpeciationName as MethodSpeciationName
, A.ResultLaboratoryCommentCode as ResultLaboratoryCommentCode
, A.UnidentifiedSpeciesIdentifier as UnidentifiedSpeciesIdentifier
FROM TMP_CHEMACTIVITYRESULTS A
WHERE A.SUBMISSION_ID = 111242
AND A.ACTIVITYIDENTIFIER2 NOT IN
( SELECT ACTIVITY_IDENTIFIER FROM WQX_ACTIVITY )
UNION
SELECT X.WQX_ACTIVITY_GEN_ID as WQX_ACTIVITY_GEN_ID
, A.ACTIVITYIDENTIFIER2 as ACTIVITY_IDENTIFIER
, (SELECT MAX(O.ORGANIZATION_NAME) FROM SYS_ORGANIZATION O WHERE O.ORGANIZATION_ID = 111242) as ORGANIZATION_NAME
, (SELECT MAX(P.PROJECT_IDENTIFIER) FROM SYS_PROJECT P WHERE P.PROJECT_ID = 111242) as PROJECT_IDENTIFIER
, NVL(A.ACTIVITYTYPECODE, (SELECT MAX(ACTYP_CD) FROM REF_ACTIVITY_TYPE WHERE TO_CHAR(ACTYP_UID) = TO_CHAR(X.ACTIVITY_TYPE_CD))) as ACTIVITY_TYPE_CD
, NVL(A.ActivityMediaName, X.ACTIVITY_MEDIA_NAME) as ACTIVITY_MEDIA_NAME
, NVL(A.ActivityMediaSubDivisionName, X.MEDIA_SUB_DIVISION) as MEDIA_SUB_DIVISION
, NVL(A.ActivityStartDate, TO_CHAR(X.ACTIVITY_START_DTTM, 'YYYY-MM-DD')) as ACTIVITY_START_DATE
, CASE WHEN A.ActivityStartTime is not NULL THEN
substr(A.ActivityStartTime,1,2)||':'||substr(A.ActivityStartTime,3,2)||':00'
WHEN A.ActivityStartTime is NULL THEN ''
END as ACTIVITY_START_TIME
-- , NVL((substr(A.ActivityStartTime,1,2)||':'||substr(A.ActivityStartTime,3,2)||':00'), TO_CHAR(X.ACTIVITY_START_DTTM, 'HH24:MI:SS')) as ACTIVITY_START_TIME
, NVL(A.ACTIVITYENDDATE, TO_CHAR(X.ACTIVITY_END_DTTM, 'YYYY-MM-DD')) as ACTIVITY_END_DATE
, NVL(A.ACTIVITYENDDATE, TO_CHAR(X.ACTIVITY_END_DTTM, 'HH24:MI:SS')) as ACTIVITY_END_TIME
, NVL(A.TIMEZONECODE1, X.TIME_ZONE_CD) as TIME_ZONE_CD
, NVL(A.ActivityRelativeDepthName, X.RELATIVE_DEPTH_NAME) as RELATIVE_DEPTH_NAME
, X.DEPTH_HEIGHT_MEASURE as DEPTH_HEIGHT_MEASURE
, X.DEPTH_HEIGHT_UNIT as DEPTH_HEIGHT_UNIT
, NVL(111242, X.MONITORING_LOC_ID) as MONITORING_LOC_ID
, NVL(A.ACTIVITYCOMMENTTEXT, X.COMMENT_) as COMMENT_
, NVL(A.SamplerName, X.SAMPLER_NAME) as SAMPLER_NAME
, NVL(A.ActivityArea, X.ACTIVITY_AREA) as ACTIVITY_AREA
, NVL(A.ReportingRound, X.REPORTING_ROUND) as REPORTING_ROUND
, NVL(A.SamplePanel, X.SAMPLEPANEL) as SAMPLEPANEL
, NVL(A.DataIncludedinReport, X.DATA_INCLUDED_IN_REPORT) as DATA_INCLUDED_IN_REPORT
, NVL(A.FlowStatusIndicator, X.FLOW_STATUS_IND) as FLOW_STATUS_IND
, NVL(A.SampleChainOfCustody, X.SAMPLE_COC) as SAMPLE_COC
, NVL(A.ActivitySeason, X.ACTIVITY_SEASON) as ACTIVITY_SEASON
, NVL(A.RunoffImpact, X.RUNOFF_IMPACT) as RUNOFF_IMPACT
, (111242) as MONI_LOC_ID
, (SELECT MAX(B.MONI_LOC_IDENTIFIER) FROM WQX_MONITORING_LOC B WHERE B.MONI_LOC_IDENTIFIER = A.MONITORINGLOCATIONIDENTIFIER) as MONI_LOC_IDENTIFIER
, 111242 as PROJECT_ID
, X.BIO_ASSEMB_SAMPLED_NAME as BIO_ASSEMB_SAMPLED_NAME
, X.BIO_TOXICITY_TEST_TYPE as BIO_TOXICITY_TEST_TYPE
, NVL(A.METHODIDENTIFIER1, X.SAMPLE_COLLECT_METHOD_IDENTIFI) as SAMPLE_COLLECT_METHOD_IDENTIFI
, NVL(A.METHODIDENTIFIERCONTEXT1, X.SAMPLE_COLLECT_METHOD_CONTEXT) as SAMPLE_COLLECT_METHOD_CONTEXT
, X.SAMPLE_COLLECT_METHOD_NAME as SAMPLE_COLLECT_METHOD_NAME
, X.SAMPLE_COLLECT_QUALIFIER_TYPE as SAMPLE_COLLECT_QUALIFIER_TYPE
, NVL(A.METHODDESCRIPTIONTEXT1, X.SAMPLE_COLLECT_DESC) as SAMPLE_COLLECT_DESC
, NVL(A.SampleCollectionEquipmentName, X.SAMPLE_COLLECT_EQUIP_NAME) as SAMPLE_COLLECT_EQUIP_NAME
, NVL(A.SAMPLECOLLECTIONEQUIPMENTTXT, X.SAMPLE_COLLECT_EQUIP_DESC) as SAMPLE_COLLECT_EQUIP_DESC
, NVL(A.METHODNAME2, X.SAMPLE_PREP_METHOD_NAME) as SAMPLE_PREP_METHOD_NAME
, NVL(A.METHODIDENTIFIER2, X.SAMPLE_PREP_METHOD_IDENTIFIER) as SAMPLE_PREP_METHOD_IDENTIFIER
, NVL(A.METHODIDENTIFIERCONTEXT2, X.SAMPLE_PREP_METHOD_CONTEXT) as SAMPLE_PREP_METHOD_CONTEXT
, X.SAMPLE_PREP_QUALIFIER_TYPE as SAMPLE_PREP_QUALIFIER_TYPE
, NVL(A.METHODDESCRIPTIONTEXT1, X.SAMPLE_PREP_DESC) as SAMPLE_PREP_DESC
, NVL(A.SampleContainerTypeName, X.SAMPLE_CONTAINER_TYPE) as SAMPLE_CONTAINER_TYPE
, NVL(A.SampleContainerColorName, X.SAMPLE_CONTAINER_COLOR) as SAMPLE_CONTAINER_COLOR
, NVL(A.ChemicalPreservativeUsedName, X.CHEM_PRESERVATIVE_USED) as CHEM_PRESERVATIVE_USED
, NVL(A.ThermalPreservativeUsedName, X.THERMAL_PRESERVATIVE_USED) as THERMAL_PRESERVATIVE_USED
, NVL(A.SAMPLETRANSPORTSTORAGEDESC, X.SAMPLE_TRANS_STORAGE) as SAMPLE_TRANS_STORAGE
, NVL(A.AnalysisStartTime, '') as AnalysisStartTime
, NVL(A.AnalysisEndTime, '') as AnalysisEndTime
, NVL(A.MethodSpeciationName, '') as MethodSpeciationName
, NVL(A.ResultLaboratoryCommentCode, '') as ResultLaboratoryCommentCode
, NVL(A.UnidentifiedSpeciesIdentifier, '') as UnidentifiedSpeciesIdentifier
FROM TMP_CHEMACTIVITYRESULTS A
JOIN WQX_ACTIVITY X ON A.ACTIVITYIDENTIFIER2 = X.ACTIVITY_IDENTIFIER
WHERE A.SUBMISSION_ID = 111242; -
TEMP tablespace getting full while inserting a CLOB in Trigger
We have a Oracle 10g (10.2.0.4.0) DB on a Solaris 9 box which also runs our J2EE web-service application on Weblogic 8sp6 server.
We get around 220K web-service requests from upstream callers daily to insert data in the main table, say TABLE1, which has daily partitions on a date column. This table has around 21 columns out of which 1 is a CLOB column.
Now this table has an AFTER INSERT trigger which calls a package procedure to insert the same record into another table, say TABLE2.
From Java application insert statement in executed in below format using a weblogic jdbc connection pool :
INSERT INTO TABLE1(COLUMN1, COLUMN2, ........., CLOB_COLUMN,........, COLUMN21) VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20);
Clob object is prepared in application using ojdbc14.jar.
We are observing a strange issue here. The TEMP tablespace utilization keeps on growing as more and more inserts are executed by application and after ~125K inserts the TEMP tablespace gets full and we start getting ORA-01652 error.
On further analysis we could see that there are only 7-10 session being maintained but as more and more inserts happen TEMP tablespace utilization goes on increasing for each of these sessions.
When we tried with inserting just few records and then watching the session details in v$session_wait then we could see that it is in INACTIVE state and waiting for the event ‘SQL*Net message from client’. This does not seem correct as the session has successfully inserted the data and committed the transaction and we can see the data in the tables as well.
The confusing thing here is when we modify the trigger to pass blank string('' ) instead of the CLOB column to TABLE2 then this issue does not occur. All 200K records are inserted properly and TEMP tablespace utilization also keep always below 1%.
Can you please help us in solving this issue. Is this related to any oracle issue?
Inside the package we have tried using DBMS_COPY statement to copy the CLOB column after insert but still same result.
Code for reference:
Trigger:
=====================================
CREATE OR REPLACE TRIGGER trg
AFTER INSERT OR UPDATE
ON TABLE1
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
IF (:NEW.date_col > SYSDATE - 2)
THEN
IF (:NEW.cat IN (1001, 1002))
THEN
pkg.process_change
(:NEW.COLUMN1,
:NEW.COLUMN2,
:NEW.CLOB_COLUMN,
FLAG
END IF;
END IF;
END;
=====================================
Package:
=====================================
procedure PKG.Process_change(
p_COLUMN1 number,
p_COLUMN2 varchar2,
p_CLOB_COLUMN clob,
flag boolean
) is
v_watermark pls_integer;
v_type varchar2(1);
begin
if (flag) then
v_type := 'U';
else
v_type := 'I';
end if;
select t_seq.nextval into v_watermark from dual;
insert into TABLE2(
COLUMN1 number,
COLUMN2 varchar2,
CLOB_COLUMN clob,
watermark,
dml_type
)values (
p_COLUMN1 number,
p_COLUMN2 varchar2,
p_CLOB_COLUMN clob,
v_watermark,
v_dml_type
end;
=====================================My first thought on reading your post is that not only are you using a database version that is now so old it is in extended support and even then not even the most recent patchset for it.
The first thing I would do is move to 11gR2 and if you can't do that at least get to 10.2.0.5 and apply CLOB relevant patches as well.
Same goes for your operating system. Solaris 9 is ancient: So move to 10 which has vastly improved memory management.
To help you further it would be really valuable to know the table layout. For example is this a heap table or an IOT? Is it partitioned? Is this RAC? What size are the CLOBs? Are they stored in-line? Chunk size? etc.
This page should start you down the right road:
http://docs.oracle.com/cd/B19306_01/appdev.102/b14249/adlob_tables.htm#sthref204
But I am also wondering why you would use a trigger to, as you say, "insert the same record into another table." This description is a poster child for "bad design." -
9i on Linux. Problems with Temp tablespace cleanup
I am currently running Oracle 9i Enterprise on SUSE Linux 7.2.
I am executing queries against the new XMLType datatype and every query adds to the Temp tablespace, which doesn't get cleaned up. Eventually, the tablespace will run out of space and Oracle will issue and error:
ORA-01652: unable to extend temp segment by 128 in tablespace <name>
The only way to clean up the Temp tablespace seems to be by restarting the server.
Is that happening on other platforms as well? I would appreciate any help.Hi
You can connect to the database as DBA (Sys or System) and make a bigger temporal tablespace. Or create a new bigger temporary tablespace and assign it to the user.
A10!
PS: Temporary tablespace is used when no memory available for the session, for example when a big ORDER BY is done. Try to increase the memory assigned, just look at initXXX.ora (sort_size) -
Hello All,
I am using Oracle 11g R2 i want to increase the temp tablespace size. can i use the below command? can i increase while the database is open and some queries are running and use the temp table space?
ALTER DATABASE TEMPFILE '....../datafile/name_datafile.tmp' RESIZE 100M
Regards,Hello,
I am using Oracle 11g R2 i want to increase the temp tablespace size. can i use the below command? can i increase while the database is open and some queries are running and use the temp table space?Why do you intend to extend the Temporary Tablespace ? Do you have any ORA-01652 error ?
If not, may be it's not necessary to extend it. Even if it seems to be full Free Extents are reused.
ALTER DATABASE TEMPFILE '....../datafile/name_datafile.tmp' RESIZE 100MYes you can use this statement, but be aware that the Size specified (here 100 Mo) is the target size not the supplemental size.
Hope this help.
Best regards,
Jean-Valentin -
Relation between temp tablespace and index creation
Hi,
I have my Oracle database (11gR1) on windows 2008 server R1 64 bit..
This is my development database. i have one table which has more than 2 billion rows , the problem i m facing here is while creating the index on this table i m getting temp segment error , while my temp tablespace size is 32 gb.
Here my doubt is :
1.What will happen in temp tablespace when index is created ? Relation between temp and index creation ?
2. how to create the index on a huge table?
3. What is the meaning og logging and no logging in INDEX creation .
4. how can we over come for these kind of problem and manage the temp TS..
Thanks & Regards,
Vikash Chauradiaadd another tempfile?
1.What will happen in temp tablespace when index is created ? Relation between temp and index creation ?
index creation needs sort. how much depends on the size of the index.
2. how to create the index on a huge table?
create an interim (temporary? :)) huge temporary space for the very purpose.
http://docs.oracle.com/cd/B28359_01/server.111/b28310/indexes003.htm#i1006643
3. What is the meaning og logging and no logging in INDEX creation .
nologging means you the creation isnt in the logs so if you need to recover you cant get back to it. when using nologging in a prod env you might do it for performance during a period of heavy dml such as a large index creation and then backup afterwards. common enough.
4. how can we over come for these kind of problem and manage the temp TS..
current tempspace size =X
is X big enough? if yes, cup of tea, if no, make X bigger.
It doesnt matter what X is. -
Maximum Temp tablespace size you've seen
DB version: 10.2.0.4
Our DB caters a retail application . Total DB Size of 3TB. Its is a bit of mix of both OLTP and Batch processing environment.
Our temp tablespace has 1 file and we had set the tempfile as AUTOEXTEND. Somehow its size has reached 25GB now !
We don't actually need this. Do we?
For a fairly busy DB of around 3TB size, what is the maximum temp tablespace size you've ever seen?
What is the maximum temp tablespace size you've ever seen for Big DB like Telecom, Banking?The point about temp space is that your requirements are dynamic - the actively used area shrinks and grows.
Comparing apples with oranges, tempfile sizes on system where I am currently here amount to 50 GB but to be honest that's mainly due to a not insignificant number of pretty poor queries, run concurrently, with multipass operations, etc.
Kellyn Pedersen had an example of a process using 720GB here:
http://dbakevlar.com/?p=43
Whilst 25GB may not be earth shattering, a "large" temp area may perhaps be an indicator that you want to review some of your application code.
(What is "large"? "unusual" compared to what is "normal" for your system may be a better metric)
If you're using automatic pga memory management, then there's a limit to what each session can get, it may be that automatic work areas are not suitable for some of your code and some manual sizing is required to prevent operations spilling unnecessarily.
Also, inaccurate CBO estimates on your queries can lead to inaccurately sized work areas that then spill into temp.
There was a reminder of this in one of Randolf Geist's articles on hash aggregation:
http://oracle-randolf.blogspot.com/2011/01/hash-aggregation.html -
Hi all,
We have an Oracle 10.2.0.4 Reporting database, of which every night al lot of data is refreshed from production databases.
For this refresh this database uses complex Materialized View definitions.
We recently keep running out of TEMP tablespace during the refresh of these MV's. The TEMP tablespace has lately been increased several times ( in total from 15Gb to 25Gb the last months).
The largets MV is just 3Gb's big. Especially the one that ran out of TEMP tablespace last night is only 1Gb big.
The error message:
ORA-12008: error in materialized view refresh path
ORA-12801: error signaled in parallel query server P002
ORA-01652: unable to extend temp segment by 64 in tablespace TEMP
Can anyone tell me what could cause this behaviour ??
Some specs:
Oracle 10.2.0.4
Platform: AIX 5.3 TL06
sga_target = 3504M
parallel_max_servers=8
temp_tablespace_size=25600Mb
Thanks in advanceThey are COMPLETE refreshes.
Statement of the view:
SELECT /*+ NO_USE_HASH_AGGREGATION */
mon.mon_description AS mon_mon_descr, mon.mon_code AS mon_mon_code,
mon.yer_code AS mon_yer_code, cus.iet_descr AS cus_iet_descr,
prd.igp_nr AS prd_igp_nr, prd.igp_descr_german AS prd_igp_descr_ger,
prd.igp_descr_dutch AS prd_igp_descr_dut,
prd.igp_descr_english AS prd_igp_descr_eng,
prd.igp_descr_czech AS prd_igp_descr_ces,
prd.igp_descr_russian AS prd_igp_descr_rus, prd.pgp_nr AS prd_pgp_nr,
prd.pgp_descr_german AS prd_pgp_descr_ger,
prd.pgp_descr_dutch AS prd_pgp_descr_dut,
prd.pgp_descr_english AS prd_pgp_descr_eng,
prd.pgp_descr_czech AS prd_pgp_descr_ces,
prd.pgp_descr_russian AS prd_pgp_descr_rus, prd.dvs_nr AS prd_dvs_nr,
prd.dvs_descr_german AS prd_dvs_descr_ger,
prd.dvs_descr_dutch AS prd_dvs_descr_dut,
prd.dvs_descr_english AS prd_dvs_descr_eng,
prd.dvs_descr_czech AS prd_dvs_descr_ces,
prd.dvs_descr_russian AS prd_dvs_descr_rus,
cus.pce_descr AS cus_pce_descr, cus.smk_descr AS cus_smk_descr,
cus.org_descr AS cus_org_descr, cus.dpm_descr AS cus_dpm_descr,
cus.cmp_descr AS cus_cmp_descr, cus.cgp_descr AS cus_cgp_descr,
cus.cus_nr AS cus_cus_nr, cus.cus_descr AS cus_cus_descr,
cus.cus_billto_nr AS cus_billto_nr,
SUM (fin.invoice_discount_eur) AS invoice_discount_eur,
SUM (fin.invoice_discount_gbp) AS invoice_discount_gbp,
SUM (fin.invoice_line_discount_eur) AS invoice_line_discount_eur,
SUM (fin.invoice_line_discount_gbp) AS invoice_line_discount_gbp,
SUM (fin.turnover_cr_eur) AS turnover_cr_eur,
SUM (fin.turnover_cr_gbp) AS turnover_cr_gbp,
SUM (fin.turnover_deb_eur) AS turnover_deb_eur,
SUM (fin.turnover_deb_gbp) AS turnover_deb_gbp,
SUM (fin.turnover_eur) AS turnover_eur,
SUM (fin.turnover_gbp) AS turnover_gbp,
SUM (fin.count_credit_slips) AS count_credit_slips,
cus.srp_nr AS cus_srp_nr, cus.srp_descr AS cus_srp_descr,
COUNT (*) AS total_records,
COUNT (fin.count_credit_slips) AS num_count_credit_slips,
cus.cus_branch AS cus_branch_nr, cus.cus_district AS cus_district_nr,
SUM (fin.profit_eur) AS profit_eur,
SUM (fin.profit_gbp) AS profit_gbp,
SUM (fin.cost_price_eur) AS costs_eur,
SUM (fin.cost_price_gbp) AS costs_gbp,
SUM (fin.invoice_discount_chf) AS invoice_discount_chf,
SUM (fin.invoice_line_discount_chf) AS invoice_line_discount_chf,
SUM (fin.turnover_cr_chf) AS turnover_cr_chf,
SUM (fin.turnover_deb_chf) AS turnover_deb_chf,
SUM (fin.turnover_chf) AS turnover_chf,
SUM (fin.profit_chf) AS profit_chf,
SUM (fin.cost_price_chf) AS costs_chf,
SUM (fin.invoice_discount_czk) AS invoice_discount_czk,
SUM (fin.invoice_line_discount_czk) AS invoice_line_discount_czk,
SUM (fin.turnover_cr_czk) AS turnover_cr_czk,
SUM (fin.turnover_deb_czk) AS turnover_deb_czk,
SUM (fin.turnover_czk) AS turnover_czk,
SUM (fin.profit_czk) AS profit_czk,
SUM (fin.cost_price_czk) AS costs_czk,
SUM (fin.invoice_discount_rub) AS invoice_discount_rub,
SUM (fin.invoice_line_discount_rub) AS invoice_line_discount_rub,
SUM (fin.turnover_cr_rub) AS turnover_cr_rub,
SUM (fin.turnover_deb_rub) AS turnover_deb_rub,
SUM (fin.turnover_rub) AS turnover_rub,
SUM (fin.profit_rub) AS profit_rub,
SUM (fin.cost_price_rub) AS costs_rub,
COUNT (fin.invoice_discount_eur) AS cnt_invoice_discount_eur,
COUNT (fin.invoice_discount_gbp) AS cnt_invoice_discount_gbp,
COUNT
(fin.invoice_line_discount_eur)
AS cnt_invoice_line_discount_eur,
COUNT
(fin.invoice_line_discount_gbp)
AS cnt_invoice_line_discount_gbp,
COUNT (fin.turnover_cr_eur) AS cnt_turnover_cr_eur,
COUNT (fin.turnover_cr_gbp) AS cnt_turnover_cr_gbp,
COUNT (fin.turnover_deb_eur) AS cnt_turnover_deb_eur,
COUNT (fin.turnover_deb_gbp) AS cnt_turnover_deb_gbp,
COUNT (fin.turnover_eur) AS cnt_turnover_eur,
COUNT (fin.turnover_gbp) AS cnt_turnover_gbp,
COUNT (fin.profit_eur) AS cnt_profit_eur,
COUNT (fin.profit_gbp) AS cnt_profit_gbp,
COUNT (fin.cost_price_eur) AS cnt_costs_eur,
COUNT (fin.cost_price_gbp) AS cnt_costs_gbp,
COUNT (fin.invoice_discount_chf) AS cnt_invoice_discount_chf,
COUNT
(fin.invoice_line_discount_chf)
AS cnt_invoice_line_discount_chf,
COUNT (fin.turnover_cr_chf) AS cnt_turnover_cr_chf,
COUNT (fin.turnover_deb_chf) AS cnt_turnover_deb_chf,
COUNT (fin.turnover_chf) AS cnt_turnover_chf,
COUNT (fin.profit_chf) AS cnt_profit_chf,
COUNT (fin.cost_price_chf) AS cnt_costs_chf,
COUNT (fin.invoice_discount_czk) AS cnt_invoice_discount_czk,
COUNT
(fin.invoice_line_discount_czk)
AS cnt_invoice_line_discount_czk,
COUNT (fin.turnover_cr_czk) AS cnt_turnover_cr_czk,
COUNT (fin.turnover_deb_czk) AS cnt_turnover_deb_czk,
COUNT (fin.turnover_czk) AS cnt_turnover_czk,
COUNT (fin.profit_czk) AS cnt_profit_czk,
COUNT (fin.cost_price_czk) AS cnt_costs_czk,
COUNT (fin.invoice_discount_rub) AS cnt_invoice_discount_rub,
COUNT
(fin.invoice_line_discount_rub)
AS cnt_invoice_line_discount_rub,
COUNT (fin.turnover_cr_rub) AS cnt_turnover_cr_rub,
COUNT (fin.turnover_deb_rub) AS cnt_turnover_deb_rub,
COUNT (fin.turnover_rub) AS cnt_turnover_rub,
COUNT (fin.profit_rub) AS cnt_profit_rub,
COUNT (fin.cost_price_rub) AS cnt_costs_rub
FROM /* dwh_internal_external_dim iet */
dwh_customers_dim cus /* department */
, dwh_products_dim prd /* itemgroup */
, dwh_months_dim mon
, dwh_financial_fct fin
WHERE fin.mon_code = mon.mon_code
AND fin.prd_id = prd.prd_id
AND fin.cus_cus_id = cus.cus_id
GROUP BY mon.mon_description,
mon.mon_code,
mon.yer_code,
cus.iet_descr,
prd.igp_nr,
prd.igp_descr_german,
prd.igp_descr_dutch,
prd.igp_descr_english,
prd.igp_descr_czech,
prd.igp_descr_russian,
prd.pgp_nr,
prd.pgp_descr_german,
prd.pgp_descr_dutch,
prd.pgp_descr_english,
prd.pgp_descr_czech,
prd.pgp_descr_russian,
prd.dvs_nr,
prd.dvs_descr_german,
prd.dvs_descr_dutch,
prd.dvs_descr_english,
prd.dvs_descr_czech,
prd.dvs_descr_russian,
cus.pce_descr,
cus.smk_descr,
cus.org_descr,
cus.dpm_descr,
cus.cmp_descr,
cus.cgp_descr,
cus.cus_nr,
cus.cus_descr,
cus.cus_billto_nr,
cus.srp_nr,
cus.srp_descr,
cus.cus_branch,
cus.cus_district;
Explain plan:
Plan
SELECT STATEMENT CHOOSE Cost: 278,496 Bytes: 13,752,541,260 Cardinality: 18,864,940
25 PX COORDINATOR
24 PX SEND QC (RANDOM) PARALLEL_TO_SERIAL SYS.:TQ10005 :Q1005 Cost: 278,496 Bytes: 13,752,541,260 Cardinality: 18,864,940
23 SORT GROUP BY PARALLEL_COMBINED_WITH_PARENT :Q1005 Cost: 278,496 Bytes: 13,752,541,260 Cardinality: 18,864,940
22 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1005 Cost: 278,496 Bytes: 13,752,541,260 Cardinality: 18,864,940
21 PX SEND HASH PARALLEL_TO_PARALLEL SYS.:TQ10004 :Q1004 Cost: 278,496 Bytes: 13,752,541,260 Cardinality: 18,864,940
20 SORT GROUP BY PARALLEL_COMBINED_WITH_PARENT :Q1004 Cost: 278,496 Bytes: 13,752,541,260 Cardinality: 18,864,940
19 HASH JOIN PARALLEL_COMBINED_WITH_PARENT :Q1004 Cost: 26,390 Bytes: 13,752,541,260 Cardinality: 18,864,940
4 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1004 Cost: 55 Bytes: 11,394,614 Cardinality: 70,774
3 PX SEND BROADCAST PARALLEL_TO_PARALLEL SYS.:TQ10000 :Q1000 Cost: 55 Bytes: 11,394,614 Cardinality: 70,774
2 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1000 Cost: 55 Bytes: 11,394,614 Cardinality: 70,774
1 TABLE ACCESS FULL TABLE PARALLEL_COMBINED_WITH_PARENT MIS_RUN.DWH_CUSTOMERS_DIM :Q1000 Cost: 55 Bytes: 11,394,614 Cardinality: 70,774
18 HASH JOIN PARALLEL_COMBINED_WITH_PARENT :Q1004 Cost: 26,300 Bytes: 10,715,285,920 Cardinality: 18,864,940
8 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1004 Cost: 2 Bytes: 2,052 Cardinality: 108
7 PX SEND BROADCAST PARALLEL_TO_PARALLEL SYS.:TQ10001 :Q1001 Cost: 2 Bytes: 2,052 Cardinality: 108
6 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1001 Cost: 2 Bytes: 2,052 Cardinality: 108
5 TABLE ACCESS FULL TABLE PARALLEL_COMBINED_WITH_PARENT MIS_RUN.DWH_MONTHS_DIM :Q1001 Cost: 2 Bytes: 2,052 Cardinality: 108
17 HASH JOIN PARALLEL_COMBINED_WITH_PARENT :Q1004 Cost: 26,264 Bytes: 10,356,852,060 Cardinality: 18,864,940
12 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1004 Cost: 305 Bytes: 178,954,440 Cardinality: 426,082
11 PX SEND HASH PARALLEL_TO_PARALLEL SYS.:TQ10002 :Q1002 Cost: 305 Bytes: 178,954,440 Cardinality: 426,082
10 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1002 Cost: 305 Bytes: 178,954,440 Cardinality: 426,082
9 TABLE ACCESS FULL TABLE PARALLEL_COMBINED_WITH_PARENT MIS_RUN.DWH_PRODUCTS_DIM :Q1002 Cost: 305 Bytes: 178,954,440 Cardinality: 426,082
16 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1004 Cost: 11,396 Bytes: 2,433,577,260 Cardinality: 18,864,940
15 PX SEND HASH PARALLEL_TO_PARALLEL SYS.:TQ10003 :Q1003 Cost: 11,396 Bytes: 2,433,577,260 Cardinality: 18,864,940
14 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1003 Cost: 11,396 Bytes: 2,433,577,260 Cardinality: 18,864,940
13 TABLE ACCESS FULL TABLE PARALLEL_COMBINED_WITH_PARENT MIS_RUN.DWH_FINANCIAL_FCT :Q1003 Cost: 11,396 Bytes: 2,433,577,260 Cardinality: 18,864,940
Thanks again -
What should be idea temp tablespace size ?
HI all
My databases size in between 20 gb to 100gb. waht factor should i consider to fix the temp tablespace size ?
What should be my ideal temp tablespace size for the both database ?Arun Rao wrote:
HI all
My databases size in between 20 gb to 100gb. waht factor should i consider to fix the temp tablespace size ?
What should be my ideal temp tablespace size for the both database ?what is the version?
Temp size wont depends on database size, It purely depends on user sortings. Create the temporary tablespace with autoextend upto maxsize of 32gb approx & see how users performing sortings.
>
Handle: Arun Rao
Status Level: Newbie
Registered: Jul 4, 2010
Total Posts: 10
Total Questions: 8 (7 unresolved)
Name Arun Rao
Location Mumbai
Occupation DBA
>
7 out of 8 unanswered, if already answered why cant you close those threads? Keep the forum clean.
Edited by: CKPT on Jul 2, 2012 2:46 PM -
Does rebuild of indexes uses temp tablespace or system tablespace?
Does rebuild of indexes uses temp tablespace or system tablespace?
If so why?If you combine the answers from Aman and Burleson, they cover most of the picture.
When rebuilding an index, you may end up sorting a large amount of information. The sort may spill into the temporary tablespace - if you haven't configured your database and users properly, it is possible that the SYSTEM tablespace may be used for the temporary tablespace.
As the new copy of the index is built, it has to be built in the right place (tablespace), and the space used to build it will be marked as a temporary segment as the build takes place. When the build is complete, this temporary segment will take on the name of the origrinal index, and the original index will be re-badged as a temporary segment and dropped. (Again, you might see temporary segments in the SYSTEM tablespace if the index was originally in, or was rebuilt into, the SYSTEM tablespace).
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk -
Windows Server batch to resize TEMP tablespace.
I was wondering if it's possible to use windows server 2003 batch jobs to RESIZE TEMP tablespace.
Here are some details:
Windows Server 2003
Oracle 10gR2
We do a windows batch job to backup all files on Oracle directory (.ctl, .dbf, etc) to a different server. With autoextend on, the TEMP.dbf gets to be really big. What I am wanting to do is reduce the size of the TEMP.dbf before backing up the files - to reduce the back up time.
Since alter database tempfile 'c:\oracle\...' RESIZE 10M is a SQL command; is there a way I can resize it through the windows batch job? If so, mind pointing me the way?
Thanks.a) Consider using RMAN for backup
b) Don't backup temp tablespace
c) Are Temporary tabesspaces Backed Up -
Is there any way to alter temp tablespace into normal tablespace
Even though It might be stupid question, i want to know the solution for that...
Is it possible to alter TEMP tablespace into Normal tablespace?
One more question, is it possible to create user with TEMP tablespace,
(I know the usage of temp tablespace also, and we cannot create user with temp tablespace.)
If some trick or any solution, share with me.
Thanks in advance.1) Can you explain why you want such an unusual situation. By understanding your requirement, perhaps we can suggest alternatives
2) The requirements and restrictions are described in the CREATE USER command in the SQL Reference manual for whatever version you are using. (The stupid part of your question happens by not specifying any version range. <g>)
The requirement to use a TEMPORARY tablespace is documented and enforced in 9i. In 8i, we only required a tablespace to be named.
3) On 10gR2 you see the following response:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Hans>sqlplus system/oracle
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jun 18 06:33:31 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
SQL> create user test1 identified by test account unlock
2 default tablespace temp
3 temporary tablespace temp;
create user test1 identified by test account unlock
ERROR at line 1:
ORA-12910: cannot specify temporary tablespace as default tablespace
SQL> create user test2 identified by test account unlock
2 default tablespace users
3 temporary tablespace users;
create user test2 identified by test account unlock
ERROR at line 1:
ORA-10615: Invalid tablespace type for temporary tablespace
SQL> create user test3 identified by test account unlock
2 default tablespace users
3 temporary tablespace temp;
User created.
SQL Rem Just on case it's complaining about using the same temp tablespace
SQL> create temporary tablespace temp2 tempfile 'C:\ORACLE\ORADATA\XE\TEMP2.DBF'
size 10m;
Tablespace created.
SQL> create user test4 identified by test account unlock
2 default tablespace temp
3 temporary tablespace temp2;
create user test4 identified by test account unlock
ERROR at line 1:
ORA-12910: cannot specify temporary tablespace as default tablespace
SQL>
Maybe you are looking for
-
I hate the new Z10, handing it over to my wife
I am a Blackberry poweruser. I have Blackberry everywhere along with all accessoirs. The background is, that I am travelling with 4 phones, for every country I have businesses in one phone. I bought the Playbook, to have a quick online banking done a
-
Error while process the CPPR-Rfx "No receiver could be determined"
Hi Experts, We are working on SRM 7.0 Extended Classic Scenario, While testing the CPPR-Rfx process we are getting the error msg in Portal "No receiver could be determined". We implemented Badi ME_REQ_SOURCING_CUST & BBP_EBPXML_OUT_BADI We are gettin
-
No device I found something that may work for most of your problems. It is a download with instructions at http://www.aceeca.com/downloads/download_overview.php/cPath/1/downloads_id/13.
-
Apogee "One" + GarageBand '09 Review
Good morning everyone... In case anyone is interested, here is my review of the Apogee "One" interface working along side GarageBand '09. I am a new to Apple and recording music; so please forgive me for lack of specific tech terminology. *My Gear:*
-
Ive been editing a video on imovie, and it was working fine but now when i try and click on anything it just makes a sound and wont let me edit or close out of anything. I dont want to force quit because then ill lose my project. is there ant other w