Using the Exp/imp transport tablespace (Oracle) ____oracle

Source: Internet
Author: User

Sometimes, you can use EXP to export the table space as a transfer tablespace, which is a mechanism for attaching a format data file on a database to another database.

Need to note:
For export file dmp, Oracle implements Cross-platform processing, that is, you can import it using IMP on any running platform, but it is not the same on each platform for the data files contained in the table space, including the inability to handle it through simple replication. The data file is not independent of the OS.
The transfer table space moves data very quickly.
Use premise:
1. The source and target databases use the same character set.
2. The target database cannot have the same table space as the source table space
3. The source and target databases have the same block size
4. Must transfer self contained set of objects
5. the source and target databases must run the same hardware platform

Here take Linux under Oracle9.2.0.4 for example, briefly introduce the use of:
1. Create a table space and generate data
Sqlplus "/As SYSDBA"
Create Tablespace hexiong datafile?/hexiong.dbf size 1M;
Create user Hexiong identified by hexiong default Tablespace hexiong;
Grant Connect, resource to Hexiong;
Conn Hexiong/hexiong
CREATE TABLE T as select * from All_objects;
2. Check the table space is complete:
exec sys.dbms_tts.transport_set_check (' Hexiong ', TRUE);
Pl/sql procedure successfully completed.
Sql> select * from Sys.transport_set_violations;
No rows selected
This means that the set of objects in the empty table is self-contained (both the object and its index are in this tablespace)
3. Set table space to read-only
Alter Tablespace Hexiong Read only;
4. Start EXP

Sql> host exp userid=/' sys/change_on_install as sysdba/' Transport_tablespace=y tablespaces= (hexiong) File=/u01/app /oracle/exphexiong.dmp

Export:release 9.2.0.4.0-production onðçæúèõ7ôâ30 19:27:00 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.


Connected to:oracle9i Enterprise Edition release 9.2.0.4.0-production
With the partitioning and Oracle Data Mining options
Jserver Release 9.2.0.4.0-production
Export done in ZHS16GBK character set and Al16utf16 NCHAR character set
Note:table data (rows) won't be exported
About to export transportable tablespace metadata ...
For Tablespace Hexiong ...
. Exporting cluster definitions
. Exporting table definitions
. . Exporting Table T
. Exporting referential integrity constraints
. Exporting triggers
. End Transportable tablespace metadata export
Export terminated successfully without warnings.

5. Copy the exported file and related source tablespace data files to the target database or machine
Export File:/u01/app/oracle/exphexiong.dmp
Data files:
Sql> Select B.name from V$tablespace A, v$datafile b where a.ts#=b.ts# and a.name= ' Hexiong ';
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/bjlnx1/hexiong.dbf

6. Enter the target machine, create the corresponding table space users, do not have to specify the default table space
The location of Exphexiong.dmp and HEXIONG.DBF is on the/HOME/ORADBA.
Cd/home/oradba
Sql>create user Hexiong identified by Hexiong;
7. Import:
Imp file=exphexiong.dmp userid=/' sys/change_on_install as sysdba/' Transport_tablespace=y datafiles=/home/oradba/ Hexiong.dbf

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.