OS 환경 : Windows 11 Home (64bit)
SW 환경 : Docker Desktop 4.33.1
DB 환경 : Oracle Database 23.5.0.24.07 ai Free
방법 : 도커에 Oracle 23ai Free 설치 및 삭제 가이드
본문에서는 도커 환경에 오라클 23ai Free 버전을 설치하는 방법을 설명함
도커 설치는 아래 게시물 참조
Windows 11 Home에 Docker 설치 가이드 ( https://positivemh.tistory.com/1153 )
파워쉘 실행 후 아래 명령어로 설치
1
|
PS> docker pull container-registry.oracle.com/database/free:latest
|
pull 실행 완료 후 run 명령 실행
1
|
PS> docker run -d --name oracle container-registry.oracle.com/database/free:latest
|
도커 오라클 로그 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
PS> docker logs oracle
Starting Oracle Net Listener.
Oracle Net Listener started.
Starting Oracle Database instance FREE.
Oracle Database instance FREE started.
The Oracle base remains unchanged with value /opt/oracle
#########################
DATABASE IS READY TO USE!
#########################
The following output is now a tail of the alert.log:
2024-08-31T13:12:17.209572+00:00
===========================================================
Dumping current patch information
===========================================================
No patches have been applied
===========================================================
2024-08-31T13:12:17.856389+00:00
FREEPDB1(3):Opening pdb with Resource Manager plan: DEFAULT_PLAN
Completed: Pluggable database FREEPDB1 opened read write
Completed: ALTER DATABASE OPEN
|
정상적으로 설치됨
설치 후 도커 데스크톱에서도 확인
정상적으로 설치됨
bash 쉘 접속
1
|
PS> docker exec -it oracle bash
|
setPassword.sh 쉘을 이용해 오라클 접속 패스워드를 oracle 로 변경(sys, system, pdbadmin 유저)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
bash-4.4$ ls
setPassword.sh
bash-4.4$ ./setPassword.sh oracle
The Oracle base remains unchanged with value /opt/oracle
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sat Aug 31 13:19:20 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
SQL>
User altered.
SQL>
User altered.
SQL>
Session altered.
SQL>
User altered.
SQL> Disconnected from Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
|
설정됨
참고용 setPassword.sh 내용 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
bash-4.4$ cat setPassword.sh
#!/bin/bash
# LICENSE UPL 1.0
#
# Copyright (c) 1982-2023 Oracle and/or its affiliates. All rights reserved.
#
# Since: November, 2016
# Author: gerald.venzl@oracle.com
# Description: Sets the password for sys, system and pdb_admin
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#
if [ -e "${ORACLE_BASE}/oradata/${ORACLE_SID}/.prebuiltdb" ] && [ -n "${ORACLE_PWD}" ] && [ "${ORACLE_PWD}" != "$1" ]; then
echo "WARNING: The database password can not be changed for this container having a prebuilt database. The original password exists in the container environment. Your new password has been ignored!"
exit 1
fi
ORACLE_PWD=$1
ORACLE_SID="$(grep "$ORACLE_HOME" /etc/oratab | cut -d: -f1)"
if [ "$ORACLE_SID" == "FREE" ]; then
ORACLE_PDB="FREEPDB1"
fi
ORACLE_PDB=${ORACLE_PDB:-ORCLPDB1}
ORACLE_PDB=${ORACLE_PDB^^}
ORAENV_ASK=NO
source oraenv
sqlplus / as sysdba << EOF
ALTER USER SYS IDENTIFIED BY "$ORACLE_PWD";
ALTER USER SYSTEM IDENTIFIED BY "$ORACLE_PWD";
ALTER SESSION SET CONTAINER=$ORACLE_PDB;
ALTER USER PDBADMIN IDENTIFIED BY "$ORACLE_PWD";
exit;
EOF
|
입력한 패스워드로 시스템 유저들 패스워드를 설정하는 스크립트임
cdb 접속 후 버전 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
bash-4.4$ sqlplus sys/oracle@localhost:1521/FREE as sysdba
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sat Aug 31 13:23:14 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> select instance_name, status, version from v$instance;
INSTANCE_NAME STATUS VERSION
---------------- ------------ -----------------
FREE OPEN 23.0.0.0.0
|
pdb 접속 후 버전 확인
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
bash-4.4$ sqlplus sys/oracle@localhost:1521/FREEPDB1 as sysdba
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Sat Aug 31 13:21:49 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
SQL> show con_name
CON_NAME
------------------------------
FREEPDB1
SQL> select instance_name, status, version from v$instance;
INSTANCE_NAME STATUS VERSION
---------------- ------------ -----------------
FREE OPEN 23.0.0.0.0
|
도커 오라클 삭제
도커 컨테이너 이름 확인
1
2
3
|
PS> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fc2c383a9cb1 container-registry.oracle.com/database/free:latest "/bin/bash -c $ORACL…" 21 minutes ago Up 21 minutes (healthy) 1521/tcp oracle
|
컨테이너 정지
1
2
|
PS> docker stop fc2c383a9cb1
fc2c383a9cb1
|
컨테이너 삭제
1
2
|
PS> docker rm fc2c383a9cb1
fc2c383a9cb1
|
도커 컨테이너 재확인
1
2
|
PS> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
정상적으로 제거됨
다시 오라클 bash 접속을 시도하면 컨테이너가 없다고 나옴
1
2
|
PS> docker exec -it oracle bash
Error response from daemon: No such container: oracle
|
참고1
도커 환경에 설치해본게 처음인데 bash 에 들어왔을때 os 버전을 확인해보니 redhat 8.10 이었음
1
2
3
4
5
6
7
|
PS> docker exec -it oracle bash
bash-4.4$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.10 (Ootpa)
bash-4.4$ uname -a
Linux fc2c383a9cb1 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
|
참고2
오라클 엔진은 /opt/oracle 밑에 설치됨
1
2
3
4
5
6
7
8
9
10
11
|
bash-4.4$ cd $ORACLE_HOME
bash-4.4$ pwd
/opt/oracle/product/23ai/dbhomeFree
bash-4.4$ ls
LICENSE cfgtoollogs data has jdk network oracore python sdk ucp
OPatch clone dbs hs jlib nls ord racg slax usm
QOpatch crs deinstall install ldap odbc oss rdbms sqlcl utl
R crypto demo instantclient lib olap oui relnotes sqlj xdk
addnode css diagnostics inventory log oml4py perl root.sh sqlpatch
assistants ctx dv javavm md opmn plsql runInstaller sqlplus
bin cv env.ora jdbc mgw oraInst.loc precomp schagent.conf srvm
|
참조 :
https://www.oracle.com/database/free/get-started/
https://velog.io/@deaf52/Oracle-묻따말-오라클-23c-사용해보기-1.-설치
https://velog.io/@koo8624/Docker-번역-도커-아키텍처-Docker-Architecture-Overview
'ORACLE > Install' 카테고리의 다른 글
Oracle Linux 8.4에 Oracle 19c Silent 모드 설치 가이드 (1) | 2024.09.06 |
---|---|
Oracle 19c Single DB RU(Release Update) 패치 가이드 (2) | 2024.08.17 |
Oracle Linux 8.4에 Oracle 19c 설치 가이드 (0) | 2024.08.14 |
Oracle Linux 8.4에 Oracle 23ai Exa 버전(정식23ai 버전X) 설치 가이드 (0) | 2024.08.09 |
Oracle Linux 4.8에 Oracle 10g R2 설치 가이드 (0) | 2024.08.02 |