Shutdown and Startup Exadata

This article covers the scenario for graceful shutdown and startup Exadata and Oracle Databases.

#################
Shutdown Sequence
#################

[0] Firstly check all Database and Cluster resources, which resources are online which was offline.

[1] Shutdown database(s) safely as follows.

$ srvctl stop database -d DB_NAME

[2] If all databases and their instances shutdown, then stop Cluster Resources as follows. Firstly Set Grid Infrastructure Profile, then stop all resources.

$crsctl stop cluster -all

Or

You can stop CRS on each database server node as follows.

$ crsctl stop crs

[3] Shutdown all Cell Servers.

You can shutdown all Cell Servers on Database server as follows.

$dcli -g cell_group -l root "su - celladmin -c \"cellcli -e alter cell shutdown services all \""

Or

you can shutdown each cell server one by one as follows. Before shutdown it, check its services as follows.

#service celld status
#service celld stop

Do this step for all Cell servers one by one.

[4] Shutdown Cell Servers.

You can shutdown them with one command from database server as follows.

$dcli -g cell_group -l root poweroff

or

you can shutdown them one by one on related cell server.
# shutdown -h -y now

[5] Shutdown all Database Servers as follows.

shutdown -h -y now
or
poweroff

If all ssh connections are down, then check the Exadata lights if they are on or off.

##################
Startup Sequence
##################

[6] Once exadata has been offline, you can startup it by clicking the power button on the front panel of the Exadata Storage Servers and Database servers.

When the Storage servers and database servers’ light are on, then it will startup in a 10 minutes.

You can startup cell servers from Database server using the following command.

for host in `cat cell_group`; do
echo ${host}: `ipmitool -H ${host}-ilom -U root -P welcome1 chassis power on`
done

You can also startup exadata by using ILOM.

[7] Check all Cell Servers if they are online or not.

$dcli -g cell_group -l root 'hostname; uptime'
$dcli -g cell_group -l root "su - celladmin -c \"cellcli -e list cell detail \""

[8] If Cell servers are online, then check the Database Servers.

Normall all CRS services should be startup automatically.
But check it as follows on each database server.

crsctl status res -t
ps -ef | grep smon

[9] If Cluster and database services are not startup automatically, then startup them as follows.

crsctl start cluster -all

[10] If Databases are not up, then Startup database(s) as follows.

$ srvctl start database -d DB_NAME

Now All Exadata and database services are up, you can use them safely.

Refer to MOS Doc ID 1093890.1 for detailed steps.
Steps To Shutdown/Startup The Exadata & RDBMS Services and Cell/Compute Nodes On An Exadata Configuration (Doc ID 1093890.1)

Thank you for visiting this blog 🙂

Upgrading and Patching Exadata to 18c and 19c

Special thanks to Oracle ACE Fred Denis for sharing his experience https://unknowndba.blogspot.com/

I would like to share my experience in this article which covers the modified and latest scenarios and hands-on for upgrade and patching the On-premises Exadata to 18c and 19c.

The Exadata Quarterly Full Stack Download Patch (QFSDP) is the recommended way to upgrade all Exadata components. It will be released on a quarterly.

QFSDP releases contain the latest software for the following components:

Infrastructure
  • Exadata Storage Server
  • InfiniBand Switch
  • Power Distribution Unit
Database
  • Oracle Database and Grid Infrastructure PSU
  • Oracle JavaVM PSU (as of Oct 2014)
  • OPatch
  • OPlan
Systems Management
  • EM Agent
  • EM OMS
  • EM Plug-ins
First, refer to the Oracle MOS Document ID 888828.1 and download the QFSDP Patch.
The Preview of this patching with the order and the tools we will be using

0. An advice
1. General Information
2. Some prerequisites it is worth doing before the maintenance
2.1 Download and unzip the Bundle
2.2 Download the latest patchmgr
2.3 SSH keys
2.4 Upgrade opatch
2.5 Run the prechecks
2.5.1 Cell patching prechecks
2.5.2 Check disk_repair_time
2.5.3 DB Nodes prechecks
2.5.4 Dependencies issues
2.5.5 IB Switches prechecks
2.5.6 ROCE Switches prechecks
2.5.7 Grid Infrastructure prechecks

3 The patching procedure
3.1 Patching the cells (aka Storage servers)
3.2 Patching the IB switches
3.2.roce/ Patching the ROCE switches
3.3 Patching the Database servers (aka Compute Nodes)
3.4 Patching the Grid Infrastructure
3.5 Upgrading the Grid Infrastructure:
3.5.1 Upgrade Grid Infrastructure to 12.2
3.5.2 Upgrade Grid Infrastructure to 18c
3.6 Upgrading the Cisco Switch / enabling SSH access to the Cisco Switch
4 The Rollback procedure
4.1 Cell Rollback
4.2 DB nodes Rollback
4.3 IB Switches Rollback
5 Troubleshooting
How to take an ILOM snapshot with the command line
How to reboot a database server using its ILOM (same procedure applies for a storage server)
How to manually reboot an Infiniband Switch
Restart SSH on a storage cell with no SSH access
How to re-image an Exadata database server
How to re-image an Exadata cell storage server
. . . more to come . . .
6/ Timing

0. An advice


Exadata Patching Overview and Patch Testing Guidelines (Doc ID 1262380.1)

Do NOT continue to the next step before a failed step is properly resolved.

It is supported to run different Exadata versions between servers. 
For example, some storage servers may run 11.2.2.4.2 while others run 
11.2.3.1.1, or all storage servers may run 11.2.3.1.1 while database servers 
run 11.2.2.4.2. However, it is highly recommended that this be only a temporary 
configuration that exists for the purpose and duration of rolling upgrade.

1. General Information

Please find some information you need to know before starting to patch your Exadata :

  • There is no difference in the procedure whether you patch a 12.1 Exadata, a 12.2 Exadata or you upgrade an Exadata to 18c (18c is a patchset of 12.2); the examples of this blog are from recent maintenance to upgrade an Exadata to 18c
  • It is better to have a basic understanding of what is an Exadata before jumping in this patch procedure
  • This procedure does not apply to an ODA (Oracle Database Appliance)
  • I will use the /Oct2018_Bundle FS to save the Bundle in the examples of this blog
  • I use the “DB node” term here, it means “database node“, aka “Compute node“; the nodes where the Grid Infrastructure and the database are running, I will also use the db01 term for the database node number 1, usually named “cluster_name” db01
  • I use the “cell” word aka “storage servers“, the servers that manage your storage. I will also use cel01 for the storage server number 1, usually named “cluster_name”cel01
  • It is good to have the screen utility installed; if not, use nohup
  • Almost all the procedure will be executed as root
  • I will be patching the IB Switches from the DB node 1 server
  • I will be patching the cells from the DB node 1 server
  • I will be patching the DB nodes from the cel01 server
  • I will not cover the databases Homes as there is nothing specific to Exadata here
  • I will be using the rac-status.sh script to easily check the status of the resources of the Exadata as well as easily follow the patch progress
  • I will be using the exa-versions.sh script to easily check the versions of the Exadata components
  • I will be using the cell-status.sh script to easily check the status of the cell and grid disks of the storage servers

2. Some prerequisites it is worth doing before the maintenance

I highly recommend executing these prerequisites as early as possible. The sooner you discover an issue in these prerequisites, the better.

1. Verify the $TMOUT

echo $TMOUT
14400

This value is approximately 4 hours.

2. Confirm the connectivity to ilom
#ssh root@myclusterdb01-ilom
#ssh root@myclusterdb02-ilom
#ssh root@myclusterdb03-ilom
#ssh root@myclusterdb04-ilom

#ssh root@myclustercel01-ilom
........
#ssh root@myclustercel07-ilom

Note: Provide the password and confirm the connectivity with ilom.

3. Verify cells

#dcli -l root -g cell_group cellcli -e 'list physicaldisk attributes luns where physicalInsertTime = null'

#cat cell_group
myclustercel01-ilom
.....
myclustercel07-ilom

#dcli -l root -g cell_group cellcli -e list griddisk attributes name,status,asmmodestatus,asmdeactivationoutcome

Note: Output should be
active ONLINE Yes

4. Verify configuration

#dcli -l root -g cell_group /opt/oracle.cellos/ipconf -verify

5. ofa rpm

dcli -l root -g cell_group "rpm -qa | grep ofa"

6. Check ASM Instance and ensure that diskgroup are mounted.

sqlplus / as sysdba
select inst_id,name,state from gv$asm_diskgroup group by inst_id,name,state;

2.1 Download and unzip the Bundle

Review the Exadata general note (Exadata Database Machine and Exadata Storage Server Supported Versions (Doc ID 888828.1)) to find the latest Bundle, download it and unzip it; be sure that every directory is owned by oracle:dba to avoid any issue in the future :

The latest available Patch 31754150 – Quarterly Full Stack Download For Oracle Exadata (QFSDP) July 2020

for I in `ls p31754150_190000_Linux-x86-64*f10.zip`
cat *.tar.* | tar -xvf –

It will make a single directory with patch number called 31754150

Inside the 31754150 directory you will get the following directories

Note: you can use unzip -q to make unzip silent

It contained patches for following stacks
Database/Clusterware
Database Server
Storage Server
Infiniband
PDUs

2.2 Download the latest patchmgr

patchmgr is the orchestation tool who will perform most of the job here. Its version can change quite often so I recommend double checking that the version shipped with the Bundle is the latest one:

-- patchmgr is in the below directory :
/FileSystem/Bundle_patch_number/Infrastructure/SoftwareMaintenanceTools/DBServerPatch/Version
Example for the July 2020 PSU :
/July2020_Bundle/31754150/Infrastructure/SoftwareMaintenanceTools/DBServerPatch/19.181002/p21634633_181800_Linux-x86-64.zip
-- Patchmgr is delivered on Metalink through this patch:
Patch 21634633: DBSERVER.PATCH.ZIP ORCHESTRATOR PLUS DBNU - ARU PLACEHOLDER

— Download the latest patchmgr version and replace it in the Bundle directory
Example

2.3 SSH keys

For this step, if you are not confident with the dbs_groupcell_group, etc… files, here is how to create them as I have described it in this post (look for “dbs_group” in the post).
[root@myclusterdb01 ~]# ibhosts | sed s'/"//' | grep db | awk '{print $6}' | sort > /root/dbs_group
[root@myclusterdb01 ~]# ibhosts | sed s'/"//' | grep cel | awk '{print $6}' | sort > /root/cell_group
[root@myclusterdb01 ~]# cat /root/dbs_group ~/cell_group > /root/all_group
[root@myclusterdb01 ~]# ibswitches | awk '{print $10}' | sort > /root/ib_group

We would need a few SSH keys deployed in order to ease the patches application :
root ssh keys deployed from the db01 server to the IB Switches (you will have to enter the root password once for each IB Switch)

[root@myclusterdb01 ~]# cat ~/ib_group
myclustersw-ib2
myclustersw-ib3
[root@myclusterdb01 ~]# dcli -g ~/ib_group -l root -k -s '-o StrictHostKeyChecking=no'
root@myclustersw-ib3's password:
root@myclustersw-ib2's password:
myclustersw-ib2: ssh key added
myclustersw-ib3: ssh key added
[root@myclusterdb01 ~]#

root ssh keys deployed from the cel01 server to all the database nodes (you will have to enter the root password once for each database server)

[root@myclustercel01 ~]# cat ~/dbs_group
myclusterdb01
myclusterdb02
myclusterdb03
myclusterdb04
[root@myclustercel01 ~]# dcli -g ~/dbs_group -l root -k -s '-o StrictHostKeyChecking=no'
root@myclusterdb01's password:
root@myclusterdb03's password:
root@myclusterdb04's password:
root@myclusterdb02's password:
myclusterdb01: ssh key added
myclusterdb02: ssh key added
myclusterdb03: ssh key added
myclusterdb04: ssh key added
[root@myclustercel01 ~]#

root ssh keys deployed from the db01 server to all the cells (you will have to enter the root password once for each cell)

[root@myclusterdb01 ~]# dcli -g ~/cell_group -l root hostname
myclustercel01: myclustercel01.mydomain.com
myclustercel02: myclustercel02.mydomain.com
myclustercel03: myclustercel03.mydomain.com
myclustercel04: myclustercel04.mydomain.com
[root@myclusterdb01 ~]# dcli -g ~/cell_group -l root -k -s '-o StrictHostKeyChecking=no'
root@myclustercel04's password:
...
root@myclustercel03's password:
myclustercel01: ssh key added
...
myclustercel06: ssh key added
[root@myclusterdb01 ~]#

2.4 Upgrade opatch

It is highly recommended to upgrade opatch before any patching activity and this Bundle is not an exception. Please find a detailled procedure to quickly upgrade opatch with dcli in this post.
Please note that upgrading opatch will also allow you to be ocm.rsp-free !

[grid@myclusterdb01 ~]$ dcli -g ~/dbs_group -l grid /u01/app/12.1.0.2/grid/OPatch/opatch version | grep Version
[grid@myclusterdb01 ~]$ dcli -g ~/dbs_group -l grid -f /Oct2018_Bundle/28183368/Database/OPatch/12.2/12.2.0.1.*/p6880880_12*_Linux-x86-64.zip -d /tmp
[grid@myclusterdb01 ~]$ dcli -g ~/dbs_group -l grid "unzip -o /tmp/p6880880_12*_Linux-x86-64.zip -d /u01/app/12.1.0.2/grid; /u01/app/12.1.0.2/grid/OPatch/opatch version; rm /tmp/p6880880_12*_Linux-x86-64.zip" | grep Version

2.5 Run the prechecks

It is very important to run those prechecks and take good care of the outputs. They have to be 100% successful to ensure a smooth application of the patches.

2.5.1 Cell patching prechecks

First of all, you’ll have to unzip the patch:

[root@myclusterdb01 ~]# cd /Oct2018_Bundle/28689205/Infrastructure/18.1.9.0.0/ExadataStorageServer_InfiniBandSwitch
[root@myclusterdb01 ~]# unzip -q p28633752_*_Linux-x86-64.zip

— This should create a patch_18.1.9.0.0.181006 directory with the cell patch
And start the prerequisites from database node 1:

[root@myclusterdb01 ~]# cd /Oct2018_Bundle/28689205/Infrastructure/18.1.9.0.0/ExadataStorageServer_InfiniBandSwitch/patch_18.1.9.0.0.181006
[root@myclusterdb01 ~]# ./patchmgr -cells ~/cell_group -patch_check_prereq -rolling

2.5.2 Check disk_repair_time

You have to be aware and understand this parameter. Indeed, disk_repair_time specifies the amount of time before ASM drops a disk after it is taken offline — the default for this parameter is 3.6h.
Oracle recommends to set this parameter to 8h when patching a cell. But as we will see in the cell patching logs, patchmgr‘s timeout for this operation is 600 minutes (then 10 hours) and as I had issues in the past with a very long cell patching, I now use to set this parameter to 24h as Oracle has recommended when I faced very long cell patching. I would then recommend anyone to set it to 24h when patching — this is what I will describe in the cell patchingh procedure. We will just have a look at the value of the parameter for awareness here.
Please note that this prerequisite is only needed for a rolling patch application.

SQL> select dg.name as diskgroup, a.name as attribute, a.value 
from v$asm_diskgroup dg, v$asm_attribute a 
where dg.group_number=a.group_number 
and (a.name like '%repair_time' or a.name = 'compatible.asm');

DISKGROUP          ATTRIBUTE              VALUE
---------------- ----------------------- ----------------------------------------
DATA             disk_repair_time         3.6h
DATA             compatible.asm           11.2.0.2.0
DBFS_DG          disk_repair_time         3.6h
DBFS_DG          compatible.asm           11.2.0.2.0
RECO             disk_repair_time         3.6h
RECO             compatible.asm           11.2.0.2.0

6 rows selected.

2.5.3 DB Nodes prechecks

As we cannot patch a node we are connected to, we will start the patch from a cell server (myclustercel01). To be able to do that, we first need to copy patchmgr and the ISO file on this cell server. Do NOT unzip the ISO file, patchmgr will take care of it.

I create a /tmp/SAVE directory to patch the database servers. Having a SAVE directory in /tmp is a good idea to avoid the automatic maintenance jobs that purge /tmp every day (directories > 5 MB and older than 1 day). If not, these maintenance jobs will delete the dbnodeupdate.zip file that is mandatory to apply the patch — this won’t survive a reboot though.

[root@myclusterdb01 ~]# ssh root@myclustercel01 rm -fr /tmp/SAVE
[root@myclusterdb01 ~]# ssh root@myclustercel01 mkdir /tmp/SAVE
[root@myclusterdb01 ~]# scp /Oct2018_Bundle/28689205/Infrastructure/SoftwareMaintenanceTools/DBServerPatch/19.181002/p21634633_*_Linux-x86-64.zip root@myclustercel01:/tmp/SAVE/.
[root@myclusterdb01 ~]# scp /Oct2018_Bundle/28689205/Infrastructure/18.1.9.0.0/ExadataDatabaseServer_OL6/p28666206_*_Linux-x86-64.zip root@myclustercel01:/tmp/SAVE/.
[root@myclusterdb01 ~]# scp ~/dbs_group root@myclustercel01:~/.
[root@myclusterdb01 ~]# ssh root@myclustercel01
[root@myclustercel01 ~]# cd /tmp/SAVE
[root@myclustercel01 ~]# unzip -q p21634633_*_Linux-x86-64.zip

This should create a dbserver_patch_5.180720 directory (the name may be slightly different if you use a different patchmgr than the one shipped with the Bundle)
And start the prerequisites:

[root@myclustercel01 ~]# cd /tmp/SAVE/dbserver_patch_*
[root@myclustercel01 ~]# ./patchmgr -dbnodes ~/dbs_group -precheck  
-iso_repo /tmp/SAVE/p28666206_*_Linux-x86-64.zip -target_version 18.1.9.0.0.181006 
-allow_active_network_mounts

— You can safely ignore the below warning (this is a patchmgr bug for a while) if the GI version is > 11.2.0.2 — which is most likely the case
(*) – Yum rolling update requires fix for 11768055 when Grid Infrastructure is below 11.2.0.2 BP12
Note : if your source version is > 12.1.2.1.1, you can use the -allow_active_network_mounts parameter to be able to patch all the DB nodes without taking care of the NFS. In the opposite, if you have some NFS mounted, you will have some error messages, you can ignore them at this stage, we will umount the NFS manually before patching the DB nodes

2.5.4 Dependencies issues

You may have dependencies issues reported by the database servers pre-requisites. I have documented the 2 cases you can be in and the 2 ways you can fix this:

  • When there is no OS upgrade, follow this blog.
  • When there is an OS upgrade (from 12c or 18c to 19c or above), please have a look at this blog

2.5.5 IB Switches prechecks

– To avoid issues with NFS/ZFS when rebooting the IB Switches (I got a lot in the past, not sure if it came from the client configuration but it is always unpleasant), I recommend copying the patch outside of any NFS/ZFS
– This patch is ~ 2.5 GB so be careful not to fill / if you copy it into /tmp, if not, choose another local FS

[root@myclusterdb01 ~]# du -sh /tmp/IB_PATCHING
[root@myclusterdb01 ~]# rm -fr /tmp/IB_PATCHING
[root@myclusterdb01 ~]# mkdir /tmp/IB_PATCHING
[root@myclusterdb01 ~]# unzip -q /Oct2018_Bundle/28689205/Infrastructure/18.1.9.0.0/ExadataStorageServer_InfiniBandSwitch/p28633752_*_Linux-x86-64.zip -d /tmp/IB_PATCHING
[root@myclusterdb01 ~]# cd /tmp/IB_PATCHING/patch_18.1.9.0.0.181006
[root@myclusterdb01 ~]# ./patchmgr -ibswitches ~/ib_group -ibswitch_precheck -upgrade

Note: despite what patchmgr documentation says, you have to specify an ib_group configuration file containing the list of your IB Switches
If the pre requisites show some conflicts to be resolved, please have a look at this blog where I explain how to manage the OS dependencies issues but do NOT use the -modify_at_prereq option straight away.

2.5.6 ROCE Switches prechecks

– As explained here, we will use an OS user admin to be able to run the pre-requisites (this is fixed from July 2020 and can be run as root from July 2020):

 [admin@x8m_01]$ pwd
/patches/APR2020/30783929/Infrastructure/19.3.7.0.0/ExadataStorageServer_InfiniBandSwitch/patch_19.3.7.0.0.200428
[admin@x8m_01]$ ./patchmgr --roceswitches ~/roce_group --upgrade --roceswitch-precheck --log_dir /tmp

2.5.7 Grid Infrastructure prechecks

To start with, be sure that the patch has been unzipped (as the GI owner user to avoid any further permission issue):

[grid@myclusterdb01 ~]$ cd /Oct2018_Bundle/28689205/Database/12.2.0.1.0/12.2.0.1.181016GIRU
[grid@myclusterdb01 ~]$ unzip -q p28714316*_Linux-x86-64.zip

— This should create a 27968010 directory.
And start the prerequisites on each node:

[root@myclusterdb01 ~]# . oraenv <<< `grep "^+ASM" /etc/oratab | awk -F ":" '{print $1}'`
[root@myclusterdb01 ~]# cd /Oct2018_Bundle/28689205/Database/12.2.0.1.0/12.2.0.1.181016GIRU/28714316
[root@myclusterdb01 ~]# /u01/app/12.1.0.2/grid/OPatch/opatchauto apply -oh /u01/app/12.1.0.2/grid -analyze

Alternatively, you can start the GI prerequisites on all nodes in parallel in one command

[root@myclusterdb01 ~]# dcli -g ~/dbs_group -l root "cd /Oct2018_Bundle/28689205/Database/12.2.0.1.0/12.2.0.1.181016GIRU/28714316; /u01/app/12.1.0.2/grid/OPatch/opatchauto apply -oh /u01/app/12.1.0.2/grid -analyze"

Note: You will most likely see some warnings here, check the logfiles and they will probably be due to some patches that will be rolled back as they will not be useful any more.

Now that everything is downloaded, unzipped, updated, and that every prerequisite is successful, we can safely jump to the patching procedure in part 2!

Thank you for visiting this blog 🙂

Preparation for Exam : Oracle 19c OCP

My OCP journey started from 9i,10g,11g,12c,12c R2,

Now I’m certified in 19c OCP, Oracle Database Administration 2019 Certified Professional

Exam Number# 
https://education.oracle.com/oracle-database-administration-ii/pexam_1Z0-083

Prior Certification Requirements : 1Z0-082 or 10g / 11g / 12c / 12c R2 OCP Certified

Study guide – Most Important for Exam
https://oracle.com/a/ocom/docs/dc/ww-ou-5297-database2019-studyguide-5.pdf

The Exam contains 85 questions related to Oracle Database 18c & 19c. To earn this certification you need to get 57% marks. Even with a low passing score, it is the toughest OCP exam I had ever.

Oracle University Recommendations

• Oracle Database: Deploy, Patch and Upgrade Workshop
• Oracle Database: Backup and Recovery Workshop
• Oracle Database: Managing Multitenant Architecture
• Oracle Database Administration: Workshop
• Oracle Database 19c: New Features for Administrators
• Oracle Database 18c: New Features for Administrators (for 10g and 11g OCAs and OCPs)
• Oracle Database 12c R2: New Features for 12c R1 Administrators (12c R1 OCAs and OCPs)
• Oracle Database 11g: New Features for Administrators (for 10g OCAs and OCPs)

OU Learning Subscription
https://learn.oracle.com/ols/learning-path/oracle-database-administrator/38560/54112

19c Database Administrator’s Guide
https://docs.oracle.com/en/database/oracle/oracle-database/19/admin/

Oracle® Multitenant Administrator’s Guide
https://docs.oracle.com/en/database/oracle/oracle-database/19/multi/index.html

Backup and Recovery User’s Guide
https://docs.oracle.com/en/database/oracle/oracle-database/19/bradv/index.html

19c New Features
https://docs.oracle.com/en/database/oracle/oracle-database/19/newft/new-features.html
https://docs.oracle.com/en/database/oracle/oracle-database/18/newft/new-features.html

Oracle19c Documentation
https://docs.oracle.com/en/database/oracle/oracle-database/19/index.html

I shared some of the important notes at https://twitter.com/oraclelearn

https://www.youracclaim.com/badges/f2dc6809-79e8-4fdf-b6af-9905021b46f2

Thank you for visiting this blog 🙂

 

Preparation for Exam : Oracle Cloud Infrastructure Architect Professional

I would like to share my learning experience with Oracle Cloud Infrastructure, It took 6 months to prepare for OCI-P Exam.

Thank you Oracle University for providing a great free learning opportunity

This article covers useful tips and important URLs related to OCI-P Exam.

[1]  Candidate must have one of the following certifications.
Oracle Cloud Infrastructure 2018|2019|2020 Certified Architect Associate

[2] Register for the OCI free tier

Spend enough time for OCI HandsOn on Oracle Cloud free tier and always free tier.

[3] OCI-P Exam Preparation Session.

[4] OCI-P Study Guide

[5] Oracle University Free Training to Become OCI Architect Professional
Oracle Cloud Infrastructure 2019|2020 Architect Professional

[6] OCI Sessions recordings

[7] Oracle Cloud Infrastructure Documentation
https://docs.cloud.oracle.com/pdf/gsg/OCI_Getting_Started.pdf
https://docs.cloud.oracle.com/pdf/ug/OCI_User_Guide.pdf
https://docs.cloud.oracle.com/en-us/iaas/Content/General/Reference/aqswhitepapers.htm

[8] My Personal Study Materials (Tips / FAQs / Screen Captured Material during OU. training and documentation)

[9] Register the OCI-P Exam.

[10] OCI-P Badges

Oracle Cloud Infrastructure 2019 Certified Architect Professional

[11] OCI-P Certification

Thank you for visiting this blog 🙂

Launch OCI free tier ATP and ADW using Terraform on Window platform

Terraform template available at GitHub will not work directly with OCI free tier ADB database service. You have to adjust some parameter inside the Terraform template to make it compatible with free tier ADB services.

We will Launch two ADB databases one for the ATP database and one for the ADW database using a single command then we will play with ADB using OCI CLI and then finally we will destroy the created infrastructure using a single command.

Download the terraform for window10.
https://releases.hashicorp.com/terraform/0.12.19/terraform_0.12.19_windows_amd64.zip

Installation Steps
copy the downloads for windows version.
copy inside program file and configure windows path variable

 

 

C:\Users\oracle-learn>terraform
Usage: terraform [-version] [-help] <command> [args]

The available commands for execution are listed below.
The most common, useful commands are shown first, followed by
less common or more advanced commands. If you're just getting
started with Terraform, stick with the common commands. For the
other commands, please read the help and docs before usage.

Common commands:
apply Builds or changes infrastructure
console Interactive console for Terraform interpolations
destroy Destroy Terraform-managed infrastructure
env Workspace management
fmt Rewrites config files to canonical format
get Download and install modules for the configuration
graph Create a visual graph of Terraform resources
import Import existing infrastructure into Terraform
init Initialize a Terraform working directory
output Read an output from a state file
plan Generate and show an execution plan
providers Prints a tree of the providers used in the configuration
refresh Update local state file against real resources
show Inspect Terraform state or plan
taint Manually mark a resource for recreation
untaint Manually unmark a resource as tainted
validate Validates the Terraform files
version Prints the Terraform version
workspace Workspace management

All other commands:
0.12upgrade Rewrites pre-0.12 module source code for v0.12
debug Debug output management (experimental)
force-unlock Manually unlock the terraform state
push Obsolete command for Terraform Enterprise legacy (v1)
state Advanced state management

C:\Users\oracle-learn>

C:\Users\oracle-learn>terraform --version
Terraform v0.12.18

Prepare the Environment.

oracle-learn MINGW64 ~/projects/adb (master)
$ cat .profile
#Terraform
export TF_VAR_tenancy_ocid=ocid1.tenancy.oc1..xyz
export TF_VAR_user_ocid=ocid1.user.oc1..pqr
export TF_VAR_fingerprint=
export TF_VAR_region=ap-mumbai-1
export TF_VAR_private_key_path=<path/oci_api_key.pem>
export TF_VAR_private_key_password={put-here-the-private-key-password}
export TF_VAR_compartment_ocid=ocid1.compartment.oc1..cid

You may refer OCI Documentation to find these variable values.

 

$ cat provider.tf
// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.

provider "oci" {
  tenancy_ocid     = "${var.tenancy_ocid}"
  user_ocid        = "${var.user_ocid}"
  fingerprint      = "${var.fingerprint}"
  private_key_path = "${var.private_key_path}"
  region           = "${var.region}"
}

provider "local" {
  version = ">=1.3.0" # Need this version of the local provider to support base64 encoded inputs
}
$ cat variables.tf
// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.

variable "tenancy_ocid" {}
variable "user_ocid" {}
variable "fingerprint" {}
variable "private_key_path" {}
variable "region" {}
variable "compartment_ocid" {}

variable "autonomous_database_db_workload" {
  default = "OLTP"
}

variable "autonomous_data_warehouse_db_workload" {
  default = "DW"
}

variable "autonomous_database_defined_tags_value" {
  default = "value"
}

variable "autonomous_database_freeform_tags" {
  default = {
    "Department" = "Finance"
  }
}

variable "autonomous_database_license_model" {
  default = "LICENSE_INCLUDED"
}

variable "autonomous_database_is_dedicated" {
  default = false
}

I have modified the template accordingly for the free tier template available at GitHub

$ cat autonomous_database_wallet.tf
// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.

resource "random_string" "autonomous_database_wallet_password" {
  length  = 16
  special = true
}

data "oci_database_autonomous_database_wallet" "autonomous_database_wallet" {
  autonomous_database_id = "${oci_database_autonomous_database.autonomous_database.id}"
  password               = "${random_string.autonomous_database_wallet_password.result}"
  base64_encode_content  = "true"
}

resource "local_file" "autonomous_database_wallet_file" {
  content_base64 = "${data.oci_database_autonomous_database_wallet.autonomous_database_wallet.content}"
  filename       = "${path.module}/autonomous_database_wallet.zip"
}

output "autonomous_database_wallet_password" {
  value = "${random_string.autonomous_database_wallet_password.result}"
}

$ cat autonomous_database.tf
// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.

resource "random_string" "autonomous_database_admin_password" {
  length      = 16
  min_numeric = 1
  min_lower   = 1
  min_upper   = 1
  min_special = 1
}

resource "oci_database_autonomous_database" "autonomous_database" {
  #Required
  admin_password           = "${random_string.autonomous_database_admin_password.result}"
  compartment_id           = "${var.compartment_ocid}"
  cpu_core_count           = "1"
  data_storage_size_in_tbs = "1"
  db_name                  = "atpdb1"
  is_free_tier             = true
  #Optional
  db_workload                                    = "${var.autonomous_database_db_workload}"
  display_name                                   = "example_autonomous_database"
  is_auto_scaling_enabled                        = "false"
  is_preview_version_with_service_terms_accepted = "false"
}

data "oci_database_autonomous_databases" "autonomous_databases" {
  #Required
  compartment_id = "${var.compartment_ocid}"

  #Optional
  display_name = "${oci_database_autonomous_database.autonomous_database.display_name}"
  db_workload  = "${var.autonomous_database_db_workload}"
}

output "autonomous_database_admin_password" {
  value = "${random_string.autonomous_database_admin_password.result}"
}

output "autonomous_database_high_connection_string" {
  value = "${lookup(oci_database_autonomous_database.autonomous_database.connection_strings.0.all_connection_strings, "high", "unavailable")}"
}

output "autonomous_databases" {
  value = "${data.oci_database_autonomous_databases.autonomous_databases.autonomous_databases}"
}

Follow the same steps for autonomous_data_warehouse_wallet.tf and autonomous_data_warehouse.tf

[1] Initialize a Terraform working directory
$ terraform init

[2] Generate and show an execution plan
$ terraform plan

[3] Builds or changes infrastructure
$ terraform apply

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

random_string.autonomous_database_admin_password: Creating...
random_string.autonomous_data_warehouse_admin_password: Creating...
random_string.autonomous_data_warehouse_wallet_password: Creating...
random_string.autonomous_database_wallet_password: Creating...
random_string.autonomous_database_admin_password: Creation complete after 0s [id=0++6KrIV8T?=F1*k]
random_string.autonomous_data_warehouse_admin_password: Creation complete after 0s [id=Dtbt2t!0KZ]y0Y<&] random_string.autonomous_data_warehouse_wallet_password: Creation complete after 0s [id=a?*>RADQ+]Uv[Xgt]
random_string.autonomous_database_wallet_password: Creation complete after 0s [id=_HLrXaT*Zf@eXqu#]
oci_database_autonomous_database.autonomous_data_warehouse: Creating...
oci_database_autonomous_database.autonomous_database: Creating...
oci_database_autonomous_database.autonomous_database: Still creating... [10s elapsed]
oci_database_autonomous_database.autonomous_data_warehouse: Still creating... [10s elapsed]
oci_database_autonomous_database.autonomous_database: Still creating... [20s elapsed]
oci_database_autonomous_database.autonomous_data_warehouse: Still creating... [20s elapsed]
.........
oci_database_autonomous_database.autonomous_data_warehouse: Still creating... [1m50s elapsed]
oci_database_autonomous_database.autonomous_database: Still creating... [2m0s elapsed]
oci_database_autonomous_database.autonomous_data_warehouse: Still creating... [2m0s elapsed]
oci_database_autonomous_database.autonomous_database: Still creating... [2m10s elapsed]
oci_database_autonomous_database.autonomous_data_warehouse: Still creating... [2m10s elapsed]

oci_database_autonomous_database.autonomous_data_warehouse: Still creating... [2m20s elapsed]
......
local_file.autonomous_data_warehouse_wallet_file: Creating...
local_file.autonomous_data_warehouse_wallet_file: Creation complete after 0s [id=a2cfa32740b9dcdffb8524d72fc703f62c5cfcdf]

Apply complete! Resources: 8 added, 0 changed, 0 destroyed.

Outputs:

[4] Play with ADB

#List of all the ADBs
$ oci db autonomous-database list –compartment-id $TF_VAR_compartment_ocid

#List of all the ADWs
$ oci db autonomous-data-warehouse list –compartment-id $TF_VAR_compartment_ocid

#Stop ADW
$ oci db autonomous-data-warehouse stop –autonomous-data-warehouse-id ocid1.autonomousdatabase.oc1.xyz

#Start ADW
$ oci db autonomous-data-warehouse start –autonomous-data-warehouse-id ocid1.autonomousdatabase.oc1.xyz

#Get details about specific ADW
$ oci db autonomous-data-warehouse get –autonomous-data-warehouse-id ocid1.autonomousdatabase.oc1.xyz

[5] Destroy Terraform-managed infrastructure
$ terraform destroy

Do you really want to destroy all resources?
  Terraform will destroy all your managed infrastructure, as shown above.
  There is no undo. Only 'yes' will be accepted to confirm.

  Enter a value: yes

local_file.autonomous_database_wallet_file: Destroying... [id=6c0eff5f4d195f0e38a364ef7d414dc7c39ed027]
local_file.autonomous_data_warehouse_wallet_file: Destroying... [id=a2cfa32740b9dcdffb8524d72fc703f62c5cfcdf]
local_file.autonomous_data_warehouse_wallet_file: Destruction complete after 0s
local_file.autonomous_database_wallet_file: Destruction complete after 0s
random_string.autonomous_data_warehouse_wallet_password: Destroying... [id=a?*>RADQ+]Uv[Xgt]
random_string.autonomous_data_warehouse_wallet_password: Destruction complete after 0s
.....
Destroy complete! Resources: 8 destroyed.

Thank you for visit this blog.
Happy Learning. 🙂

Launch your first Compute Instance from OCI CLI on Window 10 OS Platform

First of all, We have to install OCI CLI in the windows machine then we will configure OCI CLI and further we will play with compute instance life cycle operations like launch instance, start, stop and other possible actions and at the end, we will terminate the instance from oci cli.

#Install OCI CLI 
Follow the below commands provided in OCI Documentation.

C:\WINDOWS\system32>powershell
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

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

PS C:\WINDOWS\system32> powershell -NoProfile -ExecutionPolicy Bypass -Command “iex ((New-Object System.Net.WebClient).DownloadString(‘https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.ps1&#8217;))”

******************************************************************************
You have started the OCI CLI Installer in interactive mode. If you do not wish
to run this in interactive mode, please include the -AcceptAllDefaults option.
If you have the script locally and would like to know more about
input options for this script, then you can run:
help .\install.ps1
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
******************************************************************************
VERBOSE: Python found in registry: HKCU:\Software\Python\PythonCore
VERBOSE: Downloading install script to C:\Users\oracle-learn\AppData\Local\Temp\tmpDDAF.tmp
VERBOSE: False False
VERBOSE: Using Python executable: C:\Users\oracle-learn\AppData\Local\Programs\Python\Python37\python.exe to run install
script…
VERBOSE: Arguments to python script: “C:\Users\oracle-learn\AppData\Local\Temp\tmpDDAF.tmp”
— Verifying Python version.
— Python version 3.7.5 okay.

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

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

===> In what directory would you like to place the OCI scripts? (leave blank to use ‘C:\Users\oracle-learn\bin\oci-cli-scripts’):
— The scripts will be in ‘C:\Users\oracle-learn\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)?:
— The optional packages installed will be ”.
— Downloading virtualenv package from https://github.com/pypa/virtualenv/archive/15.0.0.tar.gz.
— Downloaded virtualenv package to C:\Users\oracle-learn\AppData\Local\Temp\tmpukxf413h\15.0.0.tar.gz.
— Checksum of C:\Users\oracle-learn\AppData\Local\Temp\tmpukxf413h\15.0.0.tar.gz OK.
— Extracting ‘C:\Users\oracle-learn\AppData\Local\Temp\tmpukxf413h\15.0.0.tar.gz’ to ‘C:\Users\oracle-learn\AppData\Local\Temp\tmpukxf413h’.
— Copying DLLs into virtualenv.
— Copying C:\Users\oracle-learn\AppData\Local\Programs\Python\Python37\python3.dll to C:\Users\oracle-learn\lib\oracle-cli\Scripts
— Copying C:\Users\oracle-learn\AppData\Local\Programs\Python\Python37\python37.dll to C:\Users\oracle-learn\lib\oracle-cli\Scripts
— Copying C:\Users\oracle-learn\AppData\Local\Programs\Python\Python37\vcruntime140.dll to C:\Users\oracle-learn\lib\oracle-cli\Scripts
— Executing: [‘C:\\Users\\oracle-learn\\AppData\\Local\\Programs\\Python\\Python37\\python.exe’, ‘virtualenv.py’, ‘–python’, ‘C:\\Users\\oracle-learn\\AppData\\Local\\Programs\\Python\\Python37\\python.exe’, ‘C:\\Users\\oracle-learn\\lib\\oracle-cli’]
Already using interpreter C:\Users\oracle-learn\AppData\Local\Programs\Python\Python37\python.exe
Using base prefix ‘C:\\Users\\oracle-learn\\AppData\\Local\\Programs\\Python\\Python37’
virtualenv.py:1030: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module’s documentation for alternative uses
import imp
New python executable in C:\Users\oracle-learn\lib\oracle-cli\Scripts\python.exe
Installing setuptools, pip, wheel…done.
— Executing: [‘C:\\Users\\oracle-learn\\lib\\oracle-cli\\Scripts\\pip’, ‘install’, ‘–cache-dir’, ‘C:\\Users\\oracle-learn\\AppData\\Local\\Temp\\tmpukxf413h’, ‘oci_cli’, ‘–upgrade’]
Collecting oci_cli
Downloading https://files.pythonhosted.org/packages/93/b3/6f4d3f257dd9bcddbf1c139aa0b085369ff6534cb94da9355907c7c62ef1/oci_cli-2.7.0-py2.py3-none-any.whl (6.3MB)
|████████████████████████████████| 6.3MB 363kB/s
Collecting jmespath==0.9.3
Downloading https://files.pythonhosted.org/packages/b7/31/05c8d001f7f87f0f07289a5fc0fc3832e9a57f2dbd4d3b0fee70e0d51365/jmespath-0.9.3-py2.py3-none-any.whl
Collecting oci==2.8.0
Downloading https://files.pythonhosted.org/packages/7e/97/55a70ea8b2c2c79c5c39740439c93cd076a48bd19d5dfc75f6ab5ddaa7f2/oci-2.8.0-py2.py3-none-any.whl (3.1MB)
|████████████████████████████████| 3.1MB 409kB/s
Collecting cryptography==2.4.2
Downloading https://files.pythonhosted.org/packages/c7/c7/2b97b9af3b16ea45aeabd5fe7eb07902c0c24c5d596b68f677c1f50ae55e/cryptography-2.4.2-cp37-cp37m-win_amd64.whl (1.3MB)
|████████████████████████████████| 1.3MB 726kB/s
Collecting six==1.11.0
Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting configparser==3.5.0
Downloading https://files.pythonhosted.org/packages/7c/69/c2ce7e91c89dc073eb1aa74c0621c3eefbffe8216b3f9af9d3885265c01c/configparser-3.5.0.tar.gz
Collecting pytz==2016.10
Downloading https://files.pythonhosted.org/packages/f5/fa/4a9aefc206aa49a4b5e0a72f013df1f471b4714cdbe6d78f0134feeeecdb/pytz-2016.10-py2.py3-none-any.whl (483kB)
|████████████████████████████████| 491kB 1.3MB/s
Collecting PyYAML==5.1.2
Downloading https://files.pythonhosted.org/packages/bc/3f/4f733cd0b1b675f34beb290d465a65e0f06b492c00b111d1b75125062de1/PyYAML-5.1.2-cp37-cp37m-win_amd64.whl (215kB)
|████████████████████████████████| 225kB 285kB/s
Collecting pyOpenSSL==18.0.0
Downloading https://files.pythonhosted.org/packages/96/af/9d29e6bd40823061aea2e0574ccb2fcf72bfd6130ce53d32773ec375458c/pyOpenSSL-18.0.0-py2.py3-none-any.whl (53kB)
|████████████████████████████████| 61kB 218kB/s
Collecting click==6.7
Downloading https://files.pythonhosted.org/packages/34/c1/8806f99713ddb993c5366c362b2f908f18269f8d792aff1abfd700775a77/click-6.7-py2.py3-none-any.whl (71kB)
|████████████████████████████████| 71kB 353kB/s
Collecting python-dateutil==2.7.3
Downloading https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl (211kB)
|████████████████████████████████| 215kB 504kB/s
Collecting certifi
Downloading https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl (156kB)
|████████████████████████████████| 163kB 409kB/s
Collecting idna<2.7,>=2.5
Downloading https://files.pythonhosted.org/packages/27/cc/6dd9a3869f15c2edfab863b992838277279ce92663d334df9ecf5106f5c6/idna-2.6-py2.py3-none-any.whl (56kB)
|████████████████████████████████| 61kB 563kB/s
Collecting terminaltables==3.1.0
Downloading https://files.pythonhosted.org/packages/9b/c4/4a21174f32f8a7e1104798c445dacdc1d4df86f2f26722767034e4de4bff/terminaltables-3.1.0.tar.gz
Collecting retrying==1.3.3
Downloading https://files.pythonhosted.org/packages/44/ef/beae4b4ef80902f22e3af073397f079c96969c69b2c7d52a57ea9ae61c9d/retrying-1.3.3.tar.gz
Collecting arrow==0.10.0
Downloading https://files.pythonhosted.org/packages/54/db/76459c4dd3561bbe682619a5c576ff30c42e37c2e01900ed30a501957150/arrow-0.10.0.tar.gz (86kB)
|████████████████████████████████| 92kB 368kB/s
Collecting cffi!=1.11.3,>=1.7
Downloading https://files.pythonhosted.org/packages/71/71/6011c17e8a523be0be20149ed7ba7e8671db7ec6fc52868e4f9a49d527f8/cffi-1.13.2-cp37-cp37m-win_amd64.whl (175kB)
|████████████████████████████████| 184kB 1.1MB/s
Collecting asn1crypto>=0.21.0
Downloading https://files.pythonhosted.org/packages/6b/8c/ff300484eca90b397d919408619fae479965bdd8a1df3d6d08d58e491da5/asn1crypto-1.2.0-py2.py3-none-any.whl (103kB)
|████████████████████████████████| 112kB 1.3MB/s
Collecting pycparser
Downloading https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz (158kB)
|████████████████████████████████| 163kB 328kB/s
Building wheels for collected packages: configparser, terminaltables, retrying, arrow, pycparser
Building wheel for configparser (setup.py) … done
Created wheel for configparser: filename=configparser-3.5.0-cp37-none-any.whl size=20865 sha256=abc942bac573f3e5f612d62de463f504320677dc1a6d2788edfb03ed52de7aed
Stored in directory: C:\Users\oracle-learn\AppData\Local\Temp\tmpukxf413h\wheels\a3\61\79\424ef897a2f3b14684a7de5d89e8600b460b89663e6ce9d17c
Building wheel for terminaltables (setup.py) … done
Created wheel for terminaltables: filename=terminaltables-3.1.0-cp37-none-any.whl size=15362 sha256=53403741f831f93681673c00903de32d313f57c3d539207141a994b5a75026d8
Stored in directory: C:\Users\oracle-learn\AppData\Local\Temp\tmpukxf413h\wheels\30\6b\50\6c75775b681fb36cdfac7f19799888ef9d8813aff9e379663e
Building wheel for retrying (setup.py) … done
Created wheel for retrying: filename=retrying-1.3.3-cp37-none-any.whl size=11435 sha256=662b2240b6aaa349ae3edc39b178cb9bd2cafa4ffd22333154573f356f63434a
Stored in directory: C:\Users\oracle-learn\AppData\Local\Temp\tmpukxf413h\wheels\d7\a9\33\acc7b709e2a35caa7d4cae442f6fe6fb
f2c43f80823d46460c
Building wheel for arrow (setup.py) … done
Created wheel for arrow: filename=arrow-0.10.0-py2.py3-none-any.whl size=32856 sha256=358422ae1a2eaa31691be7ded73643fd
700ee2e1d19d64e1bd42124c1d3cea5c
Stored in directory: C:\Users\oracle-learn\AppData\Local\Temp\tmpukxf413h\wheels\ce\4f\95\64541c7466fd88ffe72fda5164f8323c91d695c9a77072c574
Building wheel for pycparser (setup.py) … done
Created wheel for pycparser: filename=pycparser-2.19-py2.py3-none-any.whl size=111018 sha256=402b3b5fcdf0280d8ca2389825fed90efcdb20185d76b36fab57cc6008fdbf4c
Stored in directory: C:\Users\oracle-learn\AppData\Local\Temp\tmpukxf413h\wheels\f2\9a\90\de94f8556265ddc9d9c8b271b0f63e57b26fb1d67a45564511
Successfully built configparser terminaltables retrying arrow pycparser
Installing collected packages: jmespath, idna, pycparser, cffi, asn1crypto, six, cryptography, configparser, certifi, pytz, pyOpenSSL, python-dateutil, oci, PyYAML, click, terminaltables, retrying, arrow, oci-cli
Successfully installed PyYAML-5.1.2 arrow-0.10.0 asn1crypto-1.2.0 certifi-2019.11.28 cffi-1.13.2 click-6.7 configparser-3.5.0 cryptography-2.4.2 idna-2.6 jmespath-0.9.3 oci-2.8.0 oci-cli-2.7.0 pyOpenSSL-18.0.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-learn\bin\oci.exe –help
VERBOSE: Successfully installed OCI CLI!
PS C:\WINDOWS\system32>

#Configure the OCI CLI

C:\Users\oracle-learn\bin> oci setup config
This command provides a walkthrough of creating a valid CLI config file.

The following links explain where to find the information required by this
script:

User OCID and Tenancy OCID:

https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#Other

Region:

https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm

General config documentation:

https://docs.cloud.oracle.com/Content/API/Concepts/sdkconfig.htm

Enter a location for your config [C:\Users\oracle-learn\.oci\config]: C:\Users\oracle-learn\.oci\config
Enter a user OCID: ocid1.user.oc1..fddsfdsfdsfjhgjhjhg54534vcxvcxvcxv
Enter a tenancy OCID: ocid1.tenancy.oc1..dfdsfljfsdjf433sdfsdlfjsfjsdf
Enter a region (e.g. ap-mumbai-1, ap-seoul-1, ap-sydney-1, ap-tokyo-1, ca-toronto-1, eu-frankfurt-1, eu-zurich-1, sa-saopaulo-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): ap-mumbai-1
Do you want to generate a new RSA key pair? (If you decline you will be asked to supply the path to an existing key.) [Y/n]: Y
Enter a directory for your keys to be created [C:\Users\oracle-learn\.oci]:
Enter a name for your key [oci_api_key]:
Public key written to: C:\Users\oracle-learn\.oci\oci_api_key_public.pem
Enter a passphrase for your private key (empty for no passphrase):
File C:\Users\oracle-learn\.oci\oci_api_key.pem already exists, do you want to overwrite? [y/N]: y
Private key written to: C:\Users\oracle-learn\.oci\oci_api_key.pem
Fingerprint: 29:80:a7:d8:4d:5b:a1:54:d1:c6:cc:b3:de:6c:ef:52
Config written to C:\Users\oracle-learn\.oci\config

If you haven’t already uploaded your public key through the console,

follow the instructions on the page linked below in the section ‘How to
upload the public key’:

https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#How2
C:\Users\oracle-learn\bin>C:\Users\oracle-learn\.ssh\id_rsa.pub

C:\Users\oracle-learn\bin>oci –help

Once everything is configured correctly you can run a few commands to try out the client. The basic syntax is:
$ oci

$ oci
Some of the available services are:

Core (Networking, Compute, Block Volume, etc.)
Database
IAM
Load Balancing
Object Storage

#Launch Compute instance

When you launch an instance you have to provide the following information, some of which you’ve already obtained:

compartment-id
availability-domain
subnet-id
image-id
shape

Sample commands to find the required information.
oci iam user list –compartment-id
oci iam availability-domain list
oci compute shape list -c
oci compute image list -c

You can use -h option at end of the command to find an help related to specific command option.
oci compute image list -h
oci compute shape list -h

Syntax:
oci compute instance launch –availability-domain “” -c –shape “” –display-name “” –image-id –ssh-authorized-keys-file “” –subnet-id

Example:

oci compute instance launch --availability-domain "AARS:AP-MUMBAI-1-AD-1" -c ocid1.compartment.oc1..ggfdh434332sfsdfsdfsdfsf --shape "VM.Standard.E2.1" --display-name "MyFirstMachineFromCLI" --image-id ocid1.image.oc1.ap-mumbai-1.aaaaaaaaka7f3qhfuobx2s7dqfgbcx5klllh5xlflbgzb5pymqsnuphehk2a --ssh-authorized-keys-file "C:\Users\oracle-learn\.ssh\id_rsa.pub" --subnet-id ocid1.subnet.oc1.ap-mumbai-1.aaaaaaaah44xlfte72zz4yrgrp5pqc3ndqy5atc3kqlfmz4lzwdlsdlhyoya

#List Compute instances
oci compute instance list --compartment-id ocid1.compartment.oc1..ggfdh434332sfsdfsdfsdfsf

Performs one of the following power actions on the specified instance

[1] * **START** – Powers on the instance.

oci compute instance action --instance-id ocid1.instance.oc1.ap-mumbai-1.fdsfdsfsdfsdfdsf343sdfsdfsfsdf --action START --wait-for-state RUNNING

[2] * **STOP** – Powers off the instance.

oci compute instance action --instance-id ocid1.instance.oc1.ap-mumbai-1.fdsfdsfsdfsdfdsf343sdfsdfsfsdf --action STOP --wait-for-state STOPPED

[3] * **SOFTRESET** – Gracefully reboots instance by sending a shutdown
command to the operating system and then powers the instance back
on.

oci compute instance action --instance-id ocid1.instance.oc1.ap-mumbai-1.fdsfdsfsdfsdfdsf343sdfsdfsfsdf --action SOFTRESET --wait-for-state RUNNING

[4] * **SOFTSTOP** – Gracefully shuts down instance by sending a
shutdown command to the operating system.

oci compute instance action --instance-id ocid1.instance.oc1.ap-mumbai-1.fdsfdsfsdfsdfdsf343sdfsdfsfsdf --action SOFTSTOP --wait-for-state STOPPED

[5] * **RESET** – Powers off the instance and then powers it back on.

oci compute instance action --instance-id ocid1.instance.oc1.ap-mumbai-1.fdsfdsfsdfsdfdsf343sdfsdfsfsdf --action RESET --wait-for-state RUNNING

#Terminate Compute instance
oci compute instance terminate --instance-id ocid1.instance.oc1.ap-mumbai-1.fdsfdsfsdfsdfdsf343sdfsdfsfsdf

#OCI Documentation References
https://docs.cloud.oracle.com/iaas/Content/GSG/Tasks/gettingstartedwiththeCLI.htm
https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliinstall.htm
https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm

Thank you for visit this blog

Happy Learning 🙂

How to share an Internet access from Window 10 to VirtualBox Oracle Linux 7.x Server

I am glad to share my experience here.

To share an Internet access from Windows10 to Oracle Linux7.3 which is installed in VirtualBox6.

Below are the steps required to be following in sequence.

1. VirtualBox Machine OL7.3

2. VB Network Configuration

3. After Starting OL7.3

4. Connect Wire from topLeft

5. Ifconfig After Connect Wire

6. Able to browse my website

7. Able to access VB Machine from MobaXterm (In Windows10)

Bridged Networking is used when you want your vm to be a full network citizen, i.e. to be an equal to your host machine on the network; in this mode, a virtual NIC is “bridged” to a physical NIC on your host.

The effect of this is that each VM has access to the physical network in the same way as your host. It can access any service on the network such as external DHCP services, name lookup services, and routing information just as the host does. Logically, the network looks like this:

Bridging to wired LAN

Oracle blog Oracle VM VirtualBox: Networking options and how-to manage them

Thank you for visiting this blog. 🙂

Learning Python

This is a very good course to start learning python.
Course : Learning Python
By Instructor: Joe Marini
Learning Objectives:
Installing Python
Choosing an editor or IDE
Working with variables and expressions
Writing loops
Using the date, time, and datetime classes
Reading and writing files
Fetching internet data
Parsing and processing HTML
Thank you, Joe Marini, for sharing your practical experience.
🙂

Performance Management

I would like to share my learning experience of Oracle Database Performance Management. This article also covered skillset5 for OCM12c Certification Exam.

Go back to OCM 12c Preparation Project 

Thank you for visiting this blog 🙂

Data Management

I would like to share my learning experience of Oracle Data Management . This article also covered skillset4 for OCM12c Certification Exam.

Go back to OCM 12c Preparation Project 

Thank you for visiting this blog 🙂