A detailed approach to Oracle data import and export under Linux _oracle

Source: Internet
Author: User
Tags create index

This article describes the method of Oracle data import and export under Linux. Share to everyone for your reference, specific as follows:

A. Export tool exp

1. It is the next executable file storage directory for the operating system/oracle_home/bin

The EXP export tool compresses data backups in a database into a binary system file. Can migrate between different OS

It has three different modes:

A. User mode: Export all user objects and data in the object;
B. Table mode: Export all the user tables or specified tables;
C. Entire database: Export all objects in the database.

2. Export tool Exp Interactive command-line approach to use examples:

$exp test/test123@appdb
Enter array Fetch buffer size:4096 > enter
Export FILE:EXPDAT.DMP > M.dmp generate exported file names
(1) E (Ntire database), (2) U (sers), or (3) T (Ables): (2) u > 3
Export table Data (yes/no): yes > enter
Compress extents (yes/no): yes > enter
Export done in ZHS16GBK character set and ZHS16GBK NCHAR character set
About to export specified tables via conventional Path ...
Table (T) or Partition (T:P) to IS exported: (Return to quit) > Cmamenu the name of the tables to export
. . Exporting table Cmamenu 4336 rows Exported
Table (T) or Partition (T:P) to IS exported: (Return to quit) > list name to export
Table (T) or Partition (T:P) to IS exported: (Return to quit) > enter
Export terminated successfully without warnings.

Export command:

Copy Code code as follows:
Exp TEST/TEST123@ORCL file=/opt/daochu.dmp full=y

Where test is the user name, the latter test123 is the user's password, ORCL is the database name, and file is the URL for the file to be exported

Two. Import Tools Imp

1. It is the next executable file storage directory for the operating system/oracle_home/bin

The Imp Import tool imports the binary system files that are formed by exp into the database.

It has three different modes:

A. User mode: Import all objects of the user and the data in the object;
B. Table mode: Import all of the user's tables or specified tables;
C. Entire database: Import all objects in the database.

Only users with Imp_full_database and DBA authority can do the entire database import

Imp Step:

(1) Create TABLE (2) Insert data (3) create INDEX (4) Create triggers,constraints

2. Import Tools Imp Interactive command line example:

$ imp
Import:release 8.1.6.0.0-production on Friday December 7 17:01:08 2001
(c) Copyright 1999 Oracle Corporation. All rights reserved.
User name: Test
Password: * * *
Connect to: Oracle8i Enterprise Edition release 8.1.6.0.0-64bit Production
With the partitioning option
Jserver Release 8.1.6.0.0-production
Import file: expdat.dmp>/tmp/m.dmp
Enter the insertion buffer size (min. 8192) 30720>
To export a file created by export:v08.01.06 through a regular path
Warning: This object is exported by TEST instead of the current user
Import in the ZHS16GBK character set and ZHS16GBK NCHAR character set has been completed
List only the contents of the import file (yes/no):no>
Ignore creation error (yes/no):no> Yes because the object already exists
Import permissions (yes/no):yes>
Import table Data (yes/no):yes>
Import the entire export file (yes/no):no> Yes
. Importing the object of test into SCOTT
. . Importing table "Cmamenu" 4336 rows are imported
The import was successfully terminated, but a warning appears.

Import command:

Copy Code code as follows:
$imp TEST/TEST123@ORCL file=/opt/whufe.dmp full=y

Where test is the user name, the latter test123 is the user's password, ORCL is the database name, and file is the URL where the file is to be imported

I hope this article will help you with your Oracle database program design.

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.