How to use EXPDP, IMPDP to export and import by table space?

Source: Internet
Author: User

Reference: http://blog.csdn.net/zftang/article/details/6387325

A database:

Table Space: Ylcois

User name: Ylcois

Password: Ylcois

B Database:

Table Space: Dbo_ylcois

User name: Dbo_ylcois

Password: Oracle

Export table Space Ylcois from a database and import into table space Dbo_ylcois of database B, step:

1.A Database Build Export File directory

sql> Create or replace directory Expdir as ' D:\exp '; Directory created sql> Grant Read,write on the directory Expdir to public; Grant succeeded sql> select * from Dba_directories;

2. Export Space Ylcois

EXPDP Ylcois/[email protected] dumpfile=ylcois.dmp Tablespaces=ylcois logfile=exp.log directory=expdir job_name=my_ Job

3.B Database Build Import Directory

sql> Create or replace directory Dump_dir ' C:\pump_dir ';

Create or Replace directory Dump_dir ' C:\pump_dir '

ORA-00905: Missing keyword

sql> Create or replace directory Dump_dir as ' C:\pump_dir ';

Directory created

Sql> select * from Dba_directories;

OWNER Directory_name Directory_path
------------------------------ ------------------------------ --------------------------------------------------- -----------------------------
SYS Dump_dir C:\pump_dir
SYS SubDir E:\app\Administrator\product\11.2.0\dbhome_3\demo\schema\ord Er_entry\/2002/sep
SYS Ss_oe_xmldir E:\app\Administrator\product\11.2.0\dbhome_3\demo\schema\ord Er_entry\
SYS Log_file_dir E:\app\Administrator\product\11.2.0\dbhome_3\demo\schema\log \
SYS Data_file_dir E:\app\Administrator\product\11.2.0\dbhome_3\demo\schema\sal Es_history\
SYS Xmldir C:\ade\aime_dadvfh0169\oracle/rdbms/xml
SYS Media_dir E:\app\Administrator\product\11.2.0\dbhome_3\demo\schema\pro Duct_media\
SYS Data_pump_dir e:\app\administrator/admin/orcl/dpdump/
SYS Oracle_ocm_config_dir E:\app\administrator\product\11.2.0\dbhome_3/ccr/state

9 Rows selected

4. Create table spaces and users

Create tablespace dbo_ylcoislogging  datafile ' E:\app\Administrator\oradata\orcl\dbo_ylcois.dbf ' size 50m  Autoextend on  next 50m maxsize 20480m  extent management Local, create user Dbo_ylcois identified by Oracledefault Tablespace Dbo_ylcois; --Authorize Grant CONNECT,RESOURCE,DBA to dbo_ylcois;grant connect,resource,create any view,create any synonym,create Database link to Dbo_ylcois;

If you already have one, delete the user and space, and then create a new

sql> drop user Dbo_ylcois cascade; User dropped sql> drop user Dbo_ylcois; Drop user Dbo_ylcois ORA-01918: users ' Dbo_ylcois ' does not exist sql> drop tablespace Ylcois including CONTENTS and datafiles; Tablespace dropped

5. Copy the files exported from a database ylcois.dmp to the ' C:\pump_dir ' of the B database

6. Import the B database, the Remap_tablespace parameter is used here

--The following is the import of all data under the Ylcois user into the Tablespace dbo_ylcois (formerly Ylcois table space)

C:\USERS\ADMINISTRATOR>IMPDP Dbo_ylcois/[email protected] Directory=dump_dir dumpfile=ylcois.dmp REMAP_ Tablespace=ylcois:dbo_ylcois

How to use EXPDP, IMPDP to export and import by table space?

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.