Basic Oracle Database Operations (6)-data export and import, basic oracle operations

Source: Internet
Author: User

Basic Oracle Database Operations (6)-data export and import, basic oracle operations

1. log on to the specified user in the oracle database under cmd

Method 1: Log On Through command line plaintext connection

  • Open cmd and enter sqlplus/nolog.

  • Input: conn username/passworld @ database instance name

Method 2: log on through the command line ciphertext connection

Ii. Data Import and Export

(1) Use the cmd command to export and import the entire database

1. Full-Database Export

exp system/orcl full=y

You do not need to log on. Enter the command in the command line. system is the database administrator, orcl is the corresponding password (password), and the parameter "full = y" is added to indicate full Database Export.

After the command is executed, an EXPDAT. DPM file is generated in the current directory, which is a backup file.

If you want to specify the name and path of the backup file, add the parameter. The command is as follows:

exp system/orcl file=c:\oracle.dmp full=y

2. Full-Database Import

imp system/orcl full=y

If the file parameter is not specified, the backup file EXPDAT. DMP is used for import by default.

If the file parameter is specified, the backup file is restored according to the specified file.

imp system/orcl full=y file=c:\oracle.dmp

Before executing the import command, make sure that there are no objects to be imported in the oracle database. Otherwise, the following message is displayed:

(2) Use the cmd command to export and import data by user

Export by user

exp system/orcl owner=scott file=c:\scott.dmp

Import by user

imp system/orcl file=c:\scott.dmp fromuser=scott

(3) Use the cmd command to export and import data by table

Export by table

exp scott/tiger file = c:\scott.dmp tables = emp,dept

Use the tables parameter to specify the table to be exported. If multiple tables are separated by commas.

Import by table

imp scott/tiger file = c:\scott.dmp tables = emp,dept

3. If you use Navicat for backup, you can refer to Navicat official website related tutorials (http://www.formysql.com/navicat/jiqiao)

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.