Initialization
--CREATE TABLE SpaceCREATETablespace table space name datafile'file name. dat'SIZE 100M Autoextend on NEXT10M MAXSIZE UNLIMITED;--Create User (Oauser)--Connect InternalCREATE USEROauser identified byOauser;ALTER USEROauserDEFAULTtablespace tablespace_name;ALTER USEROauserDEFAULTROLE All;GRANTDba toOauser;GRANTCONNECT toOauser;GRANTRESOURCE toOauser;GRANT Create Table toOauser;GRANT Create Trigger toOauser;GrantExp_full_database toOauser;GrantImp_full_database toOauser;--Delete user and table spaces--Step One: Delete userDrop UserxxCascade--Note: Delete the user, just delete the schema objects under the user, will not delete the corresponding tablespace. --Step Two: delete tablespaceDROPTablespace table space name including CONTENTS anddatafiles;
Oracle Import and Export (IMPDP,EXPDP):
// oracle 11g creates an import export directory that requires a connection to the database Span style= "color: #0000ff;" >create or replace Directory Expdp_dir as e:\backup // grant read , write to Oauser1;
Back up the current database
expdp directory=expdp_dir dumpfile= backup file name. DMP logfile= BACKUP log name. Log
Example:
oauser1/123456 Directory=expdp_dir dumpfile=2015-12-11.dmp Logfile=2015-12-11.log
// Copy the DMP backup file to Expdp_dir // Import the backup data into the IMPDP user name / password [@ Listen ] dumpfile= backup file name Directory=Expdp_dir remap_ Schema= user name when exporting: User logfile at import= log file name;
Example:
IMPDP oauser1/123456 dumpfile=2015-12-11.dmp directory=expdp_dir remap_schema=oauser:o Auser1
PS:EXPDP,IMPDP These two commands are server-side commands, directly in the CMD to run as an administrator;
About Oracle Database backup restore-IMPDP,EXPDP