How to import dmp file into own oracle database

1. First, we can create a user tablespace of our own. The format of creating a tablespace is as follows:

create tablespace test (the name of the tablespace) 
datafile 'D:\oracle\product\10.2.0\userdata\test.dbf' (this can be written as a path in oracle)
size 50m (initial size)
autoextend on; ( auto-expand)

 

2. Next, we can create a user of our own in the following format:

CREATE USER utest (user name) 
IDENTIFIED BY upassword (password)
DEFAULT TABLESPACE test (table space created above) 
TEMPORARY TABLESPACE temp; (temp is enough for temporary table space)

 

3. Then, we need to grant permissions to our own users to manage our own tablespaces

GRANT CONNECT TO utest;  
GRANT RESOURCE TO utest;  
GRANT dba TO utest;--dba is the highest authority, which can create databases, tables, etc.

 

The execution environment of the above three statements needs to enter the oralce

How to enter oracle under cmd

sqlplus system/password press Enter

 

4. Export method

exp source user/password@ORCL file=d:\data\xxxx.dmp

 

5. Next, we can import our dmp file into our own tablespace, the import method

imp usename/password@SID full=y  file= d:\data\xxxx.dmp ignore=y

imp usename/password@XE file=d:\data\xxxx.dmp fromuser=source user touser=to user

 

import instance

imp utest/upassword file=D:\20140227.dmp full=y ignore=y (import the file into the tablespace of our own newly created user) Note: The execution environment of this statement is the environment when we first entered the command console

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324991863&siteId=291194637
Recommended