Tablespace type
Hi,
Is there any primary difference between tablespace( system and undo and temp and users) in architectures?
Asking about data block and header and rowid etc..
Undo and Temp should be standard block size ?
no differences as per i know.
BUT
"Oracle supports multiple block sizes in a database. The standard block size is used for the SYSTEM tablespace. This is set when the database is created and can be any valid size. You specify the standard block size by setting the initialization parameter DB_BLOCK_SIZE. Legitimate values are from 2K to 32K.
In the initialization parameter file or server parameter, you can configure subcaches within the buffer cache for each of these block sizes. Subcaches can also be configured while an instance is running. You can create tablespaces having any of these block sizes. The standard block size is used for the system tablespace and most other tablespaces."
Edited by: you on Apr 6, 2010 3:06 AM
Similar Messages
-
PSAPTEMP Tablespace in ECC6.0
Dear all,
After upgrading from 4.6c to ECC6.0, we found that the tablespace PSAPTEMP is quite different from the other tablespaces.
Given below is the brtools output of the tablespaces:
Pos. Tablespace Type Status ExtMan. SegMan. Backup Files/AuExt.
Total[KB] Used[%] Free[KB] MaxSize[KB] ExtSize[KB] FreeExt. Largest[KB]
45 - PSAPSTABI DATA ONLINE LOCAL MANUAL NO 2/0
16777216 85.04 2509248 16777216 0 264 664576:656384:262080:262080:109568
46 - PSAPTEMP TEMP ONLINE LOCAL MANUAL NO 1/0
9216000 0.00 9216000 9216000 0 0 0:0:0:0:0
47 - PSAPUNDO UNDO ONLINE LOCAL MANUAL NO 5/0
6725632 0.00 6725312 6725632 0 842 290816:287744:142336:139200:95232
PSAPTEMP alone has the last field as 0:0:0:0:0.
1. Do we need to modify/alter the psaptemp tablespace to be normal?
2. How do we assign the correct size of the PSAPTEMP tablespace to our environment?
Thanks & Regards
SenthilThanks Sudha for replying:
I tryed to refresh the db02 and it schedules a background job:
Job log overview for job: REFRESH SPACE STATISTIC:DEFAULT / 08532100
Date Time Message text Message class Message no. Message type
12/20/2007 08:53:22 Job started 00 516 S
12/20/2007 08:53:22 Step 001 started (program RSORACOLR, variant &0000000000000, user ID LDING) 00 550 S
12/20/2007 08:53:22 Job finished 00 517 S
But the background job finished successfully, but without collecting statistics
Regards
Senthil -
How to calculate AUTOEXTEND ON NEXT in tablespace clause
hi
Please explain How to calculate AUTOEXTEND ON NEXT in tablespace clause.
whether AUTOEXTEND ON NEXT 50M or 100M or 500M
Thanks174313 wrote:
hi
Please explain How to calculate AUTOEXTEND ON NEXT in tablespace clause.
whether AUTOEXTEND ON NEXT 50M or 100M or 500M
ThanksThe autoextend size depends on the following :-
1) Tablespace type Dictionary managed (DMT) or Locally managed (LMT)
2) Segment space management manual or Auto.
3) Extent allocation management Autoallocate or uniform.
If your tablespace is Locally managed with segment management Auto (ASSM) and with extent management is uniform , the autoextend size will be uniform for all the extents , initial and next extents all will be uniform size .
If your tablespace is Locally managed with segment management Auto (ASSM) and with extent management is autoallocate, Oracle will size the extents automatically starts with 64KB and can go upto 64MB.
If you have dictionary managed tablespace you will specify the next size at tablespace creation.
Hope this helps. -
Reclaim unused space in tablespace
Hi,
I have a tablespace with a size of 150GB, and after 2 years the company told me the retention period for our data is only 4 months and after deleting the data I'm only using 40GB out of the 150GB size of the tablespace where my table is located. My problem is how can I shrink the size of the tablespace?
I have tried to resize the datafiles but I have little success because I have only been able to shrink 20GB so my tablespace size is still big(130GB).
I have the option of shutting down the database for a max of 4 to 5 hours. Aside from exp/imp what other solution can I do?
Kindly Help.
Thanks and Best RegardsIs this a 10g database? You may not need to move to a different tablespace.
Have a read of the "shrink space" entry on http://www.psoug.org/reference/tables.html
(also check the manual: http://download-west.oracle.com/docs/cd/B13789_01/server.101/b10759/statements_3001.htm#i2192484)
That might help -- and note that the segment space management for the tablespace has to be automatic otherwise you'll get an ORA-10635 invalid segment or tablespace type error message.
Hope that works for you. -
TEMPORARY TABLESPACE에서 TEMPFILE 과 DATAFILE의 차이점 (8.1.X ~ 9I)
제품 : ORACLE SERVER
작성날짜 : 2003-11-27
PURPOSE
이 문서에서는 Oracle 7.3부터 사용되어 오던 create tablespace ... temporary
형태와, 8i부터 사용되는 create temporary tablespace... 의 차이점을 정리해
본다.
tablespace의 temporay type과 permanent type에 대한 비교는 <Bulletin#: 11938>
를 참조하도록 하고 여기에서는 permanent에 대해서는 논외로 한다.
Explanation
temporary segment가 생성 가능한 tablespace의 type과 temporary tablesapce에서
datafile과 tempfile의 차이점을 설명한다.
1. temporary segment를 생성가능한 tablespace type 정리
temporary tablespace의 tempfile과 datafile을 비교하기 전에, tablespace의
type들을 확인해 보고, 이 중 temporary segment가 생성될 수 있는 tablespace
type을 version별로 정리해본다.
tablespace는 7.2까지는 permanent type으로 dictionary managed방식으로
space를 할당/해제하던 방식만이 존재했다. db user의 temporary tablespace로
임의의 tablespace를 지정가능하였고, 해당 db user의 sort operation은
지정된 tablespace에서 발생하며, 다른 tablespace와 특별히 구분되는 것은
없었다.
이후, 7.3에 temporary type이 추가되고, 8i에서 locally managed type과 일반
datafile이 아닌 tempfile이 소개되면서 8i를 기준으로 기본적으로 다음과 같이
4가지 형태의 tablespace 형태가 가능하다.
이중 (1) ~ (3)번까지는 일반 datafile형태이고, (4)번의 경우는 이 문서에서
자세히 살펴볼 tempfile이다.
(locally managed와 dictionary managed의 차이점 및 사용 방법은
<Bulletin #: 18261>과 <Bulletin #: 11860> 참조)
(1) permanent-dictionary managed
(2) permanent-locally managed
(3) temporary-dictionary managed
(4) tempfile-locally managed
[주의] 위의 종류에 temporary datafile에 locally managed 형태의 tablespace는
없는것에 주의한다.
그리고 만약 system tablespace가 locally managed로 이미 생성된 경우에는
이후 모든 tablespace는 locally managed로 생성이 가능하고, dictionary
managed 형태는 생성하면 ORA-12913 (Cannot create dictionary managed
tablespace) 오류가 발생하게 된다.
이러한 여러가지 type의 tablespace중 temporary segment를 생성할 수 있는
tablespace에 제약이 존재한다.
- 8i: 어떠한 형태의 tablespace라도 db user의 temporary tablespace로 지정
가능하다. 단, permanent-locally managed 형태의 tablespace에 sort가
발생하게 되면 ORA-3212 (Temporary Segment cannot be created in
locally-managed tablespace) 오류가 발생하게 된다.
SQL> alter user scott temporary tablespace PERM_LOCAL;
User altered.
connect scott/tiger
SQL> select * from dept order by 1;
ORA-03212: Temporary Segment cannot be created in locally-managed
tablespace
- 9i: db user의 default temporary tablespace 지정 자체가 다음 두 가지
type만이 가능한다.
-temporary-dictionary managed
-tempile-locally managed
만약 permanent type의 tablespace를 db user의 tempoary tablespace로
지정하면, ORA-12911 (permanent tablespace cannot be temporary tablespace)
오류가 발생한다.
2. tempfile과 datafile의 비교
아래에서 tablespace지정시 tempfile과 datafile형태를 비교하게 되는데,
단, datafile형태의 경우 permanent type에 대해서는 언급하지 않는다.
(1) tempile의 특징
Oracle7.3에서 tablespace에 생성시 temporary option을 이용하여 생성되는
tablespace를 구성하는 화일은 datafile이다. 단지 이것이 기존의 permanent
type과 구별되는것은 이 tablespace에 생성되는 segment들이 매번 sort
operation마다 별도로 생성되는 대신, 하나의 segment로 만들어지면서
다른 session에서의 sort operation이 같은 segment를 공유하는 것이다.
(자세한 것은 <Bulletin#: 11938> 참조)
Oracle8.1부터 추가된 tempfile형태의 중요한 특징은 tempfile에 발생하는
변경사항은 redo log file에 기록되지 않는다는 것이다. tempfile에
checkpoint정보도 기록하지 않고 이에 따라 datafile recovery시에도
tempfile에 대해서는 recovery가 필요없게 된다.
이와 같은 이유로 standby database에서 read-only mode로 open하고
조회시 sort가 발생하여 tempfile이 변경되는것은 문제가 되지 않아
사용이 가능하다.
그리고 이미 앞에서 설명한 것과 같이 tempfile은 항상 locally managed
type으로만 생성이 되며, datafile형태의 temporary tablespace는 다음과
같이 locally managed type으로 생성 자체가 불가능하다.
SQL> create tablespace temp_datafile_local
2 DATAFILE '/ora/oradata/V920/temp_data.dbf' size 100M
3 TEMPORARY
4 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
ORA-25144: invalid option for CREATE TABLESPACE with TEMPORARY contents
(2) temporary tablespace 생성 방법 비교
- tempfile형태의 경우
tempfile로 temporary tablespace를 생성하는 경우는 다음과 같이
생성하여야 하며, 반드시 locally managed 형태로만 생성 가능하다.
SQL> create TEMPORARY tablespace temp_tempfile_local
2 TEMPFILE '/ora/V920/temp_temp.dbf' size 100M
3 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
아래 명령어에서 3번 line을 제거하고 생성하여도 default로 locally
managed로 생성이 되며, dictionary managed 형태로 생성하고자
3번 line대신 storage option을 추가하면
ORA-2180 (invalid option for CREATE TABLESPACE) 오류가 발생한다.
- datafile형태의 경우
다음과 같은 형태로 생성하게 되면, dictionary managed type의
temporary datafile형태로 tablespace가 만들어진다. 단, 9i의 경우
이미 앞에서 언급한대로 system tablespace가 locally managed인 경우에는
이와 같은 dictionary managed tablespace 생성은 ORA-12913이 발생하면서
불가능하게 된다.
SQL> create tablespace temp_datafile_dict
2 datafile '/ora/oradata/V920/temp_data.dbf' size 100M
3 TEMPORARY;
(3) dictionary view 의 차이
먼저 dba_tablespaces를 통해
SQL> select tablespace_name, contents, extent_management,
allocation_type from dba_tablespaces;
TABLESPACE_NAME CONTENTS EXTENT_MAN ALLOCATIO
TEMP_TEMPFILE_LOCAL TEMPORARY LOCAL UNIFORM
TEMP_DATAFILE_DICT TEMPORARY DICTIONARY
- tempfile의 경우
SQL> select STATUS, ENABLED, NAME from v$tempfile;
STATUS ENABLED NAME
ONLINE READ WRITE /ora/V920/temp_temp.dbf
SQL> select FILE_NAME, TABLESPACE_NAME from dba_temp_files;
FILE_NAME TABLESPACE_NAME
/ora/V920/temp_temp.dbf TEMP_TEMPFILE_LOCAL
- datafile 형태의 경우
다음과 같이 v$datafile과 dba_data_files를 통해 조회한다.
SQL> select STATUS, ENABLED, NAME from v$datafile;
STATUS ENABLED NAME
ONLINE READ WRITE /ora/oradata/V920/temp_data.dbf
SQL> select FILE_NAME, TABLESPACE_NAME from dba_data_files;
FILE_NAME TABLESPACE_NAME
/ora/oradata/V920/temp_data.dbf TEMP_DATAFILE_DICT
(4) tempfile의 삭제에 대해서
datafile의 경우 tablespace를 삭제하지 않고 datafile만 삭제하는 방법은
존재하지 않는다. 물론 alter database datafile 'filename' offline drop;
과 같은 command가 있지만 이것도 datafile을 데이타베이스에서 지워주는
것이 아니며 이렇게 offline drop된 datafile을 포함하는 tablespace는
recovery가 불가능한 경우라면 tablespace자체를 삭제해야 한다.
그런데 tempfile의 경우는 temporary tablespace는 그대로 유지한 채,
tempfile만 삭제하는 것이 가능하다.
SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
2 drop;
8i의 경우라면 이와 같은 명령어 후 실제 directory로 이동하여 직접
tmep_temp01.dbf를 삭제하여야 한다.
9i에서는 drop뒤에 including datafiles 라는 option을 추가하여 tempfile의
drop시 바로 os상에서도 삭제되도록 할 수 있다.
SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
2 drop including contents;
만약 이러한 방법으로, tempfile을 해당 temporary tablespace에서 모두
삭제한 경우, 실제 해당 tablespace에 disk sort가 필요하게 되면,
그때는 ORA-25153 (Temporary Tablespace is Empty) 오류가 발생하게 된다.
이때는 다음과 같이 임의의 tempfile을 다시 추가할 수 있다.
SQL> alter tablespace TEMP_TEMPFILE_LOCAL
2 add tempfile '/oradata/V817/temp_temp02.dbf';
Reference Documents
<Note:160426.1> TEMPORARY Tablespaces : Tempfiles or Datafiles ?제품 : ORACLE SERVER
작성날짜 : 2003-11-27
PURPOSE
이 문서에서는 Oracle 7.3부터 사용되어 오던 create tablespace ... temporary
형태와, 8i부터 사용되는 create temporary tablespace... 의 차이점을 정리해
본다.
tablespace의 temporay type과 permanent type에 대한 비교는 <Bulletin#: 11938>
를 참조하도록 하고 여기에서는 permanent에 대해서는 논외로 한다.
Explanation
temporary segment가 생성 가능한 tablespace의 type과 temporary tablesapce에서
datafile과 tempfile의 차이점을 설명한다.
1. temporary segment를 생성가능한 tablespace type 정리
temporary tablespace의 tempfile과 datafile을 비교하기 전에, tablespace의
type들을 확인해 보고, 이 중 temporary segment가 생성될 수 있는 tablespace
type을 version별로 정리해본다.
tablespace는 7.2까지는 permanent type으로 dictionary managed방식으로
space를 할당/해제하던 방식만이 존재했다. db user의 temporary tablespace로
임의의 tablespace를 지정가능하였고, 해당 db user의 sort operation은
지정된 tablespace에서 발생하며, 다른 tablespace와 특별히 구분되는 것은
없었다.
이후, 7.3에 temporary type이 추가되고, 8i에서 locally managed type과 일반
datafile이 아닌 tempfile이 소개되면서 8i를 기준으로 기본적으로 다음과 같이
4가지 형태의 tablespace 형태가 가능하다.
이중 (1) ~ (3)번까지는 일반 datafile형태이고, (4)번의 경우는 이 문서에서
자세히 살펴볼 tempfile이다.
(locally managed와 dictionary managed의 차이점 및 사용 방법은
<Bulletin #: 18261>과 <Bulletin #: 11860> 참조)
(1) permanent-dictionary managed
(2) permanent-locally managed
(3) temporary-dictionary managed
(4) tempfile-locally managed
[주의] 위의 종류에 temporary datafile에 locally managed 형태의 tablespace는
없는것에 주의한다.
그리고 만약 system tablespace가 locally managed로 이미 생성된 경우에는
이후 모든 tablespace는 locally managed로 생성이 가능하고, dictionary
managed 형태는 생성하면 ORA-12913 (Cannot create dictionary managed
tablespace) 오류가 발생하게 된다.
이러한 여러가지 type의 tablespace중 temporary segment를 생성할 수 있는
tablespace에 제약이 존재한다.
- 8i: 어떠한 형태의 tablespace라도 db user의 temporary tablespace로 지정
가능하다. 단, permanent-locally managed 형태의 tablespace에 sort가
발생하게 되면 ORA-3212 (Temporary Segment cannot be created in
locally-managed tablespace) 오류가 발생하게 된다.
SQL> alter user scott temporary tablespace PERM_LOCAL;
User altered.
connect scott/tiger
SQL> select * from dept order by 1;
ORA-03212: Temporary Segment cannot be created in locally-managed
tablespace
- 9i: db user의 default temporary tablespace 지정 자체가 다음 두 가지
type만이 가능한다.
-temporary-dictionary managed
-tempile-locally managed
만약 permanent type의 tablespace를 db user의 tempoary tablespace로
지정하면, ORA-12911 (permanent tablespace cannot be temporary tablespace)
오류가 발생한다.
2. tempfile과 datafile의 비교
아래에서 tablespace지정시 tempfile과 datafile형태를 비교하게 되는데,
단, datafile형태의 경우 permanent type에 대해서는 언급하지 않는다.
(1) tempile의 특징
Oracle7.3에서 tablespace에 생성시 temporary option을 이용하여 생성되는
tablespace를 구성하는 화일은 datafile이다. 단지 이것이 기존의 permanent
type과 구별되는것은 이 tablespace에 생성되는 segment들이 매번 sort
operation마다 별도로 생성되는 대신, 하나의 segment로 만들어지면서
다른 session에서의 sort operation이 같은 segment를 공유하는 것이다.
(자세한 것은 <Bulletin#: 11938> 참조)
Oracle8.1부터 추가된 tempfile형태의 중요한 특징은 tempfile에 발생하는
변경사항은 redo log file에 기록되지 않는다는 것이다. tempfile에
checkpoint정보도 기록하지 않고 이에 따라 datafile recovery시에도
tempfile에 대해서는 recovery가 필요없게 된다.
이와 같은 이유로 standby database에서 read-only mode로 open하고
조회시 sort가 발생하여 tempfile이 변경되는것은 문제가 되지 않아
사용이 가능하다.
그리고 이미 앞에서 설명한 것과 같이 tempfile은 항상 locally managed
type으로만 생성이 되며, datafile형태의 temporary tablespace는 다음과
같이 locally managed type으로 생성 자체가 불가능하다.
SQL> create tablespace temp_datafile_local
2 DATAFILE '/ora/oradata/V920/temp_data.dbf' size 100M
3 TEMPORARY
4 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
ORA-25144: invalid option for CREATE TABLESPACE with TEMPORARY contents
(2) temporary tablespace 생성 방법 비교
- tempfile형태의 경우
tempfile로 temporary tablespace를 생성하는 경우는 다음과 같이
생성하여야 하며, 반드시 locally managed 형태로만 생성 가능하다.
SQL> create TEMPORARY tablespace temp_tempfile_local
2 TEMPFILE '/ora/V920/temp_temp.dbf' size 100M
3 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
아래 명령어에서 3번 line을 제거하고 생성하여도 default로 locally
managed로 생성이 되며, dictionary managed 형태로 생성하고자
3번 line대신 storage option을 추가하면
ORA-2180 (invalid option for CREATE TABLESPACE) 오류가 발생한다.
- datafile형태의 경우
다음과 같은 형태로 생성하게 되면, dictionary managed type의
temporary datafile형태로 tablespace가 만들어진다. 단, 9i의 경우
이미 앞에서 언급한대로 system tablespace가 locally managed인 경우에는
이와 같은 dictionary managed tablespace 생성은 ORA-12913이 발생하면서
불가능하게 된다.
SQL> create tablespace temp_datafile_dict
2 datafile '/ora/oradata/V920/temp_data.dbf' size 100M
3 TEMPORARY;
(3) dictionary view 의 차이
먼저 dba_tablespaces를 통해
SQL> select tablespace_name, contents, extent_management,
allocation_type from dba_tablespaces;
TABLESPACE_NAME CONTENTS EXTENT_MAN ALLOCATIO
TEMP_TEMPFILE_LOCAL TEMPORARY LOCAL UNIFORM
TEMP_DATAFILE_DICT TEMPORARY DICTIONARY
- tempfile의 경우
SQL> select STATUS, ENABLED, NAME from v$tempfile;
STATUS ENABLED NAME
ONLINE READ WRITE /ora/V920/temp_temp.dbf
SQL> select FILE_NAME, TABLESPACE_NAME from dba_temp_files;
FILE_NAME TABLESPACE_NAME
/ora/V920/temp_temp.dbf TEMP_TEMPFILE_LOCAL
- datafile 형태의 경우
다음과 같이 v$datafile과 dba_data_files를 통해 조회한다.
SQL> select STATUS, ENABLED, NAME from v$datafile;
STATUS ENABLED NAME
ONLINE READ WRITE /ora/oradata/V920/temp_data.dbf
SQL> select FILE_NAME, TABLESPACE_NAME from dba_data_files;
FILE_NAME TABLESPACE_NAME
/ora/oradata/V920/temp_data.dbf TEMP_DATAFILE_DICT
(4) tempfile의 삭제에 대해서
datafile의 경우 tablespace를 삭제하지 않고 datafile만 삭제하는 방법은
존재하지 않는다. 물론 alter database datafile 'filename' offline drop;
과 같은 command가 있지만 이것도 datafile을 데이타베이스에서 지워주는
것이 아니며 이렇게 offline drop된 datafile을 포함하는 tablespace는
recovery가 불가능한 경우라면 tablespace자체를 삭제해야 한다.
그런데 tempfile의 경우는 temporary tablespace는 그대로 유지한 채,
tempfile만 삭제하는 것이 가능하다.
SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
2 drop;
8i의 경우라면 이와 같은 명령어 후 실제 directory로 이동하여 직접
tmep_temp01.dbf를 삭제하여야 한다.
9i에서는 drop뒤에 including datafiles 라는 option을 추가하여 tempfile의
drop시 바로 os상에서도 삭제되도록 할 수 있다.
SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
2 drop including contents;
만약 이러한 방법으로, tempfile을 해당 temporary tablespace에서 모두
삭제한 경우, 실제 해당 tablespace에 disk sort가 필요하게 되면,
그때는 ORA-25153 (Temporary Tablespace is Empty) 오류가 발생하게 된다.
이때는 다음과 같이 임의의 tempfile을 다시 추가할 수 있다.
SQL> alter tablespace TEMP_TEMPFILE_LOCAL
2 add tempfile '/oradata/V817/temp_temp02.dbf';
Reference Documents
<Note:160426.1> TEMPORARY Tablespaces : Tempfiles or Datafiles ? -
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> -
Dear all,
We are getting red alert message on Database administration in EWA report ,
Kindly check below logs :
We checked your system for tablespaces that may overflow in the near future.
10.2.1 Tablespaces - Autoextend Limit
Tablespace Size (KB) Free (KB) Avg. Chg/Week (KB) %-Used AutoExt %-Used after AutoExt
PSAPSR3 200028160 316992 5557700 99 204.800.000 98
PSAPSR3700 72826880 3591936 8429 95 174.080.000 40
SYSAUX 430080 31616 12596 92 10.240.000 4
You have set the 'autoextend' option for some tablespaces to a limited value. More than 95% of the limited size is already used.
Recommendation: Increase the values for the limits as soon as possible, or use SAPDBA to add new data files to the tablespaces of the table above.
Implementation: To determine the size required, consider the tablespaces' history of storage usage. Once you have added a data file, back up the extended tablespace. This ensures that the new state of the database can be recovered.
Kindly advise to resovle the above issues ..Dear Shroff,
Pls check the show table space details through BRtools
BR1001I BRSPACE 7.00 (49)
BR1002I Start of BRSPACE processing: seerdask.dbw 2010-11-29 11.30.06
BR0101I Parameters
Name Value
oracle_sid IRP
oracle_home /oracle/IRP/102_64
oracle_profile /oracle/IRP/102_64/dbs/initIRP.ora
sapdata_home /oracle/IRP
sap_profile /oracle/IRP/102_64/dbs/initIRP.sap
space_function dbshow
space_copy_dir /oracle/IRP/sapreorg
scroll_lines 20
system_info orairp/orairp PRODORADB AIX 3 5 00018B6AD400
oracle_info IRP 10.2.0.4.0 8192 51738 758307642 PRODORADB
sap_info 700 SAPSR3 0002LK0003IRP0011D11604089540015Mainte
nance_ORA
make_info rs6000_64 OCI_102 Aug 2 2010
command_line /usr/sap/IRP/SYS/exe/run/brspace -p initIRP.sap -
s 20 -l E -U -f dbshow -c tsinfo
BR0280I BRSPACE time stamp: 2010-11-29 11.30.11
BR1009I Name of database instance: IRP
BR1010I BRSPACE action ID: seerdask
BR1011I BRSPACE function ID: dbw
BR1012I BRSPACE function: dbshow
BR1036I Class of information to be shown: tsinfo
BR0280I BRSPACE time stamp: 2010-11-29 11.30.14
BR0659I List menu 259 + you can select one or more entries
List of database tablespaces
Pos. Tablespace Type Status ExtMan. SegMan. Backup Files/AuExt.
Total[KB] Used[%] Free[KB] MaxSize[KB] ExtSize[KB] FreeExt. Lar
gest[KB]
1 - PSAPSR3 DATA ONLINE LOCAL AUTO NO 20/20
200192000 99.84 327168 204800000 4608000 21 79
8720:655360:614400:593920:593920+
2 - PSAPSR3700 DATA ONLINE LOCAL AUTO NO 17/17
72826880 95.07 3591936 174080000 101253120 17 612
3520:6123520:6103040:6082560:6082560+
3 - PSAPSR3USR DATA ONLINE LOCAL AUTO NO 1/1
20480 90.00 2048 10240000 10219520 1 1021
9520+:2048:0:0:0
4 - PSAPTEMP TEMP ONLINE LOCAL MANUAL NO 1/1
4362240 0.00 4362240 10240000 5877760 0 587
7760+:0:0:0:0
5 - PSAPUNDO UNDO ONLINE LOCAL MANUAL NO 1/1
10240000 0.16 10223552 10240000 0 585 280
1664:1372160:1024128:851968:474112
6 - SYSAUX DATA ONLINE LOCAL AUTO NO 1/1
430080 94.23 24832 10240000 9809920 22 980
9920+:17344:1728:704:576
7 - SYSTEM DATA ONLINE LOCAL MANUAL NO 1/1
901120 99.38 5568 10240000 9338880 3 933
8880+:5056:448:64:0
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
BR0662I Enter your selection:
Kindly advise for resolving the above issue . -
ORA-01659: unable to allocate MINEXTENTS beyond 28 in tablespace PSAPSR3700
hi everyone
When I install ECC6.00 sr3 with oracle&HP-UX
I come across an error at the set u201Cimport abapu201D
my oracle version is 10.2.0.4
my HP-UX is 11-23
*********************import monitor log********************
ERROR: 2010-01-22 02:42:37 com.sap.inst.migmon.LoadTask run
Loading of 'DD03L' import package is interrupted with R3load error.
Process '/usr/sap/R3T/SYS/exe/run/R3load -i DD03L.cmd -dbcodepage 4102 -l DD03L.
log -stop_on_error' exited with return code 9.
For mode details see 'DD03L.log' file.
Standard error output:
/usr/lib/hpux64/dld.so: Unable to find library 'libclntsh.so.10.1'.
'DD03L.log' ****************************
(DB) ERROR: DDL statement failed
(DROP INDEX "DD03L~0")
DbSlExecute: rc = 103
(SQL error 1418)
error message returned by DbSl:
ORA-01418: specified index does not exist
(IMP) INFO: a failed DROP attempt is not necessarily a problem
DbSl Trace: Error 12801 in exec_immediate() from oci_execute_stmt(), orpc=0
DbSl Trace: ORA-12801 occurred when executing SQL stmt (parse error offset=0)
(DB) ERROR: DDL statement failed
(CREATE UNIQUE INDEX "DD03L~0" ON "DD03L" ( "TABNAME", "FIELDNAME", "AS4LOCAL",
"AS4VERS", "POSITION" ) TABLESPACE PSAPSR3700 STORAGE (INITIAL 712194033 NEXT 0
000002560K MINEXTENTS 0000000001 MAXEXTENTS 2147483645 PCTINCREASE 0 ) NOLOGGING
COMPUTE STATISTICS PARALLEL )
DbSlExecute: rc = 99
(SQL error 12801)
error message returned by DbSl:
ORA-12801: error signaled in parallel query server P015
ORA-01659: unable to allocate MINEXTENTS beyond 28 in tablespace PSAPSR3700
(DB) INFO: disconnected from DB
********************tablespace view****************
Pos. Tablespace Type Status ExtMan. SegMan. Backup Files/AuExt.
Total[KB] Used[%] Free[KB] MaxSize[KB] ExtSize[KB] FreeExt. Largest[KB]
1 - PSAPSR3 DATA ONLINE LOCAL AUTO NO 20/20
41328640 75.99 9922304 204800000 20008960 93 8192000:8192000:3624960+:1157056:866304
2 - PSAPSR3700 DATA ONLINE LOCAL AUTO NO 21/21
43868160 76.44 10337472 215040000 20008960 44 8151040:8151040:3706880+:2088896:2071488
3 - PSAPSR3USR DATA ONLINE LOCAL AUTO NO 1/1
20480 9.38 18560 10240000 10219520 1 10219520+:18560:0:0:0
4 - PSAPTEMP TEMP ONLINE LOCAL MANUAL NO 3/1
6144000 0.00 6144000 14336000 8192000 0 8192000+:0:0:0:0
5 - PSAPUNDO UNDO ONLINE LOCAL MANUAL NO 3/1
6266880 0.00 6266688 14417920 8151040 4854 8151040+:2083776:2073344:8192:8192
6 - SYSAUX DATA ONLINE LOCAL AUTO NO 1/1
204800 24.72 154176 10240000 10035200 1 10035200+:154176:0:0:0
7 - SYSTEM DATA ONLINE LOCAL MANUAL NO 2/2
1392640 49.76 699712 20480000 19087360 2 9543680:9543680:696256:3456:0
I do need yours helps
any advise will be much appreciated!
Thanks&Regards
PeterI do not know why the newlines are all missed in my posts
but in my reply everything goes well
Does somebody know the reasons?
**********************************************************8
When I install ECC6.00 sr3 with oracle&HP-UX
I come across an error at the set u201Cimport abapu201D
my oracle version is 10.2.0.4
my HP-UX is 11-23
*********************import monitor log********************
ERROR: 2010-01-22 02:42:37 com.sap.inst.migmon.LoadTask run
Loading of 'DD03L' import package is interrupted with R3load error.
Process '/usr/sap/R3T/SYS/exe/run/R3load -i DD03L.cmd -dbcodepage 4102 -l DD03L.
log -stop_on_error' exited with return code 9.
For mode details see 'DD03L.log' file.
Standard error output:
/usr/lib/hpux64/dld.so: Unable to find library 'libclntsh.so.10.1'.
'DD03L.log' ****************************
(DB) ERROR: DDL statement failed
(DROP INDEX "DD03L~0")
DbSlExecute: rc = 103
(SQL error 1418)
error message returned by DbSl:
ORA-01418: specified index does not exist
(IMP) INFO: a failed DROP attempt is not necessarily a problem
DbSl Trace: Error 12801 in exec_immediate() from oci_execute_stmt(), orpc=0
DbSl Trace: ORA-12801 occurred when executing SQL stmt (parse error offset=0)
(DB) ERROR: DDL statement failed
(CREATE UNIQUE INDEX "DD03L~0" ON "DD03L" ( "TABNAME", "FIELDNAME", "AS4LOCAL",
"AS4VERS", "POSITION" ) TABLESPACE PSAPSR3700 STORAGE (INITIAL 712194033 NEXT 0
000002560K MINEXTENTS 0000000001 MAXEXTENTS 2147483645 PCTINCREASE 0 ) NOLOGGING
COMPUTE STATISTICS PARALLEL )
DbSlExecute: rc = 99
(SQL error 12801)
error message returned by DbSl:
ORA-12801: error signaled in parallel query server P015
ORA-01659: unable to allocate MINEXTENTS beyond 28 in tablespace PSAPSR3700
(DB) INFO: disconnected from DB -
Tablespace PSAPSR3 is 100% used
hi Dear,
the PSAPSR3 tablespace is used 100% full as you can see following
BR0280I BRSPACE time stamp: 2010-09-19 23.17.59
BR0659I List menu 259 + you can select one or more entries
List of database tablespaces
Pos. Tablespace Type Status ExtMan. SegMan. Backup Files/AuExt.
Total[KB] Used[%] Free[KB] MaxSize[KB] ExtSize[KB] FreeExt. Lar
gest[KB]
1 - PSAPSR3 DATA ONLINE LOCAL AUTO NO 14/14
143360000 92.85 10246784 143360000 0 13 406
3232:4061184:2113472:960:960
2 - PSAPSR3700 DATA ONLINE LOCAL AUTO NO 13/13
67072000 99.49 345088 133120000 66048000 14 684
0320+:5263360+:5222400+:4997120+:4956160+
3 - PSAPSR3USR DATA ONLINE LOCAL AUTO NO 1/1
30720 22.50 23808 10240000 10209280 1 1020
9280+:23808:0:0:0
4 - PSAPTEMP TEMP ONLINE LOCAL MANUAL NO 1/1
6481920 0.00 6481920 10240000 3758080 0 375
8080+:0:0:0:0
5 - PSAPUNDO UNDO ONLINE LOCAL MANUAL NO 1/1
9072640 0.00 9072576 10240000 1167360 515 406
3232:1167360+:925632:589824:573440
6 - SYSAUX DATA ONLINE LOCAL AUTO NO 1/1
983040 95.24 46784 10240000 9256960 118 925
6960+:7104:3072:2048:1088
7 - SYSTEM DATA ONLINE LOCAL MANUAL NO 1/1
870400 99.16 7296 10240000 9369600 3 936
9600+:7104:128:64:0
how can i increase the tablespace with brtools or sap tcode?
is it better to increase the tablespace or add a new?
Regards,
majamilDear,
FYI....
the previous value of tablesapce PSAPSR3 was following
Pos. Tablespace Files/AuExt. Total[KB] Used[%] Free[KB] MaxSize[KB]
1 - PSAPSR3 13/13 133120000 99.99 8896 133120000
2 - PSAPSR3700 13/13 67072000 99.49 345088 133120000
3 - PSAPSR3USR 1/1 30720 22.50 23808 10240000
4 - PSAPTEMP 1/1 6481920 0.00 6481920 10240000
5 - PSAPUNDO 1/1 9072640 0.00 9072576 10240000
6 - SYSAUX 1/1 983040 95.14 47808 10240000
7 - SYSTEM 1/1 870400 99.16 7296 10240000
i have put these value during tablespace extention mean with 10 GB
Options for extension of tablespace PSAPSR3 (1. file)
1 * Last added file name (lastfile) ....... [G:\ORACLE\PRD\SAPDATA2\SR3_13\SR3.
DATA13]
2 * Last added file size in MB (lastsize) . [10000]
3 - New file to be added (file) ........... [G:\oracle\PRD\sapdata2\sr3_14\sr3.
data14]
4 # Raw disk / link target (rawlink) ...... []
5 - Size of the new file in MB (size) ..... [10000] // default vlaue
6 - File autoextend mode (autoextend) ..... [yes]
7 ? Maximum file size in MB (maxsize) ..... [] default setting
7 - Maximum file size in MB (maxsize) ..... [10000] // extended size (10GB)
8 - File increment size in MB (incrsize) .. [20]
9 - SQL command (command) ................. [alter tablespace PSAPSR3 add dataf
ile 'G:\oracle\PRD\sapdata2\sr3_14\sr3.data14' size 10000M autoextend on next 20l
M maxsize 10000M]
now current tablespace PSAPSR3 is
Pos. Tablespace Type Status ExtMan. SegMan. Backup Files/AuExt.
Total[KB] Used[%] Free[KB] MaxSize[KB] ExtSize[KB] FreeExt. Lar
gest[KB]
1 - PSAPSR3 DATA ONLINE LOCAL AUTO NO 14/14
143360000 92.85 10247808 143360000 0 13 406
above procedure is ok mean i increased the 10GB space for PSAPSR3 if not then guide me.
which size will be recommended for extending the Tablespaces PSAPSR3 and others ???.
Regards, -
Temp tablespace drop 관련 질문임다!
temp tablespace가 거의 100%사용이어서, db shutdown하고 다시 살렸는데도
줄지 않아서 (사실 이것도 왜 안주는지 궁금하거등요~!)
우선 old_temp tablespace를 new_temp tablespace를 만들었습니다.
즉,,,제가 한작업들을 개략 적어보면요
1) create temporary tablespace new_temp tempfile~~~~;
2) drop tablespace old_temp;
3) alter database default temporary tablespace new_temp;
하고 나서 모든 유저에 지정되어있는 temporary tablespace를 new_temp로 지정
해줘야 하쟎아요
즉, alter user scott temporary tablespace new_temp; 이렇게요...
근데 이걸 안해줬는데도 에러없이 scott유저는 소트를 수행하드라구요...
이거...정상인건가요????
***추가질문~!
그리고 템프싸이즈가 줄지않고 계속늘어날때의 원인과 체크포인트좀 부탁드립니다.8i에서는 tempfile이란 개념은 있었으나 default temporary tablespace라는
개념은 없었습니다. 그래서 유저에게 직접 default tablespace를 지정해주어야
했었습니다.
하지만.. 9i부터는 alter database default temporary tablespace new_temp;
명령을 하기만 하면 모든 유저의 default temporary tablespace가 default로
지정되어 있지 않으면 new_temp로 됩니다.
물론 이 경우에도 수동으로 temp를 지정할 수 있으니 실제로 유저가
temp공간을 어디에 사용하는지는..
select username, temporary_tablespace from dba_users; 를 통해서
확인해야 합니다.
scott유저는 default temporary tablespace로 지정되어서 그 쪽 temp를
사용하게 되니, 에러가 나지 않겠죠.
default temporary tablespace가 무엇으로 지정되어 있는지는,
select * from database_properties; 또는 select * from sys.props$; 로 조회하면
temporary tablespace라는 이름으로 어떤 값이 들어가 있는지 보입니다.
그리고 temp는 DB를 내렸다가 올리면 smon프로세스가 clear시켜줍니다.
temp는 아시다 싶이 당연히 sort를 해서 발생하는 것이구요. 그렇다면..
temp가 계속해서 full이 난다면.. temp를 사용하는 세션을 확인하고
temp를 사용하는 세션의 쿼리를 뽑아낸다면 쉽게 해결이 되겠죠.
아래는 제가 경험해서 처리한 것입니다.
저는 temporary tablespace가 full 났는데 도대체 쿼리를 못잡는 것이었습니다.
그래서 어떻게 했을까요? Secure CRT에 세션로그를 걸어두고 모니터링을 했죠.
vi stat.sh
interval=30 # Sleep interval in seconds
reps=1000000 # n times
j=1 # Loop variable
while [ $j -le ${reps} ]
do
echo " ----cycle ${j} / ${reps} --------"
sqlplus -s system/패스워드<<EOF
@sw.sql ${j}
exit
EOF
cat sess_${j}.dat >> sw.dat
rm sess_${j}.dat
sleep ${interval}
j=`expr ${j} + 1`
done
exit 0
vi sw.sql
set line 150
set concat "+"
col username format a10
col osuser format a10
col tablespace format a15
spool sess_&1.dat
SELECT b.tablespace,
b.segfile#,
b.segblk#,
b.blocks,
a.sid,
a.serial#,
c.spid,
a.username,
a.osuser,
a.status,
a.sql_hash_value
FROM v$session a,
v$sort_usage b,
v$process c
WHERE a.saddr = b.session_addr and a.paddr=c.addr
ORDER BY b.tablespace, b.segfile#, b.segblk#, b.blocks;
spool off
stats.sh 를 수행하고 PC킨 상태로 그냥두고 다음날 왔더니 아래처럼 temp를
계속 쓰는 넘이 나온거죠..
딱걸렸습니다.ㅎㅎ
TEMP 93 2550817 13824 92 58284 3193 PVB oracle ACTIVE 1126923165
----cycle 1792 / 1000000 --------
TEMP 93 2550817 43008 92 58284 3193 PVB oracle ACTIVE 1126923165
----cycle 1793 / 1000000 --------
TEMP 93 2550817 72192 92 58284 3193 PVB oracle ACTIVE 1126923165
----cycle 1794 / 1000000 --------
TEMP 93 2550817 101376 92 58284 3193 PVB oracle ACTIVE 1126923165
----cycle 1795 / 1000000 --------
TEMP 93 2550817 131072 92 58284 3193 PVB oracle ACTIVE 1126923165
----cycle 1796 / 1000000 --------
TEMP 93 2416673 18944 123 5171 3197 PVB oracle ACTIVE 1126923165
TEMP 93 2550817 159744 92 58284 3193 PVB oracle ACTIVE 1126923165
----cycle 1797 / 1000000 --------
TEMP 93 2416673 48128 123 5171 3197 PVB oracle ACTIVE 1126923165
TEMP
sql_hash_value값이 1126923165 이니 아래 쿼리에다가 넣으면 full 쿼리가 나오죠..
결국엔 개발자가 모든 소스코드에서 변경을 했어야 했는데.. 그렇게 하지 않아서
일부 웹서버에서의 쿼리가 이상하게 where조건없이 수행되었고 그래서 temp가
full 났던 것이랍니다.
vi sidhashsql.sql
set pages 1000
col sql_text format a120
select sql_text from v$sqltext_with_newlines
where hash_value=&hash_value order by piece;
SQL> @sidhashsql
Enter value for hash_value: 1126923165
old 2: where hash_value=&hash_value order by piece
new 2: where hash_value=1126923165 order by piece
SQL_TEXT
boan~~~~!!
아래 너무 자세하게 나와있죠?
No. 18484
TEMPORARY TABLESPACE에서 TEMPFILE 과 DATAFILE의 차이점 (8.1.X ~ 9I)
============================================================
PURPOSE
이 문서에서는 Oracle 7.3부터 사용되어 오던 create tablespace ... temporary
형태와, 8i부터 사용되는 create temporary tablespace... 의 차이점을 정리해
본다.
tablespace의 temporay type과 permanent type에 대한 비교는 <Bulletin#: 11938>
를 참조하도록 하고 여기에서는 permanent에 대해서는 논외로 한다.
Explanation
temporary segment가 생성 가능한 tablespace의 type과 temporary tablesapce에서
datafile과 tempfile의 차이점을 설명한다.
1. temporary segment를 생성가능한 tablespace type 정리
temporary tablespace의 tempfile과 datafile을 비교하기 전에, tablespace의
type들을 확인해 보고, 이 중 temporary segment가 생성될 수 있는 tablespace
type을 version별로 정리해본다.
tablespace는 7.2까지는 permanent type으로 dictionary managed방식으로
space를 할당/해제하던 방식만이 존재했다. db user의 temporary tablespace로
임의의 tablespace를 지정가능하였고, 해당 db user의 sort operation은
지정된 tablespace에서 발생하며, 다른 tablespace와 특별히 구분되는 것은
없었다.
이후, 7.3에 temporary type이 추가되고, 8i에서 locally managed type과 일반
datafile이 아닌 tempfile이 소개되면서 8i를 기준으로 기본적으로 다음과 같이
4가지 형태의 tablespace 형태가 가능하다.
이중 (1) ~ (3)번까지는 일반 datafile형태이고, (4)번의 경우는 이 문서에서
자세히 살펴볼 tempfile이다.
(locally managed와 dictionary managed의 차이점 및 사용 방법은
<Bulletin #: 18261>과 <Bulletin #: 11860> 참조)
(1) permanent-dictionary managed
(2) permanent-locally managed
(3) temporary-dictionary managed
(4) tempfile-locally managed
[주의] 위의 종류에 temporary datafile에 locally managed 형태의 tablespace는
없는것에 주의한다.
그리고 만약 system tablespace가 locally managed로 이미 생성된 경우에는
이후 모든 tablespace는 locally managed로 생성이 가능하고, dictionary
managed 형태는 생성하면 ORA-12913 (Cannot create dictionary managed
tablespace) 오류가 발생하게 된다.
이러한 여러가지 type의 tablespace중 temporary segment를 생성할 수 있는
tablespace에 제약이 존재한다.
- 8i: 어떠한 형태의 tablespace라도 db user의 temporary tablespace로 지정
가능하다. 단, permanent-locally managed 형태의 tablespace에 sort가
발생하게 되면 ORA-3212 (Temporary Segment cannot be created in
locally-managed tablespace) 오류가 발생하게 된다.
SQL> alter user scott temporary tablespace PERM_LOCAL;
User altered.
connect scott/tiger
SQL> select * from dept order by 1;
ORA-03212: Temporary Segment cannot be created in locally-managed
tablespace
- 9i: db user의 default temporary tablespace 지정 자체가 다음 두 가지
type만이 가능한다.
-temporary-dictionary managed
-tempile-locally managed
만약 permanent type의 tablespace를 db user의 tempoary tablespace로
지정하면, ORA-12911 (permanent tablespace cannot be temporary tablespace)
오류가 발생한다.
2. tempfile과 datafile의 비교
아래에서 tablespace지정시 tempfile과 datafile형태를 비교하게 되는데,
단, datafile형태의 경우 permanent type에 대해서는 언급하지 않는다.
(1) tempile의 특징
Oracle7.3에서 tablespace에 생성시 temporary option을 이용하여 생성되는
tablespace를 구성하는 화일은 datafile이다. 단지 이것이 기존의 permanent
type과 구별되는것은 이 tablespace에 생성되는 segment들이 매번 sort
operation마다 별도로 생성되는 대신, 하나의 segment로 만들어지면서
다른 session에서의 sort operation이 같은 segment를 공유하는 것이다.
(자세한 것은 <Bulletin#: 11938> 참조)
Oracle8.1부터 추가된 tempfile형태의 중요한 특징은 tempfile에 발생하는
변경사항은 redo log file에 기록되지 않는다는 것이다. tempfile에
checkpoint정보도 기록하지 않고 이에 따라 datafile recovery시에도
tempfile에 대해서는 recovery가 필요없게 된다.
이와 같은 이유로 standby database에서 read-only mode로 open하고
조회시 sort가 발생하여 tempfile이 변경되는것은 문제가 되지 않아
사용이 가능하다.
그리고 이미 앞에서 설명한 것과 같이 tempfile은 항상 locally managed
type으로만 생성이 되며, datafile형태의 temporary tablespace는 다음과
같이 locally managed type으로 생성 자체가 불가능하다.
SQL> create tablespace temp_datafile_local
2 DATAFILE '/ora/oradata/V920/temp_data.dbf' size 100M
3 TEMPORARY
4 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
ORA-25144: invalid option for CREATE TABLESPACE with TEMPORARY contents
(2) temporary tablespace 생성 방법 비교
- tempfile형태의 경우
tempfile로 temporary tablespace를 생성하는 경우는 다음과 같이
생성하여야 하며, 반드시 locally managed 형태로만 생성 가능하다.
SQL> create TEMPORARY tablespace temp_tempfile_local
2 TEMPFILE '/ora/V920/temp_temp.dbf' size 100M
3 EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;
아래 명령어에서 3번 line을 제거하고 생성하여도 default로 locally
managed로 생성이 되며, dictionary managed 형태로 생성하고자
3번 line대신 storage option을 추가하면
ORA-2180 (invalid option for CREATE TABLESPACE) 오류가 발생한다.
- datafile형태의 경우
다음과 같은 형태로 생성하게 되면, dictionary managed type의
temporary datafile형태로 tablespace가 만들어진다. 단, 9i의 경우
이미 앞에서 언급한대로 system tablespace가 locally managed인 경우에는
이와 같은 dictionary managed tablespace 생성은 ORA-12913이 발생하면서
불가능하게 된다.
SQL> create tablespace temp_datafile_dict
2 datafile '/ora/oradata/V920/temp_data.dbf' size 100M
3 TEMPORARY;
(3) dictionary view 의 차이
먼저 dba_tablespaces를 통해
SQL> select tablespace_name, contents, extent_management,
allocation_type from dba_tablespaces;
TABLESPACE_NAME CONTENTS EXTENT_MAN ALLOCATIO
TEMP_TEMPFILE_LOCAL TEMPORARY LOCAL UNIFORM
TEMP_DATAFILE_DICT TEMPORARY DICTIONARY
- tempfile의 경우
SQL> select STATUS, ENABLED, NAME from v$tempfile;
STATUS ENABLED NAME
ONLINE READ WRITE /ora/V920/temp_temp.dbf
SQL> select FILE_NAME, TABLESPACE_NAME from dba_temp_files;
FILE_NAME TABLESPACE_NAME
/ora/V920/temp_temp.dbf TEMP_TEMPFILE_LOCAL
- datafile 형태의 경우
다음과 같이 v$datafile과 dba_data_files를 통해 조회한다.
SQL> select STATUS, ENABLED, NAME from v$datafile;
STATUS ENABLED NAME
ONLINE READ WRITE /ora/oradata/V920/temp_data.dbf
SQL> select FILE_NAME, TABLESPACE_NAME from dba_data_files;
FILE_NAME TABLESPACE_NAME
/ora/oradata/V920/temp_data.dbf TEMP_DATAFILE_DICT
(4) tempfile의 삭제에 대해서
datafile의 경우 tablespace를 삭제하지 않고 datafile만 삭제하는 방법은
존재하지 않는다. 물론 alter database datafile 'filename' offline drop;
과 같은 command가 있지만 이것도 datafile을 데이타베이스에서 지워주는
것이 아니며 이렇게 offline drop된 datafile을 포함하는 tablespace는
recovery가 불가능한 경우라면 tablespace자체를 삭제해야 한다.
그런데 tempfile의 경우는 temporary tablespace는 그대로 유지한 채,
tempfile만 삭제하는 것이 가능하다.
SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
2 drop;
8i의 경우라면 이와 같은 명령어 후 실제 directory로 이동하여 직접
tmep_temp01.dbf를 삭제하여야 한다.
9i에서는 drop뒤에 including datafiles 라는 option을 추가하여 tempfile의
drop시 바로 os상에서도 삭제되도록 할 수 있다.
SQL> alter database tempfile '/oradata/V817/temp_temp01.dbf'
2 drop including contents;
만약 이러한 방법으로, tempfile을 해당 temporary tablespace에서 모두
삭제한 경우, 실제 해당 tablespace에 disk sort가 필요하게 되면,
그때는 ORA-25153 (Temporary Tablespace is Empty) 오류가 발생하게 된다.
이때는 다음과 같이 임의의 tempfile을 다시 추가할 수 있다.
SQL> alter tablespace TEMP_TEMPFILE_LOCAL
2 add tempfile '/oradata/V817/temp_temp02.dbf';
Reference Documents
<Note:160426.1> TEMPORARY Tablespaces : Tempfiles or Datafiles ?
글 수정:
민천사 (민연홍)
글 수정:
민천사 (민연홍)
가장 중요한 v$session의 sql_hash_value 컬럼이 안들어가서
수정하였습니다. 죄송합니다. -
Hi All,
I am facing issue while shrinking a table PARAMETER_DETAIL which is a IOT partition table.
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bi
PL/SQL Release 10.2.0.2.0 - Production
CORE 10.2.0.2.0 Production
TNS for Solaris: Version 10.2.0.2.0 - Production
NLSRTL Version 10.2.0.2.0 - Production
SunOS usa0300ux636 5.10 Generic_138888-03 sun4v sparc SUNW,Sun-Blade-T6320
When i am firing the below query,
alter table PARAMETER_DETAIL SHRINK space CASCADE;
alter table PARAMETER_DETAIL SHRINK space CASCADE*
ERROR at line 1:
ORA-10635: Invalid segment or tablespace type
I am getting this error.
Moreover, I have checked in dba_segments, the output is
SQL> l
1 select unique SEGMENT_NAME,PARTITION_NAME,SEGMENT_TYPE,TABLESPACE_NAME from dba_segments where SEGMENT_NAME='PARAMETER_DETAIL'
2* and OWNER='CDE'
SEGMENT_NAME
PARTITION_NAME SEGMENT_TYPE TABLESPACE_NAME
PARAMETER_DETAIL
PD_201107220130 INDEX PARTITION DATAFEED
PARAMETER_DETAIL
PD_201107211630 INDEX PARTITION DATAFEED
PARAMETER_DETAIL
PD_201107212030 INDEX PARTITION DATAFEED
SEGMENT_NAME
PARTITION_NAME SEGMENT_TYPE TABLESPACE_NAME
PARAMETER_DETAIL
PD_201107212100 INDEX PARTITION DATAFEED
PARAMETER_DETAIL
PD_201107210330 INDEX PARTITION DATAFEED
PARAMETER_DETAIL
PD_201107210630 INDEX PARTITION DATAFEED
SEGMENT_NAME
PARTITION_NAME SEGMENT_TYPE TABLESPACE_NAME
PARAMETER_DETAIL
PD_201107210830 INDEX PARTITION DATAFEED
PARAMETER_DETAIL
PD_201107211030 INDEX PARTITION DATAFEED
1490 rows selected.
SQL> select TABLESPACE_NAME,SEGMENT_SPACE_MANAGEMENT from dba_tablespaces;
TABLESPACE_NAME SEGMEN
SYSTEM MANUAL
UNDOTBS MANUAL
SYSAUX AUTO
TEMP MANUAL
USERS AUTO
DATAFEED AUTO
6 rows selected.
Please help me out to shrink this table.
Thankshttp://download.oracle.com/docs/cd/B19306_01/server.102/b14231/schema.htm#ADMIN10161
Shrink operations can be performed only on segments in locally managed tablespaces with automatic segment space management (ASSM). Within an ASSM tablespace, all segment types are eligible for online segment shrink except these:
IOT mapping tables
Tables with rowid based materialized views
Tables with function-based indexesSince this is an IOT, any chance there is an IOT mapping table?
Since this appears to be a data warehouse, any chance there are ROWID based materialized views or function-based indexes?
Justin -
Error ORA-10635 when shrink a table!!
Hi all,
I have a table created in a tablespace using ASSM and when i try to shrink this table i receive the error ORA-10635. I can do shrink on other tables that are on the same tablespace of that table that is giving me this error.
Anyone can help please??
Tks,
Paulo.10635, 00000, "Invalid segment or tablespace type"
// *Cause: Cannot shrink the segment because it is not in auto segment space
// managed tablespace or it is not a data, index or lob segment.
// *Action: Check the tablespace and segment type and reissue the statement -
What is the maximum size we can give to a datafile?
user8850066 wrote:
What is the maximum size we can give to a datafile?Use this clause to determine whether the tablespace is a bigfile or smallfile tablespace. This clause overrides any default tablespace type setting for the database.
A bigfile tablespace contains only one datafile or tempfile, which can contain up to approximately 4 billion (232) blocks. The maximum size of the single datafile or tempfile is 128 terabytes (TB) for a tablespace with 32K blocks and 32TB for a tablespace with 8K blocks.
A smallfile tablespace is a traditional Oracle tablespace, which can contain 1022 datafiles or tempfiles, each of which can contain up to approximately 4 million (222) blocks.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7003.htm#SQLRF01403
Kamran Agayev A.
Oracle ACE
My Oracle Video Tutorials - http://kamranagayev.wordpress.com/oracle-video-tutorials/ -
Delete AUD$ table do not free space
Hi,
We have an Oracle 10g database (10.2.0.4) with the Oracle auditing feature on.
Our problem is that I delete on regular basis the AUD$ rows, but the system do not free the space on the tablespace. The system free the space only after a truncate.
The actual situation is:
SQL> select segment_name,bytes/1024/1024 as Mb from dba_segments where bytes/1024/1024 > 1000 and TABLESPACE_NAME='SYSTEM';
SEGMENT_NAME MB
AUD$ 10161
SQL> select count(*) from sys.aud$;
COUNT(*)
+1073+
Someone can help me with this!?
The delete of the table is done with a simple script:
select count(*) from sys.aud$;
delete from sys.aud$ where NTIMESTAMP# < sysdate -(1/24*6);
select count(*) from sys.aud$;
commit;
exit;
Thanks
NunzioNunzio Cafarelli wrote:
EdStevens wrote:
Nunzio Cafarelli wrote:
Hi,
thanks for your answer.
The scrink and the coalesce feature do not works:
SQL> alter table SYS.AUD$ enable row movement;
alter table SYS.AUD$ shrink space;
alter table SYS.AUD$ coalesce;
Table altered.
SQL> SQL> alter table SYS.AUD$ shrink space
ERROR at line 1:
ORA-10635: Invalid segment or tablespace type
SQL> SQL> alter table SYS.AUD$ coalesce
ERROR at line 1:
ORA-01735: invalid ALTER TABLE optionthe only way I have is to move the table in a different tablespace and in case move back.
Do you know if that is a know bug!?No it is not a bug.
Why are you concerned about the space being released? If it were you'd just have to re-aquire it as new rows are added to the table.
As rows are added, when an extent is filled a new extent is allocated. If rows are deleted those extents remain allocated to the table and are re-used as needed. The aud$ table is a perfect example of a table which most definately will need to reuse that space, so it it a total waste of effor to try to reclaim it.Hi, that is the real point, it seems that the table don't use the allocated space.
It constantly grows and reclaim new space. That is the real problem for me.You haven't demonstrated that. You only showed us a one-time snapshot of the space used and the row count.
You need to track this over several days / iterations of deleting rows. Show us that over a period of time the row count is fairly stable and yet the space used continues to increase.
If, today the rowcount is 'x' and the space allocated (measured in blocks or extents) is 'y', and you delete a bunch (or even all) rows, space allocated should remain 'y'. Then tomorrow, you should have near 'x' rows again (assuming a fairly level amount of audited activity). And space allocated should still be 'y' .. maybe allowing for a slight increase in 'x' triggering one more extent. But if you are regularly pruning the row count, the number of extents should stabilize. If not, then you do have an issue, but I haven't yet seen proof of that happening.
>
>>
Can this create problems since AUD$ is a system table!?No, but you don't want a very active table like that in your SYSTEM tablespace. Oracle puts it there by default, but there have been well known procedures on the net for YEARS on how to move it to another TS. Thanks
With 11g, they've even introduced the dbms_audit_management package to help with these tasks.I know, I hope the my customer will authorize the upgrade soon.
Thanks for your suggestion to upgrade sybrand_b, but as you can understand, sometime the upgrade are not possible until the software vendor will authorize that, so, we need to work on version 10.2.0.4 for some other months.
Regards
Nunzio
P.S. I think that there are problems, after the move of the table to a different tablespace, and the move back to SYSTEM, the used space was around 2Gb, but I was not able to resize the datafile. Don't move it back. Get it out of SYSTEM and leave it there.I think that I'll do this, at least to not risk the corruption of the system tablespace.
Thanks again for your answers.
regards
Nunzio -
Release Space at file system level in DB2
Dear Gurus,
We have ECC 6.0 system on AIX with DB2 9.1 . We want to release space at file system level , I have idea regarding Oracle that it can be done in 2 ways 1: Offline DB reorg 2 : Dtafile resize.I am new to DB2 so can you please let me know whether it is feasible with DB2 as well or not.
In case yes what steps we need to perform in db2 in order to release space
Regards
Kuldeep singhYou can reduce the size of your tablespaces down to their current high water mark with the ALTER TABLESPACE REDUCE command. Reducing the high water mark requires much more work and on DB2 V9.1 there is no relyable way to do this.
DB2 V9.7 provides a new tablespace type with "reclaimable storage" attribute that allows to reclaim space much easier.
If you have a lot of trapped free space in your V9.1 tablespaces below the current high watermark you may want to consider a homogenous system copy with R3load into new tablespaces. This should be combined with an upgrade to V9.7 to get the new tablespace types. Another way to reorganize tablespaces is to move all tables into new tablespaces using DB6CONV.
Regards
Frank
Maybe you are looking for
-
Mid Month Transfer Issue in Payroll
Hello All Good Day! We have two payrolls defined, Payroll A and Payroll B and both has separate Legal entity but Business Group for both Payroll is same. We are having an issue when employee transfers from Payroll A to B or vice versa as mentioned be
-
Safari won't open on my Windows Vista PC
Here is my scenario, I've had Safari working on my PC for some time now, but as soon as i updated to Version 4.0 (yeah some time ago) it just stoped working, i ofcourse upgraded to version 5.0 as soon as Safari 5.0 came out and still no luck i double
-
i want to display box in Window in SAP script.. n in that box i want to habe Amout Rs Printed... please help mi with the same
-
Hello world, I'm running FCPro 5.1.2 UB since a while, so I'd like to import some old projects done under FCPro 3.0.2. Things seems simple but get tricky, because a good half of the files are not importing into rel.5.1.2: I get a dialogbox saying tha
-
Hi all, We have BI IDES version in our company, where lot of consultants are being trained in different aspects. Some have been using user sapuser. It was all ok from many months. But now all of a sudden, the create or edit,change icon and the activ