I use the following exp command to export:
c: \ exp username / userpasswd @ SID the Tables = (MyTable)
and then use the following statement to import:
c: \ imp username / userpasswd @ SID the Tables = (MyTable) the ignore = yes
record after imp table no restore the situation before exp, but a record increase in the number doubled. Insert the duplicate records!
How to make imp to clear the records of the original table, and then import?
With almost all over the imp.exe parameters, there are still such problems.
Please enlighten heroes!
Thank you!
First delete table records, I think it's way more convenient to delete user |
solution:
ORACLE database delete users, re-create the user .dmp file and import
The development process, is sometimes necessary to produce the overall export and re-import data development environment, here I put my delete the user database and re-import the whole process .dmp data file did compile and provide reference for students in need, wrong place please advise.
One. Log oracle user with xshell
two. Log in sqlplus:
sqlplus /nolog;
connect / as sysdba;
three. Restart the database with constraints:
shutdown abort;
startup restrict;
Note: If you do not constrained way to start the database, you will connect to access this database, the following steps will complain when the user deletes
four. delete users
drop user username cascade;
Note: If you do not perform the third step above, users will still have access, when you delete a user error: ORA-0194: can not drop a user that is currently connected.
The above error is a user tried to kill the process, delete users, is still being given, it is safer to start with a database constraint mode
Fives. Create a user
create user username identified by password; // create a user and password
six. To give permission to the user
grant create session to sun; // permissions granted to user-created sun session, that landing rights
grant unlimited tablespace to sun; // sun grant user permissions table space
grant create table to sun; // granted permission to create tables
grant drop any table to sun; // granted permission to delete tables
grant insert any table to sun; // insert a table of permissions
grant update any table to sun; // permission to modify the table
grant dba to username; // dba privileges granted to users
Note: If the permissions granted to the user dba, the data will complain when you import: IMP-00013: only a DBA can import a file exported by another DBA
Because only the DBA can import a file exported by another DBA
Seven. Users unlock
alter user username account unlock;
Eight. Service restart
shutdown abort;
startup;
nine. exit Exit sqlplus
ten. Open listening port
lsnrctl start;
eleven. Import Data
imp username/password@ORCL file=/home/oracle/***.dmp log=/home/oracle/***.log full=y;
Remark
Password expiration modification: the ALTER username IDENTIFIED by the User password;
---------------------
Author: STIll_clx
Source: CSDN
Original: https: //blog.csdn.net/ STIll_ly / article / details / 78170454
copyright: This article is a blogger original article, reproduced, please attach Bowen link!