Oracle backup and recovery Script 1 backup [plain] @ echo off set oracle_username = sorted set oracle_password = YOUR_PASSWORD set local_tnsname = LOCAL_TNSNAME set url = % oracle_username %/% oracle_password % if not % local_tnsname % = "" set url = % url % @ % local_tnsname % www.2cto.com ensure that there is no file exp % url % file = % oracle_username % in the same directory during rem execution. dmp log = % oracle_username %. log can save the above script as a bat file for execution. The script exports all the content of user YOURORACLE_USERNAME in the database specified by local_tnsname to the YOURORACLE_USERNAME.dmp file, and writes the log to YOURORACLE_USERNAME.log. 2. Restore 2.1 to create a USER. Step 1: completely delete the USER YOURORACLE_USERNAME (if this USER exists): [SQL] DROP USER YOURORACLE_USERNAME CASCADE Step 2: Create a tablespace and set YOUR_TABLESPACE as needed, and maxsize. [SQL] create tablespace YOUR_TABLESPACE logging datafile 'd: \ oracle \ product \ 10.2.0 \ oradata \ YOUR_TABLESPACE.dbf 'size 512 m autoextend on next 64 m maxsize 1024 m extent management local; step 3, CREATE this USER [SQL] create user YOURORACLE_USERNAME identified by YOUR_PASSWORD default tablespace YOUR_TABLESPACE temporary tablespace temp Step 4, GRANT permissions [SQL] GRANT DBA TO YOURORACLE_USERNAME WITH ADMIN OPTION 2.2 restore command line WITH IMP Run this script www.2cto.com [plain] imp YOURORACLE_USERNAME/YOUR_PASSWORD @ LOCAL_TNSNAME FILE = YOURORACLE_USERNAME.DMP LOG = required FULL = Y 3. Use windows batch processing to call sqlplus to execute the SQL statement: [plain] @ echo off rem sqlplus username/password @ service @ mysql. SQL sqlplus YOURORACLE_USERNAME/YOUR_PASSWORD @ LOCAL_TNSNAME @ 20121228. SQL exit where 20121228. SQL is the SQL script to be executed. Note: YOURORACLE_USERNAME, YOUR_PASSWORD, and LOCAL_TNSNAME must be replaced with a specific string based on the actual situation.