M1 오라클 19c 설치 - M1 olakeul 19c seolchi

// LIMA (Linux on Mac) 는 qemu기반으로 동작하는 가상화 프로그램이다.

-- LIMA is virtual program base on qemu. 

// 따라서,  qemu의 버전이 최신일 수 록 에러 확률이 적을 것으로 보인다.

-- so, recommened as high as prossible, qemu version.

// qemu 설치

$ brew install qemu

// 버전 확인 -- version check

// 2022년04월 기준 QEMU emulator version 6.2.0_1 이상의 버전을 갖출 것을 권장하고 있다.

-- On M1 macOS, Homebrew's QEMU 6.2.0_1 or later is recommended

$ qemu-system-aarch64 --version

// lima 설치 -- lima installation

$ brew install lima

// 버전 확인  -- version check

$ limactl --version

// 환경변수에 $LIMA_HOME을 설정하지 않으면 ~/.lima가 LIMA_HOME 으로 설정됨. (선택해서 설정)

-- If you didn't set LIMA_HOME then, ~/.lima is setted on LIMA_HOME. (you don't have to do this.)

$ vi ~/.zshrc

export LIMA_HOME=/opt/homebrew/Cellar/lima/0.9.2/lima_home

$ mkdir $LIMA_HOME/lima_home

// oraclelinux container 생성 -- create oraclelinux container

// 이 명령어를 실행하면 oraclelinux 8 버전이 설치된다. 플랫폼은 x86_64로 사용한다. (2022년 4월 기준)

-- if execute this command, might be installed oraclelinux 8 version. And use x86_64 platform. ( April 2022 standard )

$ limactl start --name=oraclelinux platform://oraclelinux

// 생성 확인 -- check creation

$ limactl list

// 생생된 oraclelinux container 쉘 접속 -- connect oraclelinux container shell 

$ limactl shell oraclelinux

// lima oracle linux 버전 및 플랫폼 확인 -- Check lima oracle linux version and platform

LIMA user> uname -a

// oracle database runInstaller 를 위한 X11 설치 -- install X11 for oracle database runInstaller

LIMA user> sudo dnf config-manager --enable ol8_codeready_builder

LIMA user> sudo dnf install xorg-x11-apps

// 이 후 oracle database 설치를 진행하면 된다. -- after then proceed oracle installation

LIMA user> sudo yum install -y oracle-database-preinstall-19c

// oracle 계정으로 runInstaller를 실행하려면, xquartz가 설치되어있어야하며 아래 명령어로 ssh 접속 후 oracle 계정으로 swich user 해야한다.

-- if you want to execute runInstaller by GUI mode, must be installed xquartz in your macOS and do switch user to oracle after execute below ssh command.

$ ssh -X -p 60021 -o NoHostAuthenticationForLocalhost=yes -i $LIMA_HOME/_config/user localhost​

or

$ ssh -Y -p 60021 -o NoHostAuthenticationForLocalhost=yes -i $LIMA_HOME/_config/user localhost​

// 주의! -- Caution!

// xquartz 사용 시, 영어로 runInstaller를 실행하면 글자가 깨지는 것이 덜함. (M1 에서만)

-- When you use xquartz, recommand to execute runInstaller by english. (only M1)

LIMA oracle> export LANG=en_US.UTF-8

// runInstaller를 하기 전, oraclelinux 버전이 8버전이라면 oracle database 19c 설치 시 아래 명령어를 실행하고 설치할 것.

--  Before execute runInstaller, if your oraclelinux version is 8 then, install oracle database 19c after execute below command.

LIMA oracle> export CV_ASSUME_DISTID=RHEL7.9

// 아직 lima에서는 sharable disk를 지원하지 않는 듯 함. RAC 설치 시 ASM 사용은 어려울 것으로 보여진다.

-- seems like does not support sharable disk on lima yet. So when install RAC, I think that hard to use ASM.

// RAC 사용을 위해 여러 개의 네트워크 인터페이스가 필요하다면, homebrew를 이용해 vde_vmnet을 다운 받아 사용해야한다.

-- if you need multiple network interfaces for using RAC, have to download vde_vmnet using homebrew.

$ brew install vde_vmnet

// lima 내부적인 sudo 사용을 위해 /private/etc/sudoer.d/lima 파일에 lima sudoer 내용을 넣어준다.

-- input  lima sudoer contents at /private/etc/sudoer.d/lima file for using lima internal sudo command.

$ limactl sudoers | sudo tee /private/etc/sudoer.d/lima

// network interface를 늘리고 싶은 각 container의 lima.yaml 파일에 아래 내용을 추가한다.

-- Add below cotents at each container's lima.yaml what you want to extend network interface.

$ vi lima.yaml

networks:
  - lima: shared
  - lima: host

// RAC를 위해 ssh 설정 시, "limactl show-ssh ?" 에서 나오는 ssh option을 각 노드 /etc/ssh/ssh_config 파일에 설정을 넣는다. (단, ControlPath, UserKnownHostsFile 제외) IdentityFile 은 host의 $LIMA_HOME/_config/user 의 파일을 가져와서 정의해준다.

-- When set ssh for RAC, put "limactl show-ssh ?" contents's ssh options in /etc/ssh/ssh_config. (but, except ControlPath, UserKnownHosts) IdentityFile must be defined using host's $LIMA_HOME/_config/user