TheKoguryo's 기술 블로그

Version 2019.06.03

14.1.1.1 Windows에서 OCI CLI 설치하기

CLI 설치

  1. 관리자 모드로 PowerShell 실행

  2. PowerShell의 remote execution policy 구성을 위해 다음 명령 실행

    Set-ExecutionPolicy RemoteSigned
    • 정책 변경을 위해 Y 응답
  3. 설치 스크립트 실행을 위해 다음 실행

    powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1'))"
    • Python 설치여부: Y 응답
    • 설치 경로에 대한 확인 후 설정
    • CLI의 새 버전 업데이트 확인시 Y 응답
    • PATH에 CLI 추가 요청시 Y 응답
  4. 설치 후 현재 창에는 신규 등록한 PATH가 적용되지 않을 수 있으므로, 새로운 PowerShell을 열어 OCI CLI를 실행합니다.

예시

PS C:\WINDOWS\system32> Set-ExecutionPolicy RemoteSigned

실행 규칙 변경
실행 정책은 신뢰하지 않는 스크립트로부터 사용자를 보호합니다. 실행 정책을 변경하면 about_Execution_Policies 도움말
항목(https://go.microsoft.com/fwlink/?LinkID=135170)에 설명된 보안 위험에 노출될 수 있습니다. 실행 정책을
변경하시겠습니까?
[Y](Y)  [A] 모두 예(A)  [N] 아니요(N)  [L] 모두 아니요(L)  [S] 일시 중단(S)  [?] 도움말 (기본값은 "N"): Y
PS C:\WINDOWS\system32> powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).D
ownloadString('https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1'))"

Python is required to run the CLI.
Install Python now? (Entering "n" will exit the installation script)
[Y] Yes  [N] No  [?] 도움말 (기본값은 "Y"): Y
-- Verifying Python version.
-- Python version 3.6.2 okay.

===> In what directory would you like to place the install? (leave blank to use 'C:\Users\oracle\lib\oracle-cli'):
-- Creating directory 'C:\Users\oracle\lib\oracle-cli'.
-- We will install at 'C:\Users\oracle\lib\oracle-cli'.

===> In what directory would you like to place the 'oci.exe' executable? (leave blank to use 'C:\Users\oracle\bin'):
-- Creating directory 'C:\Users\oracle\bin'.
-- The executable will be in 'C:\Users\oracle\bin'.

===> In what directory would you like to place the OCI scripts? (leave blank to use 'C:\Users\oracle\bin\oci-cli-scripts'):
-- Creating directory 'C:\Users\oracle\bin\oci-cli-scripts'.
-- The scripts will be in 'C:\Users\oracle\bin\oci-cli-scripts'.
-- Downloading virtualenv package from https://github.com/pypa/virtualenv/archive/15.0.0.tar.gz.
-- Downloaded virtualenv package to C:\Users\oracle\AppData\Local\Temp\tmp7ufxqzj3\15.0.0.tar.gz.
-- Checksum of C:\Users\oracle\AppData\Local\Temp\tmp7ufxqzj3\15.0.0.tar.gz OK.
-- Extracting 'C:\Users\oracle\AppData\Local\Temp\tmp7ufxqzj3\15.0.0.tar.gz' to 'C:\Users\oracle\AppData\Local\Temp\tmp7ufxqzj3'.
-- Copying DLLs into virtualenv.
-- Copying C:\Users\oracle\Python\python3.dll to C:\Oracle\oracle-cli\Scripts
-- Copying C:\Users\oracle\Python\python36.dll to C:\Oracle\oracle-cli\Scripts
-- Copying C:\Users\oracle\Python\vcruntime140.dll to C:\Oracle\oracle-cli\Scripts
-- Executing: ['C:\\Users\\oracle\\Python\\python.exe', 'virtualenv.py', '--python', 'C:\\Users\\oracle\\Python\\python.exe', 'C:\\Oracle\\oracle-cli']
Already using interpreter C:\Users\oracle\Python\python.exe
Using base prefix 'C:\\Users\\oracle\\Python'
New python executable in C:\Oracle\oracle-cli\Scripts\python.exe
Installing setuptools, pip, wheel...done.
-- Executing: ['C:\\Oracle\\oracle-cli\\Scripts\\pip', 'install', '--cache-dir', 'C:\\Users\\oracle\\AppData\\Local\\Temp\\tmp7ufxqzj3', 'oci_cli', '--upgrade']
Collecting oci_cli
  Downloading https://files.pythonhosted.org/packages/b0/05/edb582a14ad96757601e98f27ebf1a825c918bf745f197d177af2d6423a7/oci_cli-2.4.40-py2.py3-none-any.whl (2.3MB)
    100% |████████████████████████████████| 2.3MB 5.4MB/s
Collecting six==1.11.0 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting retrying==1.3.3 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/44/ef/beae4b4ef80902f22e3af073397f079c96969c69b2c7d52a57ea9ae61c9d/retrying-1.3.3.tar.gz
Collecting python-dateutil==2.7.3 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl (211kB)
    100% |████████████████████████████████| 215kB 11.7MB/s
Collecting certifi (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)
    100% |████████████████████████████████| 163kB 10.6MB/s
Collecting pytz==2016.10 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/f5/fa/4a9aefc206aa49a4b5e0a72f013df1f471b4714cdbe6d78f0134feeeecdb/pytz-2016.10-py2.py3-none-any.whl (483kB)
    100% |████████████████████████████████| 491kB 18.8MB/s
Collecting cx-Oracle==6.2.1 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/0a/1f/f741fa005aec72b8278975a7d47c2ba9f305b5202fec5d15406da82f5d65/cx_Oracle-6.2.1-cp36-cp36m-win_amd64.whl (159kB)
    100% |████████████████████████████████| 163kB 4.8MB/s
Collecting jmespath==0.9.3 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/b7/31/05c8d001f7f87f0f07289a5fc0fc3832e9a57f2dbd4d3b0fee70e0d51365/jmespath-0.9.3-py2.py3-none-any.whl
Collecting oci==2.1.3 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/1d/35/61606bc5c885c13bd1d742d76cf6e8eac6a2733b33d65bc41fd3b6c9ff1b/oci-2.1.3-py2.py3-none-any.whl (1.5MB)
    100% |████████████████████████████████| 1.5MB 981kB/s
Collecting pyOpenSSL==17.5.0 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/79/db/7c0cfe4aa8341a5fab4638952520d8db6ab85ff84505e12c00ea311c3516/pyOpenSSL-17.5.0-py2.py3-none-any.whl (53kB)
    100% |████████████████████████████████| 61kB 1.8MB/s
Collecting cryptography==2.1.4 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/83/5d/87826c818f2a00e1c36e2bb4680bac68198501ba88d6fe56650aac4b314c/cryptography-2.1.4-cp36-cp36m-win_amd64.whl (1.3MB)
    100% |████████████████████████████████| 1.3MB 2.9MB/s
Collecting terminaltables==3.1.0 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/9b/c4/4a21174f32f8a7e1104798c445dacdc1d4df86f2f26722767034e4de4bff/terminaltables-3.1.0.tar.gz
Collecting httpsig-cffi==15.0.0 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/93/f5/c9a213c0f906654c933f1192148d8aded2022678ad6bce8803d3300501c6/httpsig_cffi-15.0.0-py2.py3-none-any.whl
Collecting arrow==0.10.0 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/54/db/76459c4dd3561bbe682619a5c576ff30c42e37c2e01900ed30a501957150/arrow-0.10.0.tar.gz (86kB)
    100% |████████████████████████████████| 92kB 10.2MB/s
Collecting idna<2.7,>=2.5 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/27/cc/6dd9a3869f15c2edfab863b992838277279ce92663d334df9ecf5106f5c6/idna-2.6-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 1.9MB/s
Collecting click==6.7 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB)
    100% |████████████████████████████████| 71kB 3.9MB/s
Collecting configparser==3.5.0 (from oci_cli)
  Downloading https://files.pythonhosted.org/packages/7c/69/c2ce7e91c89dc073eb1aa74c0621c3eefbffe8216b3f9af9d3885265c01c/configparser-3.5.0.tar.gz
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography==2.1.4->oci_cli)
  Downloading https://files.pythonhosted.org/packages/2f/85/a9184548ad4261916d08a50d9e272bf6f93c54f3735878fbfc9335efd94b/cffi-1.11.5-cp36-cp36m-win_amd64.whl (166kB)
    100% |████████████████████████████████| 174kB 7.1MB/s
Collecting asn1crypto>=0.21.0 (from cryptography==2.1.4->oci_cli)
  Downloading https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl (101kB)
    100% |████████████████████████████████| 102kB 9.0MB/s
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography==2.1.4->oci_cli)
  Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
    100% |████████████████████████████████| 163kB 11.6MB/s
Building wheels for collected packages: retrying, terminaltables, arrow, configparser, pycparser
  Running setup.py bdist_wheel for retrying ... done
  Stored in directory: C:\Users\oracle\AppData\Local\Temp\tmp7ufxqzj3\wheels\d7\a9\33\acc7b709e2a35caa7d4cae442f6fe6fbf2c43f80823d46460c
  Running setup.py bdist_wheel for terminaltables ... done
  Stored in directory: C:\Users\oracle\AppData\Local\Temp\tmp7ufxqzj3\wheels\30\6b\50\6c75775b681fb36cdfac7f19799888ef9d8813aff9e379663e
  Running setup.py bdist_wheel for arrow ... done
  Stored in directory: C:\Users\oracle\AppData\Local\Temp\tmp7ufxqzj3\wheels\ce\4f\95\64541c7466fd88ffe72fda5164f8323c91d695c9a77072c574
  Running setup.py bdist_wheel for configparser ... done
  Stored in directory: C:\Users\oracle\AppData\Local\Temp\tmp7ufxqzj3\wheels\a3\61\79\424ef897a2f3b14684a7de5d89e8600b460b89663e6ce9d17c
  Running setup.py bdist_wheel for pycparser ... done
  Stored in directory: C:\Users\oracle\AppData\Local\Temp\tmp7ufxqzj3\wheels\f2\9a\90\de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511
Successfully built retrying terminaltables arrow configparser pycparser
Installing collected packages: six, retrying, python-dateutil, certifi, pytz, cx-Oracle, jmespath, idna, pycparser, cffi, asn1crypto, cryptography, pyOpenSSL, configparser, oci, terminaltables, httpsig-cffi, arrow, click, oci-cli
Successfully installed arrow-0.10.0 asn1crypto-0.24.0 certifi-2018.11.29 cffi-1.11.5 click-6.7 configparser-3.5.0 cryptography-2.1.4 cx-Oracle-6.2.1 httpsig-cffi-15.0.0 idna-2.6 jmespath-0.9.3 oci-2.1.3 oci-cli-2.4.40 pyOpenSSL-17.5.0 pycparser-2.19 python-dateutil-2.7.3 pytz-2016.10 retrying-1.3.3 six-1.11.0 terminaltables-3.1.0

===> Modify PATH to include the CLI and enable tab completion in PowerShell now? (Y/n): Y
--
-- ** Close and re-open PowerShell to reload changes to your PATH **
-- In order to run the autocomplete script, you may also need to set your PowerShell execution policy to allow for running local scripts (as an Administrator run Set-ExecutionPolicy RemoteSigned in a PowerShell prompt)
--
-- Installation successful.
-- Run the CLI with C:\Users\oracle\bin\oci.exe --help
PS C:\WINDOWS\system32>


** 이 글은 개인으로서, 개인의 시간을 할애하여 작성된 글입니다. 글의 내용에 오류가 있을 수 있으며, 글 속의 의견은 개인적인 의견입니다. **
Last updated on 24 Dec 2018