기타/Administration

[펌] Windows에 10gR2 및 11gR2를 설치할 경우

늘 고맙습니다 2011. 2. 23. 11:18


(1) 기본적으로 사용되는 Software 설정

 

Windows에 10gR2를 먼저 설치하고, 11gR2를 설치한 뒤

SQL*Plus를 실행하면 다음과 같이 11gR2가 기본적으로 사용된다.

 

C:\> sqlplus

 

   SQL*Plus: Release 11.2.0.1.0 Production on 수 5월 12 16:00:50 2010

 

만약 10gR2가 기본적으로 사용되기 원한다면 다음과 같이 하면 된다.

 

  시작 -> 프로그램 -> Oracle - OraDb11g_home1 -> Oracle 설치 제품 -> Universal Installer ->

  Installer 화면에서 "설치된 제품" 클릭 -> "환경" 탭 클릭 -> 아래쪽에 있는  "OraDb10g_home1"을 위로 이동 ->
  적용 -> 닫기 -> 취소 -> 종료 -> 예

 

이어서 SQL*Plus를 실행하면 아래와 같이 10gR2가 기본적으로 사용되는 것을 알 수 있다.

 

C:\> sqlplus
 
  SQL*Plus: Release 10.2.0.1.0 - Production on 수 5월 12 16:06:01 2010

 

________________________________________________________________________

 

(2) 원하는 버전을 쉽게 사용할 수 있도록 batch 파일 생성

 

10gR2와 11gR2가 아래와 같이 설치된 상황에서 

원하는 버전의 오라클 서버를 쉽게 시작, 종료하기를 원한다면

아래와 같이 bat 파일을 생성해서 이용하면 된다.

 

 - 10gR2의 ORACLE_HOME : C:\oracle\product\10.2.0\db_1
 - 10gR2의 ORACLE_SID     : orcl

 

 - 11gR2의 ORACLE_HOME : C:\app\STU\product\11.2.0\dbhome_1
 - 11gR2의 ORACLE_SID     : newdb


C:\Documents and Settings\STU> notepad 10g_start.bat

 

     set path=C:\oracle\product\10.2.0\db_1\bin;%path%

 

     net start OracleOraDb10g_home1TNSListener
     net start OracleServiceORCL
     net start OracleDBConsoleorcl
     isqlplusctl start

 

C:\Documents and Settings\STU> notepad 10g_stop.bat

 

     set path=C:\oracle\product\10.2.0\db_1\bin;%path%

     isqlplusctl stop
     net stop OracleDBConsoleorcl
     net stop OracleServiceORCL
     net stop OracleOraDb10g_home1TNSListener

 

C:\Documents and Settings\STU> notepad 11g_start.bat

 

     set path=C:\app\STU\product\11.2.0\dbhome_1\bin;%path%

     net start OracleOraDb11g_home1TNSListener
     net start OracleServiceNEWDB
     net start OracleDBConsolenewdb

 

C:\Documents and Settings\STU> notepad 11g_stop.bat

 

     set path=C:\app\STU\product\11.2.0\dbhome_1\bin;%path%

     net stop OracleDBConsolenewdb
     net stop OracleServiceNEWDB
     net stop OracleOraDb11g_home1TNSListener


C:\Documents and Settings\STU> notepad all_start.bat

 

     set path=C:\oracle\product\10.2.0\db_1\bin;%path%
     net start OracleOraDb10g_home1TNSListener
     net start OracleServiceORCL

 

     set path=C:\app\STU\product\11.2.0\dbhome_1\bin;%path%
     net start OracleServiceNEWDB

     lsnrctl service

 

C:\Documents and Settings\STU> notepad all_stop.bat

 

     set path=C:\app\STU\product\11.2.0\dbhome_1\bin;%path%
     net stop OracleServiceNEWDB

 

     set path=C:\oracle\product\10.2.0\db_1\bin;%path%
     net stop OracleServiceORCL

     net stop OracleOraDb10g_home1TNSListener

 

________________________________________________________________________

 

(3) 원하는 서버에 접속하기 

 

C:\Documents and Settings\STU>  all_start.bat

C:\Documents and Settings\STU> set oracle_sid=orcl

C:\Documents and Settings\STU> sqlplus system/oracle
SQL> select instance_name, version from v$instance;

INSTANCE_NAME    VERSION
---------------- -----------------
orcl             10.2.0.1.0

SQL> exit

 

C:\Documents and Settings\STU>set oracle_sid=newdb

C:\Documents and Settings\STU>sqlplus system/oracle
SQL> select instance_name, version from v$instance;

INSTANCE_NAME    VERSION
---------------- -----------------
newdb            11.2.0.1.0

SQL> exit


[출처] http://blog.naver.com/gseducation/20105639547