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
,