안녕세계

[Oracle] MacOS에 Oracle 설치 (with. Docker) 본문

[Oracle] MacOS에 Oracle 설치 (with. Docker)

Junhong Kim 2021. 6. 29. 20:43
728x90
반응형

안녕하세요.

이번 포스팅에서는 MacOS에 Oracle(오라클)을 설치하는 방법에 대해 알아봅니다.

MacOS에서 Oracle DB를 사용하기 위해서 Docker를 이용합니다.

그리고 테스트시 사용할 scott 계정 활성화 방법에 대해서도 설명합니다.

Oracle 11g 설치

# 이미지 다운로드
$ docker pull deepdiver/docker-oracle-xe-11g

# oracle11g 컨테이너 실행
$ docker run --name oracle11g -d -p 8080:8080 -p 1521:1521 deepdiver/docker-oracle-xe-11g

# sqlplus로 oracle11g 컨테이너 접속
$ docker exec -it oracle11g sqlplus

Enter user-name: sys as sysdba
password: oracle

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

Oracle 12g 설치

# 이미지 다운로드
$ docker pull truevoly/oracle-12c

# oracle12g 컨테이너 실행
$ docker run --name oracle12g -d -p 8080:8080 -p 1521:1521 truevoly/oracle-12c

# sqlplus로 oracle12g 컨테이너 접속
$ docker exec -it oracle12g sqlplus

Enter user-name: sys as sysdba
Enter password: oracle

Connected to:
Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production

Scott 계정 활성화

$ docker exec -it oracle12g sqlplus

Enter user-name: scott
Enter password: tiger
ERROR:
ORA-28000: the account is locked # 최초 접속시 scott 계정이 lock 상태입니다.

---

Enter user-name: sys as sysdba
Enter password: oracle

Connected to:
Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production

SQL> alter user scott account unlock; # scott 계정 lock을 해제합니다.

User altered.

SQL> exit;

---

$ docker exec -it oracle12g sqlplus

Enter user-name: scott
Enter password: tiger
ERROR:
ORA-28001: the password has expired

Changing password for scott
New password: tiger
Retype new password: tiger
Password changed

Connected to:
Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production

SQL> select * from dept;

    DEPTNO DNAME	  LOC
---------- -------------- -------------
	10 ACCOUNTING	  NEW YORK
	20 RESEARCH	  DALLAS
	30 SALES	  CHICAGO
	40 OPERATIONS	  BOSTON

참고

https://stricky.tistory.com/395

https://wakestand.tistory.com/128

 

728x90
반응형
Comments