database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
ㆍOracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Oracle Tutorials 9070 게시물 읽기
 News | Q&A | Columns | Tutorials | Devel | Files | Links
No. 9070
특정 TABLE을 다른 TABLESPACE로 옮기는 방법
작성자
정재익(advance)
작성일
2001-12-25 14:39
조회수
4,820

현재 user가 사용중인 tablespace의 특정 테이블을 다른 tablespace의

영역으로 옮기는 방법은 다음과 같다.

 

예를 들어 SCOTT user의 DEPT table이 현재 USERS tablespace에 있는 경우,

이것을 TOOLS tablespace로 옮기는 경우 다음과 같은 순서대로 작업을

하여야 한다.

 

(1) DEPT table을 export한다.

 

os> exp scott/tiger file=file_name.dmp tables=dept

 

(2) 이전하고자 하는 tablespace인 TOOLS가 없는 경우에는 다음과 같이

생성한다. datafile의 위치나 크기는 임의로 설정한다.

 

os> svrmgrl (7.2이하의 경우 sqldba lmode=y)

SVRMGR> CONNECT INTERNAL;

SVRMGR> CREATE TABLESPACE tools

DATAFILE '/user1/oracle_data/tools01.dbf' SIZE 100M;

 

(3) 옮기고자 하는 table의 owner인 SCOTT의 default talbespace를

table을 새로 위치시킬 tablespace인 TOOLS로 임시 지정한다.

 

SVRMGR> alter user scott default tablespace tools;

 

(4) SCOTT가 임시로 TOOLS에만 insert 가능하도록 다음과 같이 조치한다.

 

SVRMGR> revoke unlimited tablespace from scott;

SVRMGR> alter user scott quota unlimited on tools;

 

(5) (1)에서 export받은 DEPT를 다시 SCOTT user로 import한다.

 

os> imp scott/tiger file=file_name.dmp full=y commit=y

 

(6) IMPORT 후 각 TABLE이 해당 TABLESPACE로 변경되었는지 확인

 

os> sqlplus scott/tiger

SQL> select tablespace_name from user_tables where table_name = 'DEPT';

 

(7) SCOTT의 권한 및 default tablespace를 원상태로 복구시킨다.

 

SVRMGR> grant unlimited tablespace to scott;

SVRMGR> alter user scott default tablespace users;

[Top]
No.
제목
작성자
작성일
조회
9074ROLLBACK segment 의 할당
정재익
2001-12-25
5022
9072데이터베이스 생성하기
정재익
2001-12-25
6070
9071NT/95 client에서 NT server에 OS Authentication 사용하기
정재익
2001-12-25
4735
9070특정 TABLE을 다른 TABLESPACE로 옮기는 방법
정재익
2001-12-25
4820
9069Control File 생성 Script 얻는 방법
정재익
2001-12-25
4899
9068DataFile 위치 변경방법
정재익
2001-12-25
7037
9066오라클로 connect하는 시간이 너무 오래 걸리거나 혹은...
정재익
2001-12-25
5603
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2023 DSN, All rights reserved.
작업시간: 0.046초, 이곳 서비스는
	PostgreSQL v16.1로 자료를 관리합니다