오라클 데이터베이스(Oracle Database) 11g 삭제하기
1. 내컴퓨터 (우클릭) -> 관리 -> 서비스 및 응용프로그램 -> 서비스 -> Oracle 로 시작하는 모든 프로그램 중지
2. 시작->실행->regedit 적고-> 레지스트리 편집기에서 아래 레지를 지우기
아래 폴더 안에 해당 레지가 존재하지 않는다면 무시
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services 에서 Oracle이라 시작하는 모든 것 삭제
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services 에서 Oracle이라 시작하는 모든 것 삭제
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ 에서 Oracle이라 시작하는 모든 것
3. 내컴퓨터 (우클릭) -> 속성 -> 고급시스템설정 ->고급 -> 환경변수 -> 시스템 변수 아래에 있는 Path 편집
변수값에서 D:\app\product\11.2.0\dbhome_1\bin (사용자 컴퓨터에 따라 다를 수 있음)라 되어있는 내 DBhome의 bin 변수값을 삭제
4. C드라이브 -> Program files -> Oracle -> inventory 삭제
Oracle 폴더안에 inventory만 있다면 Oracle 폴더 전체 삭제
5. DB 폴더 삭제
만약 DB폴더가 D드라이버에 있는 app폴더에 저장되어 있으면이 폴더 전체를 삭제
WITH T AS
(
SELECT 'A01' CD, 'AA' A, 'A' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'AA' A, 'B' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'AA' A, 'B' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'AA' A, 'B' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'BB' A, 'A' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'BB' A, 'A' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'BB' A, 'A' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'BB' A, 'A' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'CC' A, 'A' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'CC' A, 'B' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'CC' A, 'C' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'CC' A, 'A' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'DD' A, 'A' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'DD' A, 'C' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'DD' A, 'C' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'DD' A, 'C' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'DD' A, 'C' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'DD' A, 'D' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'EE' A, 'D' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'EE' A, 'D' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'EE' A, 'D' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'EE' A, 'D' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'EE' A, 'D' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'EE' A, 'C' B FROM DUAL UNION ALL
SELECT 'A01' CD, 'EE' A, 'C' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'AA' A, 'A' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'AA' A, 'A' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'AA' A, 'B' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'AA' A, 'B' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'AA' A, 'A' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'AA' A, 'A' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'BB' A, 'C' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'BB' A, 'D' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'BB' A, 'D' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'BB' A, 'D' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'BB' A, 'D' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'BB' A, 'D' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'CC' A, 'A' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'CC' A, 'A' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'CC' A, 'B' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'DD' A, 'B' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'DD' A, 'C' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'DD' A, 'D' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'DD' A, 'A' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'DD' A, 'A' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'DD' A, 'B' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'DD' A, 'B' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'DD' A, 'C' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'DD' A, 'D' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'EE' A, 'D' B FROM DUAL UNION ALL
SELECT 'B01' CD, 'EE' A, 'A' B FROM DUAL
)
SELECT CD,
CASE WHEN GROUPING(RN) !=0 THEN '합계'
ELSE CASE WHEN RN > 3 THEN '기타'
ELSE TO_CHAR(MAX(NO))
END
END NO,
CASE WHEN GROUPING(RN) = 0 AND RN <= 3
THEN MAX(A)
END A,
CASE WHEN GROUPING(RN) = 0 AND RN <= 3
THEN MAX(B)
END B,
SUM(CNT) CNT,
TO_CHAR(SUM(RT)*100,'FM990.00')||'%' RT
FROM (
SELECT CD,
A,
B,
COUNT(*) CNT,
RANK() OVER (PARTITION BY CD ORDER BY COUNT(A||B) DESC) NO,
CASE WHEN ROW_NUMBER() OVER (PARTITION BY CD ORDER BY COUNT(A||B) DESC,B) > 3 THEN 4
ELSE ROW_NUMBER() OVER (PARTITION BY CD ORDER BY COUNT(A||B) DESC,B) END RN,
RATIO_TO_REPORT(COUNT(*)) OVER (PARTITION BY CD) RT
FROM T
GROUP BY CD,A,B
)
GROUP BY CD,ROLLUP(RN)