Syntax for Oracle Import Export Database

Source: Internet
Author: User
Tags log oracle database backup

Introduction: Oracle In addition to the graphical way in the Oracle editor to import the export of arts and Sciences file data, you can also import the export database in a command-line manner, and its syntax is as follows:
IMP [username[/password[@service]]]
Step: 1, first in the DOS, and then switch to the Oracle database physical files in the directory that is (DMP file is located in the directory). Next, enter the following statement!
Imp username/password@service file=psmis.dmp fromuser=psmis touser=psmis Log=psmis.log below explains the syntax of the statement:
IMP: is the syntax prefix for importing the database;
Username/password@service: It means landing the specified service;
File: Refers to an Oracle database physical file that has been detached;
Fromuser: Refers to the source user;
Touser: Refers to the target user;
LOG: Refers to the current directory of logs file;
View the IMP,EXP command in Oracle in DOS:
Imp help=y
Exp help=y
1. Export Table data:
The filename is represented by backup_yymmddhhmm.dmp
datestring= ' Date +%y%m%d%h%m '
#echo $dateString
SU-ORACLE-C "Exp Userid/password tables=table1,table2 file= path/backup_$datestring.dmp BUFFER=8192 grants=y compress= N
Compress:n indicates that the file is not compressed in a block of data, when the table data in the database is particularly large, if placed in a different database, there will be problems in the recovery.
The exported data includes table creation statements, sequences, triggers, and so on.
2. Import Table Data
Table Import Process: Create a table, import data, create a sequence
Echo Backup file:$1
Filename=$1
Echo $fileName
#if ["$fileName" = "]
#then
# echo Please specify a file name for backup recovery, specify an absolute file path
# exit 0;
#fi
#echo filename= $fileName
Su-oracle-c "Imp userid/password file= $fileName show=n buffer=2048000 ignore=y commit=y grants=y full=y"
Ignore:y indicates that the table creation process is ignored, and only the data in the table is imported into the table. 1 2 Next page > full text reading tips: Try "←→" button, turn the page more convenient Oh!

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.