In windows, the oracle Data Import script bat

Source: Internet
Author: User

@ Echo off
Set sysUsr = system
Sets sysPwd = 123
Set usrname = test_zt
Set pasword = test_zt
Set sid = sid1
 
Set/p usrname = enter the user name [Press enter as the default value % usrname % ]:
Set/p pasword = enter the password [Press enter to the default value % pasword % ]:
Set/p sid = enter the database SID [Press enter to set % sid % by default ]:
Set fromuser = % usrname %
Set/p fromuser = enter fromuser [Press enter directly as username % usrname % ]:
Set/p sysUsr = enter the database system user name [Press enter to set % sysUsr % by default ]:
Set/p sysPwd = enter the database system password [Press enter to set % sysPwd % by default ]:
: Path
Set/p createUserFilePath = enter the path and file name of the user to be created. For example, c: \ createUser.txt supports file drag-in]
If "% createUserFilePath :~ 0, 1% "equ "~ 0, 1 "(echo" path cannot be blank "& goto path)
If exist % createUserFilePath % (goto next) else (echo "file path error" & goto path)
 
: Next
 
: Path2
Set/p impFilePath = enter the path and file name of the database to be imported [for example, c: \ imp_data.dmp support file Drag]
If "% impFilePath :~ 0, 1% "equ "~ 0, 1 "(echo" path cannot be blank "& goto path)
If exist % impFilePath % (goto next2) else (echo "file path error" & goto path2)
 
: Next2
 
: Back up www.2cto.com before deleting
Set time _ = % time: = 0%
Set fileName = % date :~ 0, 4% % date :~ 5, 2% % date :~ 8, 2% _ % time _:~ 0, 2% % time _:~ 3, 2% _ bak. dmp
Exp % usrname %/% pasword % @ % sid % file = % cd % \ % usrname % _ % fileName %
 
Sqlplus % sysUsr %/% sysPwd % @ % sid % @ % createUserFilePath %
 
Imp % sysUsr %/% sysPwd % @ % sid % fromuser = % fromuser % touser = % usrname % file = % impFilePath %
Pause

From a running pig

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.