title | date | parent | toc | author | tags | categories | thumbnail | published | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Oracle Cloud Shell: Connect an Autonomous Data Warehouse Database |
2021-12-08 12:00 |
|
true |
|
|
|
assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B18.28.42.png |
false |
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B18.28.42.png %}
Oracle Cloud Infrastructure (OCI) Cloud Shell is a browser-based terminal accessible from the Oracle Cloud Console. It is free to use and provides access to a Linux shell. Oracle announced Oracle Cloud Shell on Feburary 11, 2020. It contains a pre-authenticated OCI command line interface and a lot of other useful tools to perform OCI-related tasks.
Cloud Shell available to all OCI users. It appears in the persistent frame of the console and will stay active while navigating to different pages of the console.
Cloud Shell provides an ephemeral machine which lasts for a short time. It acts as a host for a Linux shell with a pre-configured version of the OCI command line interface and a number of useful tools. Cloud Shell provides 5 GB of storage for your home directory, and all the files there will persist through a reboot. The administrator of your Cloud will receive notifications that the storage will be removed in 60 days if the Cloud Shell is not used for 6-months.
The resource name for Cloud Shell is cloud-shell
. The IAM Policy required to access Cloud Shell will be something like:
allow group <group name> to use cloud-shell in tenancy
For more details about Cloud Shell Please visit link below.
-
On the top right corner of the console you will see the icon for OCI Cloud Shell. Click on it to access OCI Cloud Shell.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B09.21.40.png %}
-
At the bottom of the OCI cloud console page, a new persistent frame will be visible. If you are using Cloud Shell for the first time, it will take few minutes to start.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B09.22.00.png %}
-
The second time it will be quicker to load. It is just provisioning a VM and attaching and mounting the storage to the home directory.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B18.49.31.png %}
-
Once Cloud Shell is connected, it looks something like this:
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B09.24.12.png %}
-
Available buttons in Cloud Shell:
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B20.03.31.png %}
-
I read the redhat-release file and noticed operating system is RHEL 7.8:
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B09.25.14.png %}
-
Checked disk details with df command and found home is 5 GB in size:
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B09.25.27.png %}
-
Checked location of utilities:
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B09.29.48.png %}
- Git
- Java
- Python (2 and 3)
- SQL Plus
- kubectl
- helm
- maven
- gradle
- terraform
- ansible
-
Open Oracle Cloud Console. Click on Create an ADW database on the Quick Actions page.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B18.40.44.png %}
-
Provide the name of the Autonomous Database.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B18.42.39.png %}
-
Scroll down and provide Admin user password. Click on Create Autonomous Database.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B18.44.43.png %}
-
Note that ADW is in the PROVISIONING state.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B18.45.04.png %}
-
Once provisioning is complete, the status will change to available. Click on the DB Connection button.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B18.47.22.png %}
-
Click on Download Wallet button.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B18.47.37.png %}
-
Provide the wallet login password and click on Download.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B18.48.16.png %}
Create Object Storage to temporarily upload the wallet and download to OCI Cloud Shell.
-
Click on the Navigation menu. Click on Object Storage.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.05.45.png %}
-
Click on Create Bucket.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.07.39.png %}
-
Provide the name of the bucket.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.08.11.png %}
-
Click the Create Bucket button to create the bucket.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.08.21.png %}
-
Upload wallet file to the bucket.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.09.14.png %}
-
Click on three vertical dots at the right and click on Create Pre-Authenticated Request.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.10.25.png %}
-
Provide the name of the Pre-Authenticated Request and click Create Pre-Authenticated Request.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.10.44.png %}
-
Copy Pre-Authenticated request URL.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.10.57.png %}
-
Go to Cloud Shell and download the wallet with the
wget
command.{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.11.25.png %}
-
It looks something like below once the wallet is downloaded.
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.11.46.png %}
-
Create a directory to store wallet files. Move wallet files to the directory and extract it.
mkdir -p network/admin mv Wallet_cstest.zip network/admin cd network/admin unzip Wallet_cstest.zip
{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.13.49.png %}
-
Open the
sqlnet.ora
file and modify the Directory value to the directory location where wallet files are located.{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.20.21.png %}
-
Connect to the ADW database using
sqlplus <username>@<tnsnames>
.{% imgx assets/oci-cloud-shell-connect-adw-Screen%2BShot%2B2020-09-30%2Bat%2B19.20.38.png %}