說明:
NONEFILE:該文件包含了SQLNET.AUTHENTICATION_SERVICES=(NONE)這一行文字
NTSFILE : 該文件包含了SQLNET.AUTHENTICATION_SERVICES=(NTS)這一行文字
批處理內容如下所示:
updateinternalpwd.bat
@echo off
set Oracle_SID=satest
set ORACLE_HOME=e:\Oracle\ora81
set path=e:\Oracle\ora81\bin;%PATH%
set NEWPWD=QQ12345
set NONEFILE=E:\Oracle\ora81\network\ADMIN\sqlnet2.ora
set NTSFILE=E:\Oracle\ora81\network\ADMIN\sqlnet1.ora
set DESTFILE=E:\Oracle\ora81\network\ADMIN\sqlnet.ora
set PWDFILE=PWD%Oracle_SID%.ora
set TTFILE=E:\Oracle\dbascripts\updatepwd.tmp
copy %NTSFILE% %DESTFILE%
echo Stop Database ,please wait...
echo connect internal > %TTFILE%
echo shutdown immediate >> %TTFILE%
echo exit >> %TTFILE%
type %TTFILE% |svrmgrl
echo Renew the passWord,please wait...
del %PWDFILE%
orapwd file=%PWDFILE% passWord=%NEWPWD% entrIEs=10
copy %NONEFILE% %DESTFILE%
echo Start Database,please wait...
echo connect internal/%NEWPWD% > %TTFILE%
echo startup >> %TTFILE%
echo exit >> %TTFILE%
type %TTFILE% |svrmgrl
del %TTFILE%
echo Action End!
pause