Transport tablespace moves data in one tablespace to another

Source: Internet
Author: User

Transport tablespace moves data in one tablespace to another tablespace 1. create two tablespaces SQL> create tablespace test1 datafile '/opt/test1.dbf' size 10 m; www.2cto.com Tablespace created SQL> create tablespace test2 datafile '/opt/test2.dbf' size 10 m; Tablespace created 2. create two user SQL statements> create user test1 identified by test1 default tablespace test1; user created SQL> create user test2 identified by test2 default tablespace test2; User created3. grant permission SQL> Grant connect, resource to test1; grant succeeded SQL> grant connect, resource to test2; grant succeeded www.2cto.com 4. create the table conn test1/test1Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 Connected as test1SQL> create table t (I number) tablespace test1 In the table space test1; table created SQL> begin 2 for I in 1 .. 10000 loop 3 insert into t values (I); 4 end loop; 5 commit; 6 end; 7 8/PL/SQL procedure successfully completed 5. set the tablespace to read-only mode SQL> alter tablespace test1 read only; tablespace altered 6. Use transport tablespace to Export data SQL> host exp transport_tablespace = y tablespaces = test1 file =/opt/test1.dmp Export: release 10.2.0.1.0-Production on Mon Dec 17 04:44:11 2012 Copyright (c) 1982,200 5, Oracle. all rights reserved. username: sys Password: EXP-00056: ORACLE error 28009 encounteredORA-28009: connection as SYS shoshould be as SYSDBA or SYSOPERUsername: sys as sysdba Password: Connected: oracle Database 10g Enterprise Edition Release 10.2.0.1.0-ProductionWith the Partitioning, OLAP and Data Mining optionsExport done in US7ASCII character set and define NCHAR character setserver uses character set (possible charset conversion) Note: table data (rows) will not be exportedAbout to export transportable tablespace metadata... for tablespace TEST1 .... exporting cluster definitions. exporting table definitions .. exporting table T. exporting referential integrity constraints. exporting triggers. end transportable tablespace metadata exportExport terminated successfully without migrate data to SQL> host imp transport_tablespace = y file =/opt/test1.dmp fromuser = test1 touser = test2 datafiles = '/opt/ test1.dbf '; import: Release 10.2.0.1.0-Production on Mon Dec 17 04:50:24 2012 Copyright (c) 1982,200 5, Oracle. all rights reserved. username: sys as sysdbaPassword: Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-ProductionWith the Partitioning, OLAP and Data Mining options Export file created by EXPORT: v10.02.01 via conventional pathAbout to import transportable tablespace (s) metadata... import done in US7ASCII character set and AL16UTF16 NCHAR character setimport server uses WE8ISO8859P1 character set (possible charset conversion ). importing TEST1's objects into TEST2 .. importing table "T" Import terminated successfully without warnings. www.2cto.com 8. query data SQL> select count (*) from t; COUNT (*) ---------- 10000 9, complete

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.