Friday, December 10, 2021

OCI Cli

These steps are performed on OEL VMBox    Install python3: yum install -y python3*   [root@localhost bin]# ls -l python* lrwxrwxrwx. 1 root root 7 May 31 2019 python -> python2 lrwxrwxrwx. 1 root root 9 May 31 2019 python2 -> python2.7 -rwxr-xr-x. 1 root root 7216 Apr 9 2019 python2.7 lrwxrwxrwx. 1 root root 9 Mar 26 18:00 python3 -> python3.6 -rwxr-xr-x. 2 root root 11336 Aug 7 2019 python3.6 -rwxr-xr-x. 2 root root 11336 Aug 7 2019 python3.6m  [root@localhost bin]# ln -s -f python3 python [root@localhost bin]# ls -l python* lrwxrwxrwx. 1 root root 7 Mar 26 18:01 python -> python3 lrwxrwxrwx. 1 root root 9 May 31 2019 python2 -> python2.7 -rwxr-xr-x. 1 root root 7216 Apr 9 2019 python2.7 lrwxrwxrwx. 1 root root 9 Mar 26 18:00 python3 -> python3.6 -rwxr-xr-x. 2 root root 11336 Aug 7 2019 python3.6 -rwxr-xr-x. 2 root root 11336 Aug 7 2019 python3.6m [root@localhost bin]# python -V Python 3.6.8    This broke my "yum" so I had to revert back:   [root@localhost bin]# ls -l python* lrwxrwxrwx. 1 root root 7 Mar 26 18:01 python -> python3 lrwxrwxrwx. 1 root root 9 May 31 2019 python2 -> python2.7 -rwxr-xr-x. 1 root root 7216 Apr 9 2019 python2.7 lrwxrwxrwx. 1 root root 9 Mar 26 18:00 python3 -> python3.6 -rwxr-xr-x. 2 root root 11336 Aug 7 2019 python3.6 -rwxr-xr-x. 2 root root 11336 Aug 7 2019 python3.6m [root@localhost bin]# ln -s -f python2 python [root@localhost bin]# python -V Python 2.7.5    [oracle@localhost ~]$ bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 14620 100 14620 0 0 39270 0 --:--:-- --:--:-- --:--:-- 39407 ****************************************************************************** You have started the OCI CLI Installer in interactive mode. If you do not wish to run this in interactive mode, please include the --accept-all-defaults option. If you have the script locally and would like to know more about input options for this script, then you can run: ./install.sh -h If you would like to know more about input options for this script, refer to: https://github.com/oracle/oci-cli/blob/master/scripts/install/README.rst ****************************************************************************** Downloading Oracle Cloud Infrastructure CLI install script from https://raw.githubusercontent.com/oracle/oci-cli/v2.9.3/scripts/install/install.py to /tmp/oci_cli_install_tmp_ipBj. ######################################################################## 100.0% Running install script. python3 /tmp/oci_cli_install_tmp_ipBj -- Verifying Python version. -- Python version 3.6.8 okay. ===> In what directory would you like to place the install? (leave blank to use '/home/oracle/lib/oracle-cli'): -- Creating directory '/u01/userhome/oracle/lib/oracle-cli'. -- We will install at '/u01/userhome/oracle/lib/oracle-cli'. ===> In what directory would you like to place the 'oci' executable? (leave blank to use '/home/oracle/bin'): -- The executable will be in '/u01/userhome/oracle/bin'. ===> In what directory would you like to place the OCI scripts? (leave blank to use '/home/oracle/bin/oci-cli-scripts'): -- Creating directory '/u01/userhome/oracle/bin/oci-cli-scripts'. -- The scripts will be in '/u01/userhome/oracle/bin/oci-cli-scripts'. ===> Currently supported optional packages are: ['db (will install cx_Oracle)'] What optional CLI packages would you like to be installed (comma separated names; press enter if you don't need any optional packages)?: db -- The optional packages installed will be 'db'. -- Trying to use python3 venv. -- Executing: ['/usr/bin/python3', '-m', 'venv', '/u01/userhome/oracle/lib/oracle-cli'] -- Executing: ['/u01/userhome/oracle/lib/oracle-cli/bin/pip', 'install', '--upgrade', 'pip'] Collecting pip Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB) 100% |████████████████████████████████| 1.4MB 1.4MB/s Installing collected packages: pip Found existing installation: pip 9.0.3 Uninstalling pip-9.0.3: Successfully uninstalled pip-9.0.3 Successfully installed pip-20.0.2 -- Executing: ['/u01/userhome/oracle/lib/oracle-cli/bin/pip', 'install', '--cache-dir', '/tmp/tmpm_j8_sv_', 'wheel', '--upgrade'] Collecting wheel Downloading wheel-0.34.2-py2.py3-none-any.whl (26 kB) Installing collected packages: wheel Successfully installed wheel-0.34.2 -- Executing: ['/u01/userhome/oracle/lib/oracle-cli/bin/pip', 'install', '--cache-dir', '/tmp/tmpm_j8_sv_', 'oci_cli[db]', '--upgrade'] Collecting oci_cli[db] Downloading oci_cli-2.9.8-py2.py3-none-any.whl (7.5 MB) |████████████████████████████████| 7.5 MB 2.4 MB/s Collecting cryptography==2.8 Downloading cryptography-2.8-cp34-abi3-manylinux2010_x86_64.whl (2.3 MB) |████████████████████████████████| 2.3 MB 27.4 MB/s Collecting configparser>=4.0.2 Downloading configparser-5.0.0-py3-none-any.whl (22 kB) Collecting python-dateutil<3.0.0,>=2.5.3 Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB) |████████████████████████████████| 227 kB 44.6 MB/s Collecting pytz>=2016.10 Downloading pytz-2019.3-py2.py3-none-any.whl (509 kB) |████████████████████████████████| 509 kB 42.4 MB/s Collecting idna<2.7,>=2.5 Downloading idna-2.6-py2.py3-none-any.whl (56 kB) |████████████████████████████████| 56 kB 2.3 MB/s Collecting PyYAML==5.1.2 Downloading PyYAML-5.1.2.tar.gz (265 kB) |████████████████████████████████| 265 kB 36.8 MB/s Collecting jmespath==0.9.4 Downloading jmespath-0.9.4-py2.py3-none-any.whl (24 kB) Collecting oci==2.12.1 Downloading oci-2.12.1-py2.py3-none-any.whl (3.7 MB) |████████████████████████████████| 3.7 MB 41.7 MB/s Collecting arrow==0.14.7 Downloading arrow-0.14.7-py2.py3-none-any.whl (39 kB) Collecting certifi Downloading certifi-2019.11.28-py2.py3-none-any.whl (156 kB) |████████████████████████████████| 156 kB 62.2 MB/s Collecting retrying==1.3.3 Downloading retrying-1.3.3.tar.gz (10 kB) Collecting click==6.7 Downloading click-6.7-py2.py3-none-any.whl (71 kB) |████████████████████████████████| 71 kB 6.4 MB/s Collecting pyOpenSSL==18.0.0 Downloading pyOpenSSL-18.0.0-py2.py3-none-any.whl (53 kB) |████████████████████████████████| 53 kB 3.7 MB/s Collecting six==1.14.0 Downloading six-1.14.0-py2.py3-none-any.whl (10 kB) Collecting terminaltables==3.1.0 Downloading terminaltables-3.1.0.tar.gz (12 kB) Collecting cx-Oracle==7.0; extra == "db" Downloading cx_Oracle-7.0.0-cp36-cp36m-manylinux1_x86_64.whl (675 kB) |████████████████████████████████| 675 kB 54.6 MB/s Collecting cffi!=1.11.3,>=1.8 Downloading cffi-1.14.0-cp36-cp36m-manylinux1_x86_64.whl (399 kB) |████████████████████████████████| 399 kB 36.9 MB/s Collecting pycparser Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB) |████████████████████████████████| 112 kB 41.2 MB/s Building wheels for collected packages: PyYAML, retrying, terminaltables Building wheel for PyYAML (setup.py) ... done Created wheel for PyYAML: filename=PyYAML-5.1.2-cp36-cp36m-linux_x86_64.whl size=44104 sha256=8eadcc33892c992b1c071e8f0e7623945acebe5eece35299f4c448571ba05366 Stored in directory: /tmp/tmpm_j8_sv_/wheels/d8/9b/e7/75af463b873c119dd444151fc54a8e190c87993593e1fa194a Building wheel for retrying (setup.py) ... done Created wheel for retrying: filename=retrying-1.3.3-py3-none-any.whl size=11430 sha256=72069b956abf995176390aa9a39d594c55523244a38da0942e45a9a787118746 Stored in directory: /tmp/tmpm_j8_sv_/wheels/ac/cb/8a/b27bf6323e2f4c462dcbf77d70b7c5e7868a7fbe12871770cf Building wheel for terminaltables (setup.py) ... done Created wheel for terminaltables: filename=terminaltables-3.1.0-py3-none-any.whl size=15354 sha256=3b6260fbdb92de3b45d625b05bca4eace5de000e9b55f36badabb9d90c3a0a8f Stored in directory: /tmp/tmpm_j8_sv_/wheels/86/1b/58/c23af2fe683acd8edc15d5a1268f0242be1ff2cf827fe34737 Successfully built PyYAML retrying terminaltables ERROR: oci 2.12.1 has requirement configparser==4.0.2, but you'll have configparser 5.0.0 which is incompatible. Installing collected packages: six, pycparser, cffi, cryptography, configparser, python-dateutil, pytz, idna, PyYAML, jmespath, pyOpenSSL, certifi, oci, arrow, retrying, click, terminaltables, cx-Oracle, oci-cli Successfully installed PyYAML-5.1.2 arrow-0.14.7 certifi-2019.11.28 cffi-1.14.0 click-6.7 configparser-5.0.0 cryptography-2.8 cx-Oracle-7.0.0 idna-2.6 jmespath-0.9.4 oci-2.12.1 oci-cli-2.9.8 pyOpenSSL-18.0.0 pycparser-2.20 python-dateutil-2.8.1 pytz-2019.3 retrying-1.3.3 six-1.14.0 terminaltables-3.1.0 ===> Modify profile to update your $PATH and enable shell/tab completion now? (Y/n): Y ===> Enter a path to an rc file to update (leave blank to use '/home/oracle/.bashrc'): -- Backed up '/u01/userhome/oracle/.bashrc' to '/u01/userhome/oracle/.bashrc.backup' -- Tab completion set up complete. -- If tab completion is not activated, verify that '/u01/userhome/oracle/.bashrc' is sourced by your shell. -- -- ** WARNING: Other 'oci' executables are on your $PATH. ** -- Conflicting paths: /home/oracle/bin/oci, /home/oracle/bin/oci, /home/oracle/bin/oci, /home/oracle/bin/oci -- You can run this installation of the CLI with '/u01/userhome/oracle/bin/oci'. -- -- ** Run `exec -l $SHELL` to restart your shell. ** -- -- Installation successful. -- Run the CLI with /u01/userhome/oracle/bin/oci --help [oracle@localhost ~]$