Sanja Alone |
13-09-2008 01:33 897750 |
Что и где подчистить описано в этом файле из документации к Oracle 9: <Oracledoc>/install/install.htm
Цитата:
1. Log in as a member of the Administrators group.
2. Ensure that you first follow the instructions in "Stopping Oracle Services on Windows Platforms".
3. Start the registry at the MS-DOS command prompt: C:\> regedt32
4. Go to HKEY_CLASSES_ROOT.
5. Delete any key that starts with Oracle, ORA, or ORCL.
6. Go to HKEY_LOCAL_MACHINE\SOFTWARE.
7. Delete the ORACLE and Apache Group keys.
8. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services.
9. Delete all keys under here that begin with ORACLE.
10. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services \Eventlog\Application.
11. Delete all keys under here that begin with ORACLE.
12. Go to HKEY_CURRENT_USER.
13. Delete ORACLE.
14. Go to HKEY_CURRENT_USER\SOFTWARE\ORACLE.
15. Delete keys that start with Oracle or ORCL (if any exist).
16. Delete any Oracle keys (if any exist).
17. Close the registry.
18. Restart your computer.
|
А скрипт выглядел так (немного корявенько и неоптимально, но эффективно):
Код:
#include <File.au3>
#include <Array.au3>
Func _OraclePrevDel()
Local $key_services='HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services'
Local $key_servelog='HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application'
Local $key_hklmsoft='HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE'
Local $key_hkcusoft='HKEY_CURRENT_USER\SOFTWARE\ORACLE'
Local $key_hkcu='HKEY_CURRENT_USER\ORACLE'
Local $key_hkcr='HKEY_CLASSES_ROOT'
Local $key_path='HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
Local $i=0, $j=0
Dim $t[1]
Local $inst_loc=RegRead($key_hklmsoft,'inst_loc')
Local $ORACLE_HOME=RegRead($key_hklmsoft,'ORACLE_HOME')
Local $ORACLE_GROUP_NAME=RegRead($key_hklmsoft,'ORACLE_GROUP_NAME')
;Остановка служб
If FileExists(@SystemDir & '\net.exe') Then
$pid = Run(@Comspec & ' /c net start', '', 0, 6)
$f = ''
While not @error
$f = $f & StdoutRead($pid)
Wend
$pid=StringSplit(StringReplace($f,@LF,''),@CR)
For $i=1 To $pid[0]
If StringLeft(StringStripWS($pid[$i],8),3)="Ora" Then
RunWait(@Comspec & ' /c net stop ' & StringStripWS($pid[$i],8), '', @SW_HIDE)
EndIf
Next
$f=0
$pid=0
EndIf
;inst_loc
If StringRight($inst_loc,10)='\Inventory' Then
$inst_loc=StringTrimRight($inst_loc,10)
EndIf
If FileExists($inst_loc) Then
DirRemove($inst_loc,1)
EndIf
;ORACLE_HOME
If FileExists($ORACLE_HOME) Then
DirRemove($ORACLE_HOME,1)
EndIf
;menu
If FileExists(@ProgramsCommonDir & '\' & $ORACLE_GROUP_NAME) and $ORACLE_GROUP_NAME<>'' Then
DirRemove(@ProgramsCommonDir & '\' & $ORACLE_GROUP_NAME,1)
EndIf
If FileExists(@ProgramsCommonDir & '\' & "Oracle Installation Products") Then
DirRemove(@ProgramsCommonDir & '\' & "Oracle Installation Products",1)
EndIf
;Services
$i=0
While 1
$i=$i+1
$key = RegEnumKey($key_services, $i)
If @error <> 0 Then
$key=''
ExitLoop
EndIf
If StringLower(StringLeft($key,6))="oracle" Then
$t[$j]=$key_services & '\' & $key
ReDim $t[UBound($t) + 1]
$j=$j+1
EndIf
WEnd
If UBound($t)>1 Then
ReDim $t[UBound($t) - 1]
EndIf
For $i=0 To UBound($t)-1
If $t[$i]<>'' Then
RegDelete($t[$i])
EndIf
Next
;Services - Eventlog
$i=0
$j=0
ReDim $t[1]
$t[0]=''
While 1
$i=$i+1
$key = RegEnumKey($key_servelog, $i)
If @error <> 0 Then
$key=''
ExitLoop
EndIf
If StringLower(StringLeft($key,6))="oracle" Then
$t[$j]=$key_servelog & '\' & $key
ReDim $t[UBound($t) + 1]
$j=$j+1
EndIf
WEnd
If UBound($t)>1 Then
ReDim $t[UBound($t) - 1]
EndIf
For $i=0 To UBound($t)-1
If $t[$i]<>'' Then
RegDelete($t[$i])
EndIf
Next
;HKCR
$i=0
$j=0
ReDim $t[1]
$t[0]=''
While 1
$i=$i+1
$key = RegEnumKey($key_hkcr, $i)
If @error <> 0 Then
$key=''
ExitLoop
EndIf
If StringLower(StringLeft($key,3))="ora" or StringLower(StringLeft($key,4))="orcl" Then
$t[$j]=$key_hkcr & '\' & $key
ReDim $t[UBound($t) + 1]
$j=$j+1
EndIf
WEnd
If UBound($t)>1 Then
ReDim $t[UBound($t) - 1]
EndIf
For $i=0 To UBound($t)-1
If $t[$i]<>'' Then
RegDelete($t[$i])
EndIf
Next
$key=0
;Path
$j=0
ReDim $t[1]
$t[0]=''
$path=StringSplit(RegRead($key_path,"Path"),';',1)
For $i=1 To $path[0]
If StringInStr($path[$i],$inst_loc)=0 and StringInStr($path[$i],$ORACLE_HOME)=0 Then
$t[$j]=$path[$i]
ReDim $t[UBound($t) + 1]
$j=$j+1
EndIf
Next
If UBound($t)>1 Then
ReDim $t[UBound($t) - 1]
EndIf
$p=_ArrayToString($t, ';')
RegWrite($key_path,"Path","REG_EXPAND_SZ",$p)
$p=0
EnvUpdate()
;удаление веток
RegDelete($key_hkcu)
RegDelete($key_hkcusoft)
RegDelete($key_hklmsoft)
;удаление временных каталогов
ReDim $t[1]
$t[0]=''
If FileExists(@TempDir & '\' & 'OraInstall*') Then
$t=_FileListToArray(@TempDir,'*',2)
For $i=1 To $t[0]
If StringLower(StringLeft($t[$i],10))="orainstall" Then
DirRemove(@TempDir&'\'&$t[$i],1)
EndIf
Next
EndIf
EndFunc
|