How to install the OCI client in Windows

Paul Guerin
3 min readDec 7, 2020

While it is possible to operate your cloud tenancy within the browser-based cloud shell, there is another way without the browser.

The install takes place from Powershell inside a ‘Run as administrator’ session.

Start Powershell

Get a menu of options with a right-click on the Windows menu button.

Then select the ‘Windows Powershell (Admin)’ option.

Local configuration

From the session created, you need to configure the remote execution policy for PowerShell.

> Set-ExecutionPolicy RemoteSigned

Now download the installer script:

> Invoke-WebRequest https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1 -OutFile install.ps1

There is a brief flash of the session and then at the prompt run the installer script without prompts:

> install.ps1 -AcceptAllDefaults

If a suitable version of Python and Pip are already installed then the installation will continue.

As suggested, end the session and create a new one as it will have the new environment variable path.

Now configure your client with:

> oci setup config

You will be asked for 3 pieces of information:

  • User OCID: this information can be sourced from the Oracle cloud console. The user OCID will have a prefix of ocid1.user.oc1..
  • Tenancy OCID: again this information comes from the console and will have a prefix of ocid1.tenancy.oc1..
  • Region: The choices are : ap-chiyoda-1, ap-chuncheon-1, ap-hyderabad-1, ap-melbourne-1, ap-mumbai-1, ap-osaka-1, ap-seoul-1, ap-sydney-1, ap-tokyo-1, ca-montreal-1, ca-toronto-1, eu-amsterdam-1, eu-frankfurt-1, eu-zurich-1, me-dubai-1, me-jeddah-1, sa-santiago-1, sa-saopaulo-1, uk-cardiff-1, uk-gov-cardiff-1, uk-gov-london-1, uk-london-1, us-ashburn-1, us-gov-ashburn-1, us-gov-chicago-1, us-gov-phoenix-1, us-langley-1, us-luke-1, us-phoenix-1, us-sanjose-1.

You’ll then be prompted to load your public key to the console:

Cloud configuration

The cloud needs to know the public key of your tenancy, so this can be entered via your profile.

After entering your public key, you’ll be asked to verify that your local configuration file matches what OCI thinks it should be.

Enjoy!

Paul Guerin is an international consultant that specialises in Oracle database. Paul is based from a global delivery center in South East Asia, but has clients from Australia, Europe, Asia, and North America. Moreover, he has presented at some of the world’s leading Oracle conferences, including Oracle Open World 2013. Since 2015, his work has been featured in the IOUG Best Practices Tip Booklet, and in publications from AUSOUG, Oracle Technology Network, Quest, and Oracle Developers (Medium). In 2019, he was awarded as a most valued contributor for the My Oracle Support Community. He is a DBA OCP, and continues to be a participant of the Oracle ACE program.

--

--