Admin2008/10/19 13:03
명령어 정리

data file 및 tablespace 관련 조회
select tablespace_name, status, contents, extent_management, segment_space_management
from dba_tablespaces;

select tablespace_name, bytes, file_name from dba_data_files;

select tablespace_name, bytes, file_name from dba_temp_files;
Tablespace 생성
create tablespace <tablespace 명>
datafile '<datafile 명>' size <크기>
segment sapce management auto;  ====>9i 이상 버젼
create tablespace <tablespace 명>
datafile '<data file 명>' size <크기>;  ====>8i버젼 LMT모드로 만들기
create undo tablespace <tablespace 명>
datafile '<data file 명>' size <크기>;
create temporary tablespace <tablespace 명>
tempfile '<tempfile 명>' size <크기>;
create tablespace <table  명>
datafile '<data file 명>' size <크기>
blocksize <크기>
segment space management auto;

Tablespace 확장
alter tablespace <tablespace 명>
add datafile '<datafile 명>' size <크기>; ====>open 상태에서 작업 가능
alter database datafile
'<data file 명>' resize <크기>; ==========>open 상태에서 작업가능

Tablespce Online or Offline 변경
alter tablespace <tablespace 명> offline|online;

현재 데이터베이스의 데이터 파일과 테이블스페이서 상태 조회
col tablespace_name format a16
col file_name format a50

select tablespace_name, status, contents, extent_management, segment_space_management
from dba_tablespaces;

save dt.sql

select tablespace_name, bytes, file_name from dba_data_files;

save dd.sql

select tablespace_name,bytes, file_name from dba_temp_files;

save temp.sql

OPEN 상태에서 Data file 이동
 step 1. Tablespace offline
 step 2. Datafile move (os command)
 step 3. alter tablespace ~ rename ~
 step 4. Tablespace online
alter tablespace insa offline;  --->step 1
!cp <원본파일> <복사본 파일> --->step 2

alter tablespace insa rename
datafile '<원본파일>' to '<복사본 파일>';
--->step 3

alter tablespace insa online; --->step4

Tablespace 의 삭제
drop tablespace insa
including contents and datafiles cascade constraints;
크리에이티브 커먼즈 라이선스
Creative Commons License

'Admin' 카테고리의 다른 글

index 사용 유무 모니터링  (0) 2008/10/22
Checking indexes  (0) 2008/10/22
Temporary tablespace 생성과 default temporary tablespace 지정  (0) 2008/10/22
tablespace 관리 명령어  (0) 2008/10/19
spfile의 controlfile정보의 변경  (0) 2008/10/17
logfile 조작 명령어  (0) 2008/10/16
Posted by 청짱

TRACKBACK http://soseem.net/trackback/102 관련글 쓰기

댓글을 달아 주세요