Oracle import and export, including tables, table structures, solutions, and databases

Source: Internet
Author: User
Tags import database

Export

Write commands directly in the command line

1. Export your own table

Exp userid = Scott/tiger @ myoral tables = (EMP, Dept) file = D: \ e1.dmp

 

2. Export tables of other schemes. If you want to export tables of other schemes, you need DBA or exp_full_database permissions. For example, system can export Scott tables.

Exp userid = system/manager @ myoral tables = (Scott. EMP) file = D: \ e2.emp


3. Export the table structure

Exp userid = Scott/tiger @ ACCP tables = (EMP) file = D: \ e3.dmp rows = N


4. Use Direct Export

Exp userid = Scott/tiger @ ACCP tables = (EMP) file = D: \ e4.dmp direct = y

This method is faster than the conventional method by default. When the data volume is large, you can consider using this method. In this case, the character set of the database must be exactly the same as that of the client. Otherwise, an error is reported.


The export scheme is to use the export tool to export all objects (tables, indexes, constraints...) and data in one or more schemes. Save to file

1. Export your own solution

Exp userid = Scott/tiger @ myorcl owner = Scott file = D: \ Scott. dmp


2. Export other schemes if the user wants to export other schemes, the DBA permission or the exp_full_database permission is required. For example, the System user can export any scheme.

Exp userid = system/manager @ myorcl owner = (system, Scott) file = D: \ system. dmp


Export Database

Exporting a database is to use export to export objects and data in all databases. This user is required to have DBA or exp_full_database permissions for Incremental Backup (the advantage is that after the first backup, the second backup is much faster)

Exp userid = system/manager @ myorcl full = y inctype = complete file = D: \ All. dmp

Import

1. Import your own table

IMP userid = Scott/tiger @ myorcl tables = (EMP) file = D: \ XX. dmp

2. to import a table to another user, the user must have DBA permissions.

Imp_full_database imp userid = system/tiger @ myorcl tables = (EMP) file = D: \ XX. dmp touser = Scott


3. Structure of the imported table. Only the structure of the imported table is not imported data.

IMP userid = Scott/tiger @ myorcl tables = (EMP) file = D: \ XX. dmp rows = N


4. import data if an object (such as a table) already exists, you can only import table data.

IMP userid = Scott/tiger @ myorcl tables = (EMP) file = D: \ XX. dmp ignore = y


The import scheme is to use the import tool to import objects and data in files to one or more schemes. If you want to import another scheme, you must have the DBA permission or imp_full_database

1. Import your own solution

IMP userid = Scott/tiger file = D: \ XXX. dmp

2. Importing other solutions requires that the user have DBA permissions.

IMP userid = system/manager file = D: \ XXX. dmp fromuser = system touser = Scott


Import Database

By default, all object structures and data are imported when the database is imported. The example is as follows:

IMP userid = system/manager full = y file = D: \ XXX. dmp

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.