Oracle Data Backup

Source: Internet
Author: User

@echo off Setlocalrem main modified belt!!! Number of the next line of REM data instance name!!! Set SID=ORCLREM user name!!! Set Username=sysrem password!!! Set Password=123456rem the user who needs to be backed up!!! Set Schemas=userrem userid content set connect=%username%/%password%@127.0.0.1/%sid%rem date character Set date_string=%date:~0,4%% Date:~5,2%%date:~8,2%rem time Character Set time_hour=%time:~,2%if%time_hour% GEQ goto okset time_string=%time:~1,1%%time:~ 3,2%%time:~6,2%goto config:okset time_string=%time:~0,2%%time:~3,2%%time:~6,2%:configrem file Character Set file_string=%sid% _%date_string%%time_string%rem exp%connect% file=%file_string%.dmp indexes=y grants=y constraints=y compress=y log=% File_string%.log rem EXPDP command Note You must first create a virtual directory Directory=bakdir!!! EXPDP userid= '%connect% as Sysdba ' schemas=%schemas% dumpfile=%file_string%.dmp logfile=%file_string%.log directory= Bakdir

REM Data import Note that the DumpFile file needs to be stored in the same folder as the directory file when importing

IMPDP userid= '%connect% as Sysdba ' schemas=%schemas% dumpfile=%file_string%.dmp directory=bakdir

-------------------above are bat files-------------------------------------

Run the cmd input cmd.exe/k E:\imp.bat do not place the batch file on the desktop if the runtime flashes.

----------------------SQL-------------------------------------------

Create tablespace table Space datafile ' E:\xx.dbf ' size 1000m;create user xx identified by 123456 default tablespace tablespace; Grant D  Ba to XX; --Means to grant DBA authority to XX user create OR REPLACE directory Bakdir as ' C:\BAKDIR ';--Create virtual directory grant read, write on directory Bakdir to xx;- -Virtual Directory Assignment permissions

Oracle Data Backup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.