Temporary tablespace and tempfile
Hi,
On one of our database, we have a temporary tablespace which is locally managed.
This tablespace has 3 tempfiles.
One query, which generate large sort, cause an Oracle error ORA-01652.
But, when we see the date of tempfiles, it seems that there is only one tempfile which is use :
rw-rw-rw- 1 iov816 fraud 31465472 Jun 6 18:10 temp2riskv5r.dbf
-rw-rw-rw- 1 iov816 fraud 20979712 Jun 6 18:14 temp3riskv5r.dbf
-rw-rw-rw- 1 riskv5r fraud 152047616 Jun 8 14:47 tempriskv5r.dbf What happens exactly ? This database is a 8.1.6.0.
Thanks for any explanations.
Nicolas.
When using OMF you do not not specify the file names. ASM does not really change the syntax any.
SQL> create tablespace test_me
2 datafile size 10m,
3 size 10m
4 extent management local uniform size 1m;
Tablespace created.
SQL> select file_name from dba_data_files where tablespace_name = 'TEST_ME';
FILE_NAME
+TESTDB/sandbox/datafile/test_me.1101.615385691
+TESTDB/sandbox/datafile/test_me.1097.615385693
SQL>
Similar Messages
-
Temporary Tablespace and transactions
Hi.
I have a query regarding temp tablespace ,
I am on 10gR2 version. with ONE TEMP tablespace and having one tempfiles.
temp Tablespace TEMP1 = temp01.dbf (1 GB)
+ Let say I have executed a query-1 from Scott user , its runs for 30 min and let assume its consumed 900MB of tempspace during its completion .
+ And another query -2 from scott or another user fired ( let say Query 1 started earlier than Query 2 ) . and it needs around 500MB of tempspace
== MY Question is
Q .1 ) Will the Second Query waits until Query 1 completion ? As we have only one Temp file over here . IF both started executing both Queries will hit unable o extend temp space error .
- Please provide your inputs and corrections.
-Thanks.TEMP Tablespace size : 1GB NO AutoExtend
First Query uses 900MB
Second Query starts using space and will eventually need 500MB space
Both queries will concurrently be allowed to use Temp Space
If the first query completes before the second query usage hits 100MB, it will release all 900MB for usage by the second query.
If the first query hasn't completed and is at 900MB, the second query will error out when it attempts to go beyond 100MB.
If the first query needs more than 900MB and the second query has used 100MB -- i.e. both are growing in usage -- any one of the two queries wil fail.
NOTE : If Resumable Space Allocation has been enabled either by setting RESUMABLE_TIMEOUT or by ALTER SESSION ENABLE RESUMABLE, the queries will not fail if the TEMP Tablespace is resized within the timeout period. Else, beyond the timeout, either of the queries will fail.
Hemant K Chitale
Edited by: Hemant K Chitale on Feb 13, 2013 4:17 PM
Added Note on Resumable Space Allocation -
Temporary tablespace and alert log
If a temporary tablespace is actually filled and users get error when they are running some query, will it be updated in the alert log?
ThanksIt is ora-01652, and will be written to alert,
Thanks -
Swap, temporary tablespace and sort operations
Hello.
I have an Oracle 8.1.7 on Linux RH7.1. I see a very interesting situation: when users begin to execute large selects with many sorts operation swapping grows, but temporary tablespace does'nt grow. As I know, when Oracle has no memory to use as "sort_area_size" it uses temporary tablespace. But looks like that when Oracle ask for memory Linux begin to swap (in order to give memory for Oracle). I mean that Oracle don't use temporary tablespace but use swap instead of it. Is it true? Is it problem? Is it Oracle, Linux or my own configuration bug? Is it better to use swap or to use temporary tablespace? What is faster?
Thanx for all advises and ideas. ANd sorry for pure Englishlogin to your database as DBA (SYS AS SYSDBA) and issue the following query:
SQL> select name, value from v$parameter where name = 'sga_max_size' ;
see the value defined for this parameter. If this is larger than what you have configured as your SGA size,
Oracle will assume that it can expand the SGA to "sga_max_size" value, and will try to expand the SGA when
required. This will result in Oracle asking more memory from the linux kernel and then linux starts to use
the swap space.
Try changing the value of this parameter and see if it helps. -
How do i know if my query using SORT_AREA_SIZE or temporary tablespace ?
Good Morning Everyone !
My DB version is 10.2.0.1
I have large table exactly 3 million records.
SQL> select count(*) from tab1;
COUNT(*)
300000
SQL> select * from tab1 order by no DESC;
sorting ... in process
300000 rows selected.
in Terminal 2 : I tried to find sorting details - ( No rows selected - why ? )
SQL> select USERNAME , USER , TABLESPACE , SQL_ID from v$tempseg_usage ;
no rows selected
SQL> /
no rows selected
When i google i have seen this ;
If Oracle cannot do the sort in memory (SORT_AREA_SIZE initialisation parameter), space will be allocated in a temporary tablespace for doing the sort operation.
REF_LINK : TEMPORARY Tablespaces and TEMPFILES | Oracle FAQ
MY DOUBT QUESTION : How do i know if my query using SORT_AREA_SIZE or temporary tablespace ?
Thanks in advance.@ JohnWatson
I have seen some articles from ORA - FAQ. Good.
SQL> select USERNAME , USER , TABLESPACE , SQL_ID from v$tempseg_usage;
USERNAME USER TABLESPACE SQL_ID
SCOTT SYS TEMP fh9vqgyd6m0d1
PGA management means that sorting only 300000 rows may well occur in memory
Is this (3 million rows) - standard value for 10g version ?
Thanks JohnWatson -
TEMPORARY TABLESPACE에서, TEMPFILE을 사용할지, DATAFILE을 사용 할지 결정에 필요한 지침
제품 : ORACLE SERVER
작성날짜 : 2003-02-24
TEMPORARY TABLESPACE에서, 임시 파일을 사용할지, 데이터파일을 사용 할지 결정에 필요한 지침
===========================================================================================
PURPOSE
이 문서는, TEMPORARY TABLESPACE에서 임시 파일과 데이터파일의 차이점을
소개하는 데 목적이 있다.
Explanation
| TEMPORARY | Tablespace |
| tablespace | TEMPORARY |
| Locally | Dictionary |
| managed | managed |
| Datafiles | impossible | Y |
| Tempfiles | Y | impossible |
------------------------------------------+
다른 조합은 허용되지 않는다.
1. TEMPORARY Tablespace / Tablespace TEMPORARY 와 PERMANENT tablespace 비교
1) Tablespace TEMPORARY는 오라클 7.3 이상 버젼에서 사용가능하다.
=> Tablespace TEMPORARY는 다음과 같은 명령을 사용하여 생성한다.
CREATE TABLESPACE .. TEMPORARY
이 경우 데이터파일만을 사용한다.
2) TEMPORARY tablespac는 오라클 8i 이상 버젼에서 사용 가능하다
=> TEMPORARY tablespace는 다음과 같은 명령을 사용하여 생성한다
CREATE TEMPORARY TABLESPACE .. TEMPFILE
이 경우 tempfile만 사용할 수 있다.
3) Tablespace TEMPORARY/TEMPORARY tablespace는 DBA_TABLESPACES의
CONTENTS 값이 TEMPORARY로 나타난다.
4) Tablespace TEMPORARY/TEMPORARY tablespace 는 PERMANENT
tablespace와 다르며 (DBA_TABLESPACES.CONTENTS 값이 PERMANENT임)
permanent segment를 생성 할 수 없다. 예를 들어, permanent table이나
index, cluster, rollback segment등을 Tablespace TEMPORARY/TEMPORARY
tablespace에 생성할 수 없다.
5) Tablespace TEMPORARY/TEMPORARY tablespace 에서는, 단일한
temporary segment를 제공하며, 이 세그먼트는 다음과 같은
요구사항을 가진 모든 사용자에 의해 공유된다.
=> sort 작업에 따른 sort extents를 필요로 하는 사용자
=> GLOBAL TEMPORARY TABLE에 필요한 temporary extents
이와 같은 고유한 temporary segment는 동시에 많은 양의 sort 작업이
수행되거나, 여러 트랜잭션이 동일한 temporary table을 사용할 때,
permanent tablespace에서 작업하는 overhead를 피하고, 오라클의
공간 관리 작업의 부하를 피하는데 도움을 준다.
6) Temporary segment는 인스턴스 구동후 사용자가 sort extent나
sort run, 또는 global temporary table 생성등의 요청에 따라
자동적으로 생성된다.
7) Temporary segment는 인스턴스 shutdown시 자동적으로 drop 된다.
8) Temporary Content를 저장하는 테이블스페이스에 대한
세그먼트의 공간 할당/할당 해제 관련 정보는 V$SORT_SEGMENT와
V$SORT_USAGE 뷰를 사용하여 확인해 볼 수 있으며, sort segment
등에 현재 sort를 진행하는 사용 정보를 보여준다.
9) 위와 같은 작업을 수행하는데 PERMANENT tablespace 보다는
tablespace TEMPORARY를 사용하는 것이 유리한 점은 <Bulletin No:
11938>에 자세히 기술되어 있따.
10) 오라클 8i에서는, 사용자별 default temporary tablespace가 어떤
종류라도 상관이 없으나, PERMANENT locally managed 방식의 테이블
스페이스는 지정할 수 없다. 다음은 PERMANENT locally managed 방식의
테이블스페이스를 default temporary tablespace로 지정하여 발생하는
에러이다.
SQL> alter user x temporary tablespace PERM_LOCAL;
User altered.
SQL> select * from dba_tables order by 3,2,6,4,7,9,1,5;
select * from dba_tables order by 3,2,6,4,7,9,1,5
ERROR at line 1:
ORA-03212: Temporary Segment cannot be created in locally-managed tablespace
오라클 9i에서는 사용자별 default temporary tablespace가
어떤 TEMPORARY 타입이라도 무방하다.
=> TEMPORARY tablespace locally managed
=> tablespace TEMPORARY dictionary managed
PERMANENT locally-managed 타입의 테이블스페이스를 사용자의
TEMPORARY tablespace으로 지정할 때 다음과 같은 에러가 발생한다.
SQL> alter user x temporary tablespace PERM_LOCAL;
alter user x temporary tablespace PERM_LOCAL
ERROR at line 1:
ORA-12911: permanent tablespace cannot be temporary tablespace
2. TEMPORARY Tablespace/Tempfiles 대비 Tablespace TEMPORARY/Datafile
1) 공간관리
공간 관리는, locally managed tablespace에서 훨씬 단순하고, 또
효율적이기 때문에, TEMPORARY tablespace를 사용하는 것이
바람직하다. Local managedment 방식에서 사용 가능한 유일한
방식이 temporary tablespace 방식이다.
SQL> create tablespace temp1
2 DATAFILE '/ora/ora817/32/oradata/V817/temp1.dbf' size 100M
3 TEMPORARY
4 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
create tablespace temp1
ERROR at line 1:
ORA-25144: invalid option for CREATE TABLESPACE with TEMPORARY contents
Dictionary-managed tablespace 대비 locally-managed tableapce의 장점은
<Bulletin No: 18261>에 자세히 기술되어 있다.
오라클 8i에서는, sort segment가 locally managed permanent tablespace에
생성될 수 없으므로, locally managed TEMPORARY tablespace를 사용하여야
한다.
Locally managed temporary tablespace는 tempfile을 사용하며, temporary
tablespace 바깥 데이터에 전혀 영향을 주지 않으면서, temporary tablespace
관련 데이터에 대한 redo정보가 생성되지 않는다.
이 테이블스페이스는, standby database나 read-only database에서도
사용 가능하다.
2) View
TEMPORARY tablespace 와 연관된 파일 목록은 V$TEMPFILE 과
DBA_TEMP_FILES 뷰를 통해 확인할 수 있다.
SQL> select * from dba_tablespaces;
TABLESPACE_NAME CONTENTS EXTENT_MAN
TEMP_TEMPFILE_LOCAL TEMPORARY LOCAL
TEMP_DATAFILE_DICT TEMPORARY DICTIONARY
SQL> select STATUS, ENABLED, NAME from v$tempfile;
STATUS ENABLED NAME
ONLINE READ WRITE /tcase/oradata/V901/temp_temp01.dbf
SQL> select FILE_NAME, TABLESPACE_NAME from dba_temp_files;
FILE_NAME TABLESPACE_NAME
/tcase/oradata/V901/temp_temp01.dbf TEMP_TEMPFILE_LOCAL
위 내용은 tablespace TEMPORARY 환경에서 V$DATAFILE 와
DBA_DATA_FILES를 사용하는 것에 비길 수 있다.
SQL> select STATUS, ENABLED, NAME from v$datafile;
STATUS ENABLED NAME
ONLINE READ WRITE /tcase/oradata/V901/temp_data01.dbf
SQL> select FILE_NAME, TABLESPACE_NAME from dba_data_files;
FILE_NAME TABLESPACE_NAME
/tcase/oradata/V901/temp_data01.dbf TEMP_DATAFILE_DICT
3) 권한
Temporary tablespace 또는 tablespace temporary 생성을 위해서는
CREATE TABLESPACE system privilege가 필요하다.
4) TEMPORARY Tablespace 생성
SQL> create TEMPORARY tablespace temp_tempfile_local
2 TEMPFILE '/ora/V817/temp_temp.dbf' size 100M
3 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
참고: 일부 OS에서는 tempfile block이 실제 액세스 되기
전 까지 tempfile이 실제로 생성되지 않는다. 이와 같은
파일 생성 작업이 지체되어 처리 되는 것은, tempfile의
생성과 크기 조정이 신속하게 처리되는데 도움이 된다.
그러나, tempfile이 나중에 생성되더라도, 생성 가능한
충분한 디스크 공간이 있어야 하겠다.
사용중인 O/S에서 tempfile이 실제 생성되는 시점은
플랫폼별 매뉴얼에 기술되어 있다.
Tablespace TEMPORARY의 생성
SQL> create tablespace TEMP_DATAFILE_DICT
2 datafile '/tcase/oradata/V901/temp_data.dbf' size 100M
3 TEMPORARY;
Tablespace created.
5) Tempfile/Datafile 제거
a. 테이블스페이스를 drop 하기 전까지 테이블스페이스의 datafile을
제거할 수 없다.
참고: 오라클 9i에서 DROP TABLESPACE 명령에 추가된
INCLUDING CONTENTS AND DATAFILES 절을 사용하면, OS로 부터
관련 데이터파일도 삭제하는 작업을 자동화 할 수 있다.
b. Temporary tablespace로 부터 tempfile을 삭제하고, 논리 구조를
비어 있는 상태로 유지할 수 있다.
=> 오라클 8i:
SQL> alter tablespace TEMP_TEMPFILE_LOCAL
2 add tempfile '/oradata/V817/temp_temp01.dbf';
Tablespace altered.
SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
2 drop;
Database altered.
SQL> !ls /oradata/V817/temp_temp01.dbf
/oradata/V817/temp_temp01.dbf
위 명령을 수행 한 후, tempfile을 시스템으로 부터 삭제하고,
나중에 다시 추가 시킬 수 있다.
SQL> alter tablespace TEMP_TEMPFILE_LOCAL
2 add tempfile '/oradata/V817/temp_temp01.dbf';
Tablespace altered.
=> 오라클 9i: OS 파일을 삭제 하기 위해 INCLUDING DATAFILES
절을 사용할 수 있다.
SQL> alter database tempfile '/oradata/V901/temp_temp01.dbf'
2 drop including datafiles;
Database altered.
SQL> !ls /oradata/V901/temp_temp01.dbf
/oradata/V901/temp_temp01.dbf not found
Temporary tablespace로 부터 모든 tempfile을 삭제하면,
다음과 같은 에러가 발생할 수 있다.
SQL> alter table olap.test add primary key (c);
alter table olap.test add primary key (c)
ERROR at line 1:
ORA-25153: Temporary Tablespace is Empty
ORA-25153
25153, 00000, "Temporary Tablespace is Empty"
// *Cause: An attempt was made to use space in a temporary tablespace with
// no files.
// *Action: Add files to the tablespace using ADD TEMPFILE command.
이 에러 메시지는 동시 작업 수행시 디스크를 실제 액세스 하여야
할 경우 발생하게 된다.
Example
Reference Documents
<Note:132663.1> ORA-03296 Resizing Temporary Locally Managed Tablespace
<Note:131769.1> ORA-03212 at Instance Startup
<Note:102339.1> Temporary Segments: What Happens When a Sort Occurs
<Note:160426.1> TEMPORARY Tablespaces : Tempfiles or Datafiles -
Move undo and temporary tablespace to new path
Hi All,
I want to move my undo and temporary tablespace to new path because of space issue. I am using Oracle 10g release 2 and working on production server can't take shutdown without prior permission.
Please tell me the steps to do so...
thanks
ApiAbout create/change/drop
UNDO:
SQL>show parameter undo
NAME TYPE VALUE
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL> CREATE UNDO TABLESPACE undotbs2 DATAFILE '+DATA_NEWPATH' SIZE 100M AUTOEXTEND ON;
http://www.oracle-base.com/articles/9i/AutomaticUndoManagement.php
SQL> alter system set undo_tablespace=undotbs2;
*** after that can drop UNDOTBS1
TEMP:
SQL> CREATE TEMPORARY TABLESPACE TEMP TEMPFILE '+DATA_NEWPATH' SIZE 500M AUTOEXTEND ON NEXT 100M MAXSIZE unlimited EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;
http://www.idevelopment.info/data/Oracle/DBA_tips/Tablespaces/TBS_3.shtml
SQL> ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;
*** after that can drop old temp tablespace -> DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES -
Temporary Tablespace Sizing and SNOTE 164925
Hi All,
I am facing a dilemma when I look into the temporary tablespace setting.
I have gone thru the SNOTE 164925, for the sizing parameters of PSAPTEMP.
There is a calculation on the note for selecting initial extent next extent etc.....
My PSAPTEMP is locally managed and having default initial extent value of 1 MB but as per the calculation given on SNOTE 164925 solution section.
But the point is in the How Can I check the specified value section on the same note it says....
"As of Oracle 8i, SAP recommends using the assignment of locally managed
temporary tablespaces (see Notes 659946 and 662900). This means that when
problems with a 'dictionary managed' temporary tablespace occur, you should
change to a 'locally managed' temporary tablespace instead of optimizing
the settings of the 'dictionary managed' temporary tablespace."
Now my question is whther I should still go with the default value or with the new values as per the formula given in the same note.
I am using Oracle 10g behind SAPR3 4.6D
Regards,
SoumenHello Soumen,
to be honest - i don't really understand your question / problem.
Just use locally managed temporary tablespace and set an uniform size.
The values initial, next and pctincrease doesn't matter in this case. Set the uniform size to 1 - 5 MB.
As you told us you are using oracle 10g .. just check the documenation:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7003.htm#CJAIDDDB
Specify LOCAL if you want the tablespace to be locally managed. Locally managed tablespaces have some part of the tablespace set aside for a bitmap. This is the default for permanent tablespaces. Temporary tablespaces are always automatically created with locally managed extents.
AUTOALLOCATE specifies that the tablespace is system managed. Users cannot specify an extent size. You cannot specify AUTOALLOCATE for a temporary tablespace.
UNIFORM specifies that the tablespace is managed with uniform extents of SIZE bytes.The default SIZE is 1 megabyte. All extents of temporary tablespaces are of uniform size, so this keyword is optional for a temporary tablespace. However, you must specify UNIFORM in order to specify SIZE. You cannot specify UNIFORM for an undo tablespace.
Restriction on Dictionary-managed Tablespaces
You cannot specify DICTIONARY if the SYSTEM tablespace of the database is locally managed or if you have specified the temporary_tablespace_clause.
Regards
Stefan -
Parallel execution and temporary tablespaces
I have a large long running (1 hour) data warehouse query in a materialized view.
If I parallelize it using the parallel hint then I run out of temporary tablespace.
I've tried creating a bunch of temporary tablespaces and putting them into a temp tablespace group but it still runs out of space. Parallel execution seems to use up way more temp tablespace than sequential execution.
I know it is a very general question, but what are the tips for parallelizing a long running query with respect to temporary tablespace management?
I've tried searching on the interwebs but I don't find anything that addresses this particular issue.And here is the parallel explain plan:
PLAN_TABLE_OUTPUT
Plan hash value: 1293981491
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | TQ |IN-OUT| PQ Distrib |
| 0 | SELECT STATEMENT | | 81M| 17G| | 19232 (2)| 00:00:01 | | | |
| 1 | TABLE ACCESS BY INDEX ROWID | MART$SC_SCORES | 1 | 13 | | 3 (0)| 00:00:01 | | | |
|* 2 | INDEX UNIQUE SCAN | SSCS_SDCC_FK_I | 1 | | | 2 (0)| 00:00:01 | | | |
| 3 | PX COORDINATOR | | | | | | | | | |
| 4 | PX SEND QC (RANDOM) | :TQ10017 | 81M| 17G| | 19232 (2)| 00:00:01 | Q1,17 | P->S | QC (RAND) |
|* 5 | HASH JOIN RIGHT OUTER BUFFERED | | 81M| 17G| | 19232 (2)| 00:00:01 | Q1,17 | PCWP | |
| 6 | PX RECEIVE | | 41925 | 491K| | 2 (0)| 00:00:01 | Q1,17 | PCWP | |
| 7 | PX SEND BROADCAST | :TQ10014 | 41925 | 491K| | 2 (0)| 00:00:01 | Q1,14 | P->P | BROADCAST |
| 8 | PX BLOCK ITERATOR | | 41925 | 491K| | 2 (0)| 00:00:01 | Q1,14 | PCWC | |
| 9 | INDEX FAST FULL SCAN | I_DWH_ZIP_ZIPCODE_EIDIID | 41925 | 491K| | 2 (0)| 00:00:01 | Q1,14 | PCWP | |
|* 10 | HASH JOIN | | 81M| 16G| | 19218 (2)| 00:00:01 | Q1,17 | PCWP | |
| 11 | JOIN FILTER CREATE | :BF0000 | 6414K| 159M| | 806 (2)| 00:00:01 | Q1,17 | PCWP | |
| 12 | PX RECEIVE | | 6414K| 159M| | 806 (2)| 00:00:01 | Q1,17 | PCWP | |
| 13 | PX SEND HASH | :TQ10015 | 6414K| 159M| | 806 (2)| 00:00:01 | Q1,15 | P->P | HASH |
| 14 | PX BLOCK ITERATOR | | 6414K| 159M| | 806 (2)| 00:00:01 | Q1,15 | PCWC | |
|* 15 | INDEX FAST FULL SCAN | I_DWH_ADDRESS_COMB_ZIP | 6414K| 159M| | 806 (2)| 00:00:01 | Q1,15 | PCWP | |
| 16 | PX RECEIVE | | 80M| 14G| | 18397 (2)| 00:00:01 | Q1,17 | PCWP | |
| 17 | PX SEND HASH | :TQ10016 | 80M| 14G| | 18397 (2)| 00:00:01 | Q1,16 | P->P | HASH |
| 18 | JOIN FILTER USE | :BF0000 | 80M| 14G| | 18397 (2)| 00:00:01 | Q1,16 | PCWP | |
|* 19 | HASH JOIN RIGHT OUTER BUFFERED | | 80M| 14G| | 18397 (2)| 00:00:01 | Q1,16 | PCWP | |
| 20 | PX RECEIVE | | 42M| 409M| | 827 (2)| 00:00:01 | Q1,16 | PCWP | |
| 21 | PX SEND HASH | :TQ10012 | 42M| 409M| | 827 (2)| 00:00:01 | Q1,12 | P->P | HASH |
| 22 | PX BLOCK ITERATOR | | 42M| 409M| | 827 (2)| 00:00:01 | Q1,12 | PCWC | |
| 23 | MAT_VIEW ACCESS FULL | MBI$CMN_ACTION_COST | 42M| 409M| | 827 (2)| 00:00:01 | Q1,12 | PCWP | |
| 24 | PX RECEIVE | | 80M| 14G| | 17549 (1)| 00:00:01 | Q1,16 | PCWP | |
| 25 | PX SEND HASH | :TQ10013 | 80M| 14G| | 17549 (1)| 00:00:01 | Q1,13 | P->P | HASH |
|* 26 | HASH JOIN BUFFERED | | 80M| 14G| | 17549 (1)| 00:00:01 | Q1,13 | PCWP | |
| 27 | PX RECEIVE | | 6312K| 794M| | 7519 (1)| 00:00:01 | Q1,13 | PCWP | |
| 28 | PX SEND HASH | :TQ10010 | 6312K| 794M| | 7519 (1)| 00:00:01 | Q1,10 | P->P | HASH |
|* 29 | HASH JOIN RIGHT OUTER BUFFERED | | 6312K| 794M| | 7519 (1)| 00:00:01 | Q1,10 | PCWP | |
| 30 | VIEW | | 4443K| 80M| | 2125 (2)| 00:00:01 | Q1,10 | PCWP | |
| 31 | HASH GROUP BY | | 4443K| 33M| 158M| 2125 (2)| 00:00:01 | Q1,10 | PCWP | |
| 32 | PX RECEIVE | | 10M| 78M| | 950 (1)| 00:00:01 | Q1,10 | PCWP | |
| 33 | PX SEND HASH | :TQ10007 | 10M| 78M| | 950 (1)| 00:00:01 | Q1,07 | P->P | HASH |
| 34 | PX BLOCK ITERATOR | | 10M| 78M| | 950 (1)| 00:00:01 | Q1,07 | PCWC | |
| 35 | TABLE ACCESS FULL | DWH$PHONE | 10M| 78M| | 950 (1)| 00:00:01 | Q1,07 | PCWP | |
|* 36 | HASH JOIN | | 6312K| 680M| | 5392 (1)| 00:00:01 | Q1,10 | PCWP | |
| 37 | PX RECEIVE | | 6329K| 36M| | 130 (2)| 00:00:01 | Q1,10 | PCWP | |
| 38 | PX SEND HASH | :TQ10008 | 6329K| 36M| | 130 (2)| 00:00:01 | Q1,08 | P->P | HASH |
| 39 | PX BLOCK ITERATOR | | 6329K| 36M| | 130 (2)| 00:00:01 | Q1,08 | PCWC | |
| 40 | INDEX FAST FULL SCAN | PK_DWH_DEBTOR | 6329K| 36M| | 130 (2)| 00:00:01 | Q1,08 | PCWP | |
| 41 | PX RECEIVE | | 6312K| 644M| | 5259 (1)| 00:00:01 | Q1,10 | PCWP | |
| 42 | PX SEND HASH | :TQ10009 | 6312K| 644M| | 5259 (1)| 00:00:01 | Q1,09 | P->P | HASH |
|* 43 | HASH JOIN RIGHT OUTER BUFFERED| | 6312K| 644M| | 5259 (1)| 00:00:01 | Q1,09 | PCWP | |
| 44 | PX RECEIVE | | 3689K| 31M| | 4271 (1)| 00:00:01 | Q1,09 | PCWP | |
| 45 | PX SEND HASH | :TQ10005 | 3689K| 31M| | 4271 (1)| 00:00:01 | Q1,05 | P->P | HASH |
| 46 | VIEW | | 3689K| 31M| | 4271 (1)| 00:00:01 | Q1,05 | PCWP | |
| 47 | HASH GROUP BY | | 3689K| 56M| 84M| 4271 (1)| 00:00:01 | Q1,05 | PCWP | |
| 48 | PX RECEIVE | | 3689K| 56M| | 3653 (1)| 00:00:01 | Q1,05 | PCWP | |
| 49 | PX SEND HASH | :TQ10003 | 3689K| 56M| | 3653 (1)| 00:00:01 | Q1,03 | P->P | HASH |
|* 50 | HASH JOIN | | 3689K| 56M| | 3653 (1)| 00:00:01 | Q1,03 | PCWP | |
| 51 | BUFFER SORT | | | | | | | Q1,03 | PCWC | |
| 52 | PX RECEIVE | | 3 | 21 | | 1 (0)| 00:00:01 | Q1,03 | PCWP | |
| 53 | PX SEND BROADCAST | :TQ10000 | 3 | 21 | | 1 (0)| 00:00:01 | | S->P | BROADCAST |
| 54 | INLIST ITERATOR | | | | | | | | | |
|* 55 | INDEX RANGE SCAN | I_DWH_PAYMENT_TYPE_EIDIID | 3 | 21 | | 1 (0)| 00:00:01 | | | |
| 56 | PX BLOCK ITERATOR | | 28M| 242M| | 3648 (1)| 00:00:01 | Q1,03 | PCWC | |
|* 57 | TABLE ACCESS FULL | DWH$PAYMENT | 28M| 242M| | 3648 (1)| 00:00:01 | Q1,03 | PCWP | |
| 58 | PX RECEIVE | | 6312K| 589M| | 986 (2)| 00:00:01 | Q1,09 | PCWP | |
| 59 | PX SEND HASH | :TQ10006 | 6312K| 589M| | 986 (2)| 00:00:01 | Q1,06 | P->P | HASH |
|* 60 | HASH JOIN | | 6312K| 589M| | 986 (2)| 00:00:01 | Q1,06 | PCWP | |
| 61 | PX RECEIVE | | 2937 | 172K| | 5 (20)| 00:00:01 | Q1,06 | PCWP | |
| 62 | PX SEND BROADCAST | :TQ10004 | 2937 | 172K| | 5 (20)| 00:00:01 | Q1,04 | P->P | BROADCAST |
|* 63 | HASH JOIN BUFFERED | | 2937 | 172K| | 5 (20)| 00:00:01 | Q1,04 | PCWP | |
| 64 | PX RECEIVE | | 220 | 1540 | | 2 (0)| 00:00:01 | Q1,04 | PCWP | |
| 65 | PX SEND HASH | :TQ10001 | 220 | 1540 | | 2 (0)| 00:00:01 | Q1,01 | P->P | HASH |
| 66 | PX BLOCK ITERATOR | | 220 | 1540 | | 2 (0)| 00:00:01 | Q1,01 | PCWC | |
| 67 | TABLE ACCESS FULL | DWH$MANDATOR | 220 | 1540 | | 2 (0)| 00:00:01 | Q1,01 | PCWP | |
| 68 | PX RECEIVE | | 2937 | 152K| | 2 (0)| 00:00:01 | Q1,04 | PCWP | |
| 69 | PX SEND HASH | :TQ10002 | 2937 | 152K| | 2 (0)| 00:00:01 | Q1,02 | P->P | HASH |
| 70 | PX BLOCK ITERATOR | | 2937 | 152K| | 2 (0)| 00:00:01 | Q1,02 | PCWC | |
| 71 | TABLE ACCESS FULL | DWH$PACKAGE | 2937 | 152K| | 2 (0)| 00:00:01 | Q1,02 | PCWP | |
| 72 | PX BLOCK ITERATOR | | 6312K| 228M| | 980 (1)| 00:00:01 | Q1,06 | PCWC | |
| 73 | TABLE ACCESS FULL | DWH$CASE | 6312K| 228M| | 980 (1)| 00:00:01 | Q1,06 | PCWP | |
| 74 | PX RECEIVE | | 78M| 4199M| | 10016 (1)| 00:00:01 | Q1,13 | PCWP | |
| 75 | PX SEND HASH | :TQ10011 | 78M| 4199M| | 10016 (1)| 00:00:01 | Q1,11 | P->P | HASH |
| 76 | PX BLOCK ITERATOR | | 78M| 4199M| | 10016 (1)| 00:00:01 | Q1,11 | PCWC | |
|* 77 | TABLE ACCESS FULL | DWH$ACTION | 78M| 4199M| | 10016 (1)| 00:00:01 | Q1,11 | PCWP | |
------------------------------------------------------------------------------------------------------------------------------------------------------------------ -
ORA-00600 Error, when Dropping one temporary tablespace
Hi,
I am using Oracle 10.1.0.2.0 on WinXPP, after I created a new temp tablespace and assigned one user to it as its temp tablespace, then trying to drop the old temp tablespace , I am getting the following Error . Can anybody pl. explain the reason.
Steps I followed as...
SYSTEM@orcl>create temporary tablespace checkup_tmp tempfile 'c:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL \CHECKUP_Tmp.dat' size 500M;
Tablespace created.
SYSTEM@orcl> alter user checkup temporary tablespace checkup_tmp;
User altered.
SYSTEM@orcl> drop tablespace CHECKUP_TEMP including contents;
drop tablespace CHECKUP_TEMP including contents
ERROR at line 1:
ORA-00600: internal error code, arguments: [krf_gen_drop_tablespace-1], [], [],
SYSTEM@orcl> drop tablespace CHECKUP_TEMP ;
drop tablespace CHECKUP_TEMP
ERROR at line 1:
ORA-00600: internal error code, arguments: [krf_gen_drop_tablespace-1], [], [],
Thanks in advancethis is the bug 3984486
consider upgrading.
the workaround seems to flashback the DB... -
Script for temporary tablespace in 8.1.7.4.0
Hi,
I am working in oracle 8.1.7.4.0 and HP-UX os.I need a shell script which is to do the following tasks,
1. create a new temporary tablespace
2.assign the new temp tablespace to the database user level
3.drop the old temp tablespace
4. then create a temp tablespace with the old name
5. then assign the new temp tablespace to the database user level
6.drop the new temp tablespace
Kindly provide me the script for oracle 8.1.7.4.0
Rgds..here is one I prepared earlier (just like a TV chef)
set echo on
-- Create a New TEMP TEMP
create temporary tablespace temp2
tempfile 'dir/temp2.dbf' size 5M
autoextend on next 1M maxsize unlimited extent management local uniform size 1M;
-- Make the TEMP2 tablespace temp
alter database default temporary tablespace temp2;
-- Drop the orginal to recreate with new size
drop tablespace temp including contents and datafiles;
CREATE TEMPORARY TABLESPACE TEMP
TEMPFILE 'dir/temp01.dbf' SIZE 100M AUTOEXTEND ON NEXT 100M MAXSIZE 30000M
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 2M;
alter database default temporary tablespace temp;
drop tablespace temp2 including contents and datafiles; -
Shrinking a Locally Managed Temporary Tablespace
So, even thoguh the documentation is pretty clear about how to use this feature, I cannot get it to do what I expect it to do for me.
And that would be shrinking the tempfile ;)
Now lets face it, I have a large tempfile and want to resize it without restarting the database:
C:\Users\Administrator>sqlplus / as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on Di Nov 20 05:49:59 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
SQL> select file_name
, ceil(bytes / 1024 / 1024) "size MB"
from dba_temp_files
FILE_NAME size MB
R:\MXVC01\TEMP01.DBF 31,231
SQL> select su.username
, ses.sid
, ses.serial#
, su.tablespace
, ceil((su.blocks * dt.block_size) / 1048576) MB
from v$sort_usage su
, dba_tablespaces dt
, v$session ses
where su.tablespace = dt.tablespace_name
and su.session_addr = ses.saddr
USERNAME SID SERIAL# TABLESPACE MB
VPXADMIN 15 15 TEMP 14
VPXADMIN 17 5 TEMP 1,203
VPXADMIN 17 5 TEMP 1
VPXADMIN 18 3 TEMP 7
VPXADMIN 19 3 TEMP 1
VPXADMIN 144 3 TEMP 1
VUMADMIN 156 2597 TEMP 1
7 rows selected.
Or this one:
SQL> select tablespace_size/1024/1024 "tablespace_size mb"
, allocated_space/1024/1024 "allocated_space mb"
, free_space/1024/1024 "free_space mb"
from dba_temp_free_space
tablespace_size mb allocated_space mb free_space mb
31230,9922 1228,99219 30002
Documetation from here: http://docs.oracle.com/cd/E11882_01/server.112/e25494/tspaces007.htm#ADMIN12353
+"Shrinking a Locally Managed Temporary Tablespace+
+Large sort operations performed by the database may result in a temporary tablespace growing and occupying a considerable amount of disk space. After the sort operation completes, the extra space is not released; it is just marked as free and available for reuse. Therefore, a single large sort operation might result in a large amount of allocated temporary space that remains unused after the sort operation is complete. For this reason, the database enables you to shrink locally managed temporary tablespaces and release unused space.+
+You use the SHRINK SPACE clause of the ALTER TABLESPACE statement to shrink a temporary tablespace, or the SHRINK TEMPFILE clause of the ALTER TABLESPACE statement to shrink a specific tempfile of a temporary tablespace. Shrinking frees as much space as possible while maintaining the other attributes of the tablespace or tempfile. The optional KEEP clause defines a minimum size for the tablespace or tempfile.+
+Shrinking is an online operation, which means that user sessions can continue to allocate sort extents if needed, and already-running queries are not affected.+
+The following example shrinks the locally managed temporary tablespace lmtmp1 to a size of 20M.+
+ALTER TABLESPACE lmtemp1 SHRINK SPACE KEEP 20M;+
+The following example shrinks the tempfile lmtemp02.dbf of the locally managed temporary tablespace lmtmp2. Because the KEEP clause is omitted, the database attempts to shrink the tempfile to the minimum possible size.+
+ALTER TABLESPACE lmtemp2 SHRINK TEMPFILE '/u02/oracle/data/lmtemp02.dbf';"+
OK, lets do it:
SQL> alter tablespace temp shrink tempfile 'R:\MXVC01\TEMP01.DBF';
alter tablespace temp shrink tempfile 'R:\MXVC01\TEMP01.DBF'
ERROR at line 1:
ORA-03214: File Size specified is smaller than minimum required
It seems there is a bug? Should I report it, or is it the expected behaviour?
Now lets try this one:
SQL> alter tablespace temp shrink tempfile 'R:\MXVC01\TEMP01.DBF' keep 2048M;
Tablespace altered.
SQL> select file_name
, ceil(bytes / 1024 / 1024) "size MB"
from dba_temp_files
FILE_NAME size MB
R:\MXVC01\TEMP01.DBF 31,231
So .... this lasts about *10 minutes*, and nothing changes?
It seems there is a bug? Should I report it, or is it the expected behaviour?
Could someone enlighten me, what this SHRINK is actually doing?
Is it worth to report this as bug, if not a software bug it is at least a documentation bug because it doesn't mention under which conditions it is working?
P.S.: OMG the posting looks terrible, who's the one to blame for this forum software where it is not possible to use fixed size fonts, or format paragraphs as code, or what about the fact that the forum software is using default SQLPlus output as META for some graphical lines?
Isn't this the forum for Oracle Database users?
Edited by: Gerrit Haase on 20.11.2012 13:44So, you are kidding with me? No? Who are you?
How can I block users here? Is there a moderator present at this forum?
Maybe you read my initial post again?
I didn't look at the wrong place.
I reported you for general abuse.
SQL> define
DEFINE _DATE = "20.11.12" (CHAR)
DEFINE CONNECTIDENTIFIER = "MXVC01" (CHAR)
DEFINE _USER = "SYS" (CHAR)
DEFINE _PRIVILEGE = "AS SYSDBA" (CHAR)
DEFINE SQLPLUSRELEASE = "1102000200" (CHAR)
DEFINE _EDITOR = "Notepad" (CHAR)
DEFINE OVERSION = "Oracle Database 11g Release 11.2.0.2.0 - 64bit Production" (CHAR)
DEFINE ORELEASE = "1102000200" (CHAR)
SQL> SELECT * FROM dba_temp_free_space;
TABLESPACE_NAME TABLESPACE_SIZE ALLOCATED_SPACE FREE_SPACE
TEMP 3,2748E+10 1306517504 3,1443E+10
SQL> select TABLESPACE_SIZE/power(2,20), ALLOCATED_SPACE/power(2,20), FREE_SPACE/power(2,20) from dba_temp_free_space ;
TABLESPACE_SIZE/POWER(2,20) ALLOCATED_SPACE/POWER(2,20) FREE_SPACE/POWER(2,20)
31230,9922 1245,99219 29986
SQL> ALTER TABLESPACE temp SHRINK SPACE;
Tablespace altered.
SQL> select TABLESPACE_SIZE/power(2,20), ALLOCATED_SPACE/power(2,20), FREE_SPACE/power(2,20) from dba_temp_free_space ;
TABLESPACE_SIZE/POWER(2,20) ALLOCATED_SPACE/POWER(2,20) FREE_SPACE/POWER(2,20)
31230,9922 1244,99219 *29986*
R:\mxvc01>dir temp
Volume in drive R is Disk_R
Volume Serial Number is 248B-61D4
Directory of R:\mxvc01
20.11.2012 08:09 32.748.077.056 TEMP01.DBF
1 File(s) 32.748.077.056 bytes
0 Dir(s) 8.259.297.280 bytes free
SQL> alter tablespace temp shrink tempfile 'R:\mxvc01\TEMP01.DBF';
alter tablespace temp shrink tempfile 'R:\mxvc01\TEMP01.DBF'
ERROR at line 1:
ORA-03214: File Size specified is smaller than minimum required
*It clearly says that there is 29986 MB Space FREE and the above shrink space changes nothing and so does shrink tempfile:*
SQL> alter tablespace temp shrink tempfile 'R:\mxvc01\TEMP01.DBF';
alter tablespace temp shrink tempfile 'R:\mxvc01\TEMP01.DBF'
ERROR at line 1:
ORA-03214: File Size specified is smaller than minimum required
SQL> alter tablespace temp shrink tempfile 'R:\mxvc01\TEMP01.DBF' KEEP 20M;
Tablespace altered.
R:\mxvc01>dir temp
Volume in drive R is Disk_R
Volume Serial Number is 248B-61D4
Directory of R:\mxvc01
20.11.2012 08:24 32.748.077.056 TEMP01.DBF
1 File(s) 32.748.077.056 bytes
0 Dir(s) 8.259.280.896 bytes free
*... nothing changes, the tempfile isn't smaller now ...* -
FIXED ORA-02180 when Creating a Temporary Tablespace
I am using Oracle 9i on a Win 2003 machine.
I have just performed a recovery of all my datafiles and have successfully opened the database using ALTER DATABASE OPEN;
I have been using THIS as a guide and am now at the stage of creating a new temp tablespace and dropping the old one (step 8.).
I use the following SQL,
CREATE TEMPORARY TABLESPACE temp02 TEMPFILE 'c:\oracle\oradata\bcs\temp02.dbf' SIZE 100mb AUTOEXTEND OFF EXTENT MANAGEMENT LOCAL;
However it returns the following error:
ERROR at line 1:
ORA-02180: invalid option for CREATE TABLESPACE
Having googled the error it just says to make sure I am specifying a vaild option such as a datafile. I thought that is what I am doing!?
Could anyone please point out where I am going wrong and suggest a solution. It would be greatly appreciated.
Regards
Toby
Message was edited by:
redeyeHi,
CREATE TEMPORARY TABLESPACE temp02 >TEMPFILE 'c:\oracle\oradata\bcs\temp02.dbf' SIZE 100mb AUTOEXTEND OFF
EXTENT MANAGEMENT LOCAL;i think above creating temporary tablespace syntax may be wrong
why r u using AUTOEXTEND OFF?
plz try the following syntax
CREATE TEMPORARY TABLESPACE temp02 TEMPFILE 'c:\oracle\oradata\bcs\temp02.dbf' SIZE 100mb
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 10m;
Regards ... -
ORA-03212 temporary tablespace
Hi all,
we run a single instance database on file system (no ASM).
The database has benn running fine for several weeks now. 2 days ago however the following error came up:
"*** MODULE NAME:(DBMS_SCHEDULER) 2012-09-02 06:00:03.470
*** ACTION NAME:(MGMT_CONFIG_JOB_1) 2012-09-02 06:00:03.470
ERROR: kfnUseConn - failure to make a connection
ORA-03212: Temporary Segment cannot be created in locally-managed tablespace".
I changed the user's (oracle_ocm) temp tablespace to "TEMPORARY LOCAL". which should avoid that error in future.
My question:
What is the appropriate temporary tablespace for system users?
We run quite a lot of databases that were created with version 7.x and migrated up to version 10 or 11. They all used to have PERMANENT tablespaces as temp tbs for the users 'SYS, SYSTEM, DIP, APPQOSSYS, CSMIG' which did not make any problems up to now.
Should I change default temporary tbs to TBLSPC_TEMP for all users including those mentioned above?
FJHPlease post output of below commands :
1. select tablespace_name from dba_data_files where tablespace_name like '%TEMP%';
If you gets any name here, it means your temp tablespace is not really a temp one, its a permanent one whose name is temp, because if you have created temp tablespace with the TEMPFILE keyword, then only its a really temp tablespace. DBA_DATA_FILES do not shows the datafiles which have been created with TEMPFILE keyword.
2.set long 999999;
SELECT DBMS_METADATA.GET_DDL('TABLESPACE','TEMP') FROM DUAL;
In above output if you don't see TEMPFILE keyword then ORA-03212 is correct and as documented.
Now, if you want your TEMPORARY tablespace to be Locally Managed then you should use the TEMPFILE clause and NOT DATAFILE while creating the TEMPORARY TABLESPACE.
create temporary tablespace temp tempfile
'/u10/oradata/cprpt/temp01.dbf' size 250M reuse,
'/u10/oradata/cprpt/temp02.dbf' size 250M reuse,
'/u10/oradata/cprpt/temp03.dbf' size 250M reuse,
'/u10/oradata/cprpt/temp04.dbf' size 250M reuse
extent management local uniform size 3M;
http://www.dbasupport.com/forums/showthread.php?t=31317
Regards
Girish Sharma -
Temporary tablespace Oracle 8i
Hi,
We are having oracle 8i database on windows OS.
Now, the existing TEMP TS in our database is dictionary managed.
So, can i drop the existing TEMP TS and create a new one with locally managed ?
if i create new TEMP TS (locally managed) then, should i keep temp datafiles autoextend ON or OFF ? which is advisable ?
doing so, will it help in improving the performance of the database upto some level ?
With regardsHi,
I have dropped the exiting TEMP (dictionary managed) TS but getting error when i am trying to create a new one .i.e. locally managed
Storage parameters of existing TEMP TS (dictionary) that i dropped :-
CREATE TABLESPACE TEMP DATAFILE
'D:\ORACLE\ORADATA\EITXIS\TEMP01.DBF' SIZE 8388800K AUTOEXTEND ON NEXT 640K MAXSIZE UNLIMITED,
'D:\ORACLE\ORADATA\EITXIS\TEMP02.DBF' SIZE 500M AUTOEXTEND OFF
MINIMUM EXTENT 64K
LOGGING
DEFAULT STORAGE (
INITIAL 64K
NEXT 64K
MINEXTENTS 1
PCTINCREASE 0
ONLINE
TEMPORARY
EXTENT MANAGEMENT DICTIONARY;
Storage parameters of TEMP TS (locally) that i am trying to create :-
CREATE TEMPORARY TABLESPACE TEMP TEMPFILE
'D:\ORACLE\ORADATA\EITXIS\temp01.dbf' SIZE 1024M AUTOEXTEND ON NEXT 1M,
'D:\ORACLE\ORADATA\EITXIS\temp02.dbf' SIZE 1024M AUTOEXTEND OFF
EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;
But when i am trying to create the new TEMP TS (locally managed) i get the below error :-
ORA-03214: File Size specified is smaller than minimum requrired
where i have done mistake ?
Its ok now ...... TEMP TS created with locally managed, but does new storage parameters for TEMP TS (locally), mentioned above are proper now ?
With Regards
Edited by: user640001 on May 11, 2009 1:02 AM
Maybe you are looking for
-
Hello, I live in Australia. Since May 5 after the Security Update 2014-002 ALL my Mac devices (computers, laptop,ipad, iphone) stopped finding ALL yahoo servers. So I can't open ANY yahoo website. I can receive emails in my mail app but I can't sen
-
How to save landscape print layout for report designed in SQL Server 2005
How to save page setup for a report wich was designed in SQL Server 2005 RS? Each time report is previewed, I have to change portrate to landscape orientation and left and right marging from 0,5 to 0,25, to be able to see all fieldas on the report.
-
Suddenly yesterday, I can´t download any programs to my Imac. When I start download, the screen just turn black and nothing more happen. All the software is updated and I don´t remind we have used any download manager before. We just moved back from
-
Is there a way to save word docs on the iphone?
-
I have an issue with the xml im getting back from biztalk using a wcf-sql adapter. Im getting a strange blank namespace on a child element. <ShippedPackages xmlns="http://Correct.Schema"> <Package xmlns=""> <SALESORG>4000</SALESORG> <SOLDTO>5111632</