export와 tablespace
oracle9i에서는 지정된 tablespace의 object를 export 받기위한 옵션으로 tablespace parameter를 사용할 수 있게 되었습니다. (8i에서 이 parameter는 다른 데이터베이스로 옮길 테이블스페이스를 지정하였으나 9i에서는 지정된 테이블스페이스의 object를 export 하겠다는 개념으로 바뀜)
이 parameter를 사용하기 위해서는 해당 user에게 export_full_database privilege가 부여되어 있어야 하는데 아래의 예제를 보면서 이해 바랍니다.
----------------------------------------------------------------
C:\Documents and Settings\이종철>sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on Fri Mar 11 08:48:31 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> create tablesapce test datafile
2 'c:\oracle\oradata\wink\test01.dbf' size 1m;
create tablesapce test datafile
*
ERROR at line 1:
ORA-00901: invalid CREATE command
SQL> create tablespace test datafile
2 'c:\oracle\oradata\wink\test01.dbf' size 1m;
Tablespace created.
SQL> conn scott/tiger
Connected.
SQL> create table mytest (
2 id number,
3 name varchar2(20),
4 addr varchar2(50),
5 amount number,
6 hiredate date)
7 partition by list(addr)
8 (
9 partition test_1 values ('서울','부산'),
10 partition test_2 values ('광주','대구'),
11 partition test_3 values ('제주','춘천') tablespace test,
12 partition test_4 values ('수원','대전') tablespace users
13 )
14 /
Table created.
SQL> insert into mytest values (1,'1길동','서울',10000, sysdate);
1 row created.
SQL> insert into mytest values (2,'2길동','부산',20000, sysdate);
1 row created.
SQL> insert into mytest values (3,'3길동','제주',30000, sysdate);
1 row created.
SQL> insert into mytest values (4,'4길동','춘천',40000, sysdate);
1 row created.
SQL> insert into mytest values (5,'5길동','대전',50000, sysdate);
1 row created.
SQL> select segment_name, partition_name
2 from user_segments
3 where tablespace_name = 'TEST';
SEGMENT_NAME
--------------------------------------------------------------------------------
PARTITION_NAME
------------------------------
MYTEST
TEST_3
SQL> conn / as sysdba
Connected.
SQL> grant exp_full_database to scott;
Grant succeeded.
SQL> grant imp_full_database to scott;
Grant succeeded.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
EXP-00000: Export terminated unsuccessfully
C:\Documents and Settings\이종철>exp userid=scott/tiger tablespaces=test
Export: Release 9.2.0.1.0 - Production on Fri Mar 11 08:59:16 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses KO16MSWIN949 character set (possible charset conversion)
About to export selected tablespaces ...
For tablespace TEST ...
. exporting cluster definitions
. exporting table definitions
. . exporting table MYTEST
. . exporting partition TEST_1 2 rows exported
. . exporting partition TEST_2 0 rows exported
. . exporting partition TEST_3 2 rows exported
. . exporting partition TEST_4 1 rows exported
. exporting referential integrity constraints
. exporting triggers
Export terminated successfully without warnings.
===================================================================
한가지 특이한 점은 지정된 tablespace 내의 object와 연관된 다른 tablespace의 object도 같이 export/import 된다는 것이다.
===================================================================
* 이종철님에 의해서 게시물 이동되었습니다 (2006-06-04 12:27)
oracle9i에서는 지정된 tablespace의 object를 export 받기위한 옵션으로 tablespace parameter를 사용할 수 있게 되었습니다. (8i에서 이 parameter는 다른 데이터베이스로 옮길 테이블스페이스를 지정하였으나 9i에서는 지정된 테이블스페이스의 object를 export 하겠다는 개념으로 바뀜)
이 parameter를 사용하기 위해서는 해당 user에게 export_full_database privilege가 부여되어 있어야 하는데 아래의 예제를 보면서 이해 바랍니다.
----------------------------------------------------------------
C:\Documents and Settings\이종철>sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on Fri Mar 11 08:48:31 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> create tablesapce test datafile
2 'c:\oracle\oradata\wink\test01.dbf' size 1m;
create tablesapce test datafile
*
ERROR at line 1:
ORA-00901: invalid CREATE command
SQL> create tablespace test datafile
2 'c:\oracle\oradata\wink\test01.dbf' size 1m;
Tablespace created.
SQL> conn scott/tiger
Connected.
SQL> create table mytest (
2 id number,
3 name varchar2(20),
4 addr varchar2(50),
5 amount number,
6 hiredate date)
7 partition by list(addr)
8 (
9 partition test_1 values ('서울','부산'),
10 partition test_2 values ('광주','대구'),
11 partition test_3 values ('제주','춘천') tablespace test,
12 partition test_4 values ('수원','대전') tablespace users
13 )
14 /
Table created.
SQL> insert into mytest values (1,'1길동','서울',10000, sysdate);
1 row created.
SQL> insert into mytest values (2,'2길동','부산',20000, sysdate);
1 row created.
SQL> insert into mytest values (3,'3길동','제주',30000, sysdate);
1 row created.
SQL> insert into mytest values (4,'4길동','춘천',40000, sysdate);
1 row created.
SQL> insert into mytest values (5,'5길동','대전',50000, sysdate);
1 row created.
SQL> select segment_name, partition_name
2 from user_segments
3 where tablespace_name = 'TEST';
SEGMENT_NAME
--------------------------------------------------------------------------------
PARTITION_NAME
------------------------------
MYTEST
TEST_3
SQL> conn / as sysdba
Connected.
SQL> grant exp_full_database to scott;
Grant succeeded.
SQL> grant imp_full_database to scott;
Grant succeeded.
SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
EXP-00000: Export terminated unsuccessfully
C:\Documents and Settings\이종철>exp userid=scott/tiger tablespaces=test
Export: Release 9.2.0.1.0 - Production on Fri Mar 11 08:59:16 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses KO16MSWIN949 character set (possible charset conversion)
About to export selected tablespaces ...
For tablespace TEST ...
. exporting cluster definitions
. exporting table definitions
. . exporting table MYTEST
. . exporting partition TEST_1 2 rows exported
. . exporting partition TEST_2 0 rows exported
. . exporting partition TEST_3 2 rows exported
. . exporting partition TEST_4 1 rows exported
. exporting referential integrity constraints
. exporting triggers
Export terminated successfully without warnings.
===================================================================
한가지 특이한 점은 지정된 tablespace 내의 object와 연관된 다른 tablespace의 object도 같이 export/import 된다는 것이다.
===================================================================
* 이종철님에 의해서 게시물 이동되었습니다 (2006-06-04 12:27)
[개발실무100%환급외]빅데이터/SQL/자바/스프링/안드로이드/닷넷… | 12-27 | 2505 | ||
[채용확정무료교육]오라클자바개발잘하는신입뽑기2개월과정,교육… | 12-11 | 1844 | ||
53 | [평일100%환급7건]Spring,자바&JSP,안드로이드,웹퍼블리싱,C#닷… | 03-15 | 1649 | |
52 | [주말]C#,ASP.NET마스터 | 01-31 | 1737 | |
51 | [기업100%환급,평일주간]SQL기초에서스키마오브젝트,PLSQL,힌트… | 01-31 | 2509 | |
50 | [평일주간야간,주말]C기본&자료구조,알고리즘 | 01-31 | 1386 | |
49 | [평일주간,평일야간,주말]Spring,MyBatis,Hibernate개발자과정-… | 01-19 | 1685 | |
48 | [평일야간,주말]안드로이드개발자과정(Android기초실무) | 01-11 | 1569 | |
47 | [평일야간,주말주간야간]JAVA,Network&JSP&Spring,MyBatis,Hiber… | 01-03 | 2072 | |
46 | [개발실무100%환급외]빅데이터/SQL/자바/스프링/안드로이드/닷넷… | 12-27 | 2505 | |
45 | [평일주간]NoSQL,MongoDB,빅데이터기초과정 | 12-19 | 1802 | |
44 | [평일주간야간, 주말]웹퍼블리싱 마스터(HTML5,CSS3,jQUERY,AJAX… | 12-14 | 1776 | |
43 | [채용확정무료교육]오라클자바개발잘하는신입뽑기2개월과정,교육… | 12-11 | 1844 | |
42 | [평일주간]빅데이터하둡기초과정(BigData Hadoop) | 12-09 | 1443 | |
41 | [평일야간]닷넷(C#,Network,ADO.NET,ASP.NET)마스터 | 12-01 | 1669 | |
40 | [기업100%환급]오라클&자바웹스프링신입과정3주(SQL,JAVA,JSP,Se… | 12-01 | 1842 | |
39 | [평일야간,주말]SQL기초에서실무까지(SQL기초,PLSQL,힌트,튜닝) | 12-01 | 1315 |
댓글 없음:
댓글 쓰기