Automatic Import and Export of Oracle databases

Source: Internet
Author: User
The Automatic Import and Export of Oracle databases are widely used in many places. for example, after an Oracle database application system is developed, if you want to install the system on the customer's computer, you need to import the initial data to your Oracle database. the above functions need to be implemented in recent projects. It takes some time to search for the experiment and sort it out as follows:

The Automatic Import and Export of Oracle databases are widely used in many places. for example, after an Oracle database application system is developed, if you want to install the system on the customer's computer, you need to import the initial data to your Oracle database. the above functions need to be implemented in recent projects. It takes some time to search for the experiment and sort it out as follows:

The Automatic Import and Export of Oracle databases are widely used in many places. for example, after an Oracle database application system is developed, if you want to install the system on the customer's computer, you need to import the initial data to your Oracle database.

The above functions need to be implemented in recent projects. It takes some time to search for the experiment and sort it out as follows: First, export the initial data file to be installed as initial. dmp, then install oracle on the customer's computing, and then execute the batch processing file impInitialData. bat (the same directory as the batch processing file also has createuser. SQL, initial. two dmp files) impInitialData. the content in bat is as follows:

@ Echo off

Sqlplus system/manager @ createuser

Imp system/manager file = initial. dmp fromuser = initialuser touser = initialuser ignore = y

The above createuser is a file with the SQL extension. It is placed in the same directory as the batch file. Its content is:

Create user initialuser identified by test;

Grant dba, resource, connect to initialuser;

Exit;

Supplement: When deleting a user, use: drop user powercc cascade; where powercc is the user name.

Brief explanation:

@ Echo off: the subsequent commands are not displayed in the Command Prompt window.

Sqlplus is a tool program of oracle. You must install oracle before using it.

System/manager is a default Administrator Account of oracle. If the account is locked or the password is changed, it cannot be used. You can replace it with another account/password;

@ Createuser: Execute the createuser. SQL file.

In this SQL file, create user xx identified by yy; indicates creating a user xx whose password is yy;

Grant dba, resource, connect to xx; grant xx dba, resource, and connect permissions to users.

Imp is the data import command. In the following parameters, file indicates the database file to be imported; fromuser indicates the username of the original exported database file; touser indicates the username of the database to be imported; ignore indicates that the general method for ignoring errors is as follows, and other commands can be added to execute more complex operations.

,

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.