@ 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