datafile (3)

데이타 베이스 파일의 autoextend 옵션 및 next extent 옵션을 수정하려면 아래와 같은 쿼리를 사용하면 된다.

 

 

SQL > ALTER DATABASE DATAFILE 6 AUTOEXTEND ON NEXT 10M;

 

여기서 6 이라는 숫자는 어디서 나온걸까? 의심을 해보아야 한다. 무작정 따라하지 마라.

 

저 6 이라는 숫자는 데이타 베이스 파일 조회하기 명령어를 통해서 얻은 파일# 이다. 


데이타베이스 튜닝을 하다보면 물리적인 데이타베이스 파일에 대해 알아야 할 때가 있다.

그럴때 필요한 것이 물리적인 데이타베이스 파일의 경로를 파악하는 것.

 

SQL> CONN /AS SYSDBA;
Connected.

SQL> SELECT * FROM DBA_DATA_FILES; 

 

확인할 수 있는 정보들은 아래와 같다.

 

FILE_NAME  

FILE_ID  

TABLESPACE_NAME                       

BYTES      

BLOCKS  

STATUS     

RELATIVE_FNO  

AUT    

MAXBYTES   

MAXBLOCKS  

INCREMENT_BY  

USER_BYTES  

USER_BLOCKS  

ONLINE_
 

 

 

출처 : https://docs.oracle.com/cd/B28359_01/server.111/b28310/dfiles010.htm#ADMIN11459 


테이블 스페이스를 튜닝하려고 아래 명령어를 입력하였다.

 

ALTER TABLESPACE 테이블스페이스명 AUTOEXTEND ON NEXT 1024K;

 

그랬더니 아래처럼 오류가 떨어졌다.

 

ORA-32773: operation not supported for smallfile tablespace 테이블스페이스명  

 

구글링해서 얻어온 해결책 하나. 아래 경우를 살펴보기 바란다.

 

 

SQL> alter tablespace users resize 300m;
alter tablespace users resize 300m
*
ERROR at line 1:
ORA-32773: operation not supported for smallfile tablespace USERS

SQL> select file_id, tablespace_name from dba_data_files;

   FILE_ID TABLESPACE_NAME
---------- ------------------------------
         1 SYSTEM
         2 UNDOTBS1
         3 SYSAUX
         4 USERS

SQL> alter database datafile 4 resize 300m;

Database altered.

//--------Description from online documents------------------------------------------------------------------
ORA-32773: operation not supported for smallfile tablespace string
Cause:
An attempt was made to perform. an operation which is supported only for bigfile tablespaces, e.g. resize tablespace.
Action: Use the appropriate clause of the ALTER DATABASE DATAFILE command instead.


SQL> alter tablespace users autoextend off;
alter tablespace users autoextend off
*
ERROR at line 1:
ORA-32773: operation not supported for smallfile tablespace USERS


SQL> alter database datafile 4 autoextend off;

Database altered.

 

출처 : http://blog.itpub.net/9765498/viewspace-259958/