Oracle backs up a user and migrates the data

Source: Internet
Author: User
Today, we used to import all the information of one Oracle user to another. For example, if one user on one machine is aa, we need to use aa on another machine.

Today, we used to import all the information of one Oracle user to another. For example, if one user on one machine is aa, we need to use aa on another machine.

Today, we used to import all the information from one Oracle user to another. For example, if one user on one machine is aa, all information of the aa user, such as tables, tablespaces, and indexes, needs to be copied to the local database on another machine.

First, view the default tablespace under the aa user, or view it according to the sysdba user.

Select username, default_tablespace from user_users; // The current user
Select user, default_tablespace from dba_users; // sysdba queries all users and default tablespace

For example, we now know that the tablespace of the aa user is aatbs;

Execute in cmd, instead of SQL in sqlplus or pl/SQL.

Exp aa/aa @ orcl file = C: \ aa_bak.dmp full = y // export all;

Then execute the following command in another database:

Sqlplus/as sysdba;
Create tablespace aatbs datafile 'C: \ oracle \ product10.2.0 \ oradata \ aa_bak.dbf' size 32 M
Autoextend on next 32 M maxsize 2048 M extent management local; -- create a tablespace. The tablespace name is the same as the tablespace name you just queried.
Create user aa identified by aa default tablespace aatbs;
Grant dba to aa;
-- Drop user aa cascade;
Exit;

Note the following when creating a tablespace:

1. The file path after datafile must be single quotation marks. It is difficult to use double quotation marks

2. in addition, you need to set the default tablespace because the tablespace In the exported backup file is aatbs. If the tablespace is not specified at this time, an error is reported when importing the backup file because the tablespace in which the table is created is inconsistent.

Switch to cmd and run

Imp aa/aa @ orcl file = c: \ oracle \ product10.2.0 \ oradata \ aa_bak.dbf full = y;

How can I migrate an Oracle stored procedure to Hive?

Migrate databases across platforms using RMAN

Online migration OCR error: PROT-16

Simple Table space migration using RMAN

,

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.