As Apple has released the M1 chip with a different architecture than the previous generation, it resulted in various apps including Oracle Instant Client not being able to work normally on Apple silicon. However, there’s Rosetta 2 — “A translation process that allows users to run apps that contain x86–64 instructions on Apple silicon” says by Apple. So, In this article I’m going to share my sample steps for setting up Oracle Database Instant Client in Apple Silicon M1. Show
If you are facing an issue related to installation of Oracle Database Instant Client on M1 something like “DPI-1047: Cannot locate a 64-bit Oracle Client library: mach-o, but wrong architecture”, you may consider the following solution as an alternative way to install Oracle Instant Client. Steps to Install Oracle Instant Client on Apple SiliconStep 1: install rosetta2Use below command to install rosetta2:
Then, I duplicate the terminal and set default to “open using rosetta” and will use this terminal to install other items in the next steps. Step 2: install brewUse below command to install brew: Step 3: install python Use below command to install python: Step 4: install pip and dependencies library Use below command to install pip: Note: make sure that the libraries are installed with -x86_64. Step 5: download instant client Link: https://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.html step 6: setup export path in .zshrc file
Step 7: Install cx_Oracle from PyPi Step 8: try running SQLPlus References: https://stackoverflow.com/questions/64963370/error-cannot-install-in-homebrew-on-arm-processor-in-intel-default-prefix-usr 참고) m1맥북은 오라클 지원을 안한다고 한다.. 맥에 Oracle을 설치하려면 가상 머신과 비슷한 Docker 컨테이너를 통해야 한다. 설치 후 Docker 앱에서 로그인하기내가 저장할 오라클의 이미지와 오라클 컨테이너의 정보의 저장을 위해 로그인한다. docker pull deepdiver/docker-oracle-xe-11goracle xe 11g 이미지를 다운받는다. docker pull jaspeen/oracle-xe-11g사용할 oracle 버전을 다운받는다. docker run --name myoracle -d -p 8080:8080 -p 1521:1521 jaspeen/oracle-xe-11g로컬과 컨테이너의 포트를 연결시켜주는 작업이다. docker ps -a현재 실행되고 있는 컨테이너 아이디와 정보를 보여준다. docker rename <현재 컨테이너 이름> <새 컨테이너 이름>컨테이너를 알아보기 쉽게 하기 위해 현재 컨테이너 이름을 새 컨테이너 이름으로 바꾸어 준다. docker exec -it myoracle sqlpluscmd에서 sqlplus를 실행한다. 오라클 사이트에서 SQL developer를 설치한다. 맥에서 SQL developer 실행 시 유의사항
sqldeveloper.conf 파일에 추가해야 할 내용
번외1. 맥에서 터미널로 .sql파일 실행하기윈도우에서는 @이후 파일 경로와 파일 이름을 적어주면 되지만 맥에서는 docker를 이용하여 실행하여야 한다. docker exec -i myoracle sqlplus system/oracle < 파일 경로/파일 이름.sql번외2. SQL developer 한글로 인코딩 바꾸기도구>환경설정>환경>인코딩에서 UTF-8로 변경한다. 주의) SQLDeveloper는 Java8과 Java11에서만 실행됩니다.참고한 블로그 |