ORACLE-exp export and import user imp

Read online examples use the command exp and imp command to import users with a lot of articles and found not very satisfied. So I have many experiments, finally got a satisfactory way.

Export user exp

We scott user as an example.
1, open cmd
2, run the following command to generate dmp file.

exp scott/tiger@Q owner=scott file=C:\Users\win10\Desktop\scott_dmp\scott.dmp

exp username / password @ db_name owner = db_name file = storage path
can be seen in the specified path has generated a dmp file. The document without prior creation, but to create a storage path of the file.

imp Import Users

1, the user login system, delete the user scott. If the scott user is connected, can not be deleted, you should withdraw from the connection. Since the index contains information scott, cascade parameters should be used. Command is as follows:

drop user scott cascade;

2, before importing imp scott user command, you need to create the user in the target database, and given the appropriate permissions. First log in sys or system user. Run the following statement:

create user scott identified by tiger;
grant create session,create table,unlimited tablespace to scott;

Scott users can see has been created successfully, but no data.
3, open cmd, run the following statement to import data.

imp scott/tiger@Q file=C:\Users\win10\Desktop\scott_dmp\scott.dmp full=y

imp username / password @ db_name file = dmp file storage path full = y
can see the scott user to import a success.

The above is the process of using exp and imp to export to import users.

Published 23 original articles · won praise 8 · views 4123

Guess you like

Origin blog.csdn.net/weixin_36522099/article/details/103466612