Monday, May 31, 2021

Consume Rest Service Using GSON jar

I am going to demonstrate how to consume rest API service Using Google Json jar that GSON jar .First you need to down the GSON jar .I am using gson-2.8.6.jar for my demo.

Rest service that i am is hosted at http://localhost:8080/employees .when hit GET request to this in postman or in browser i get response as below.

Response-

{

    "employeeList": [

        {

            "employeeId": "1234",

            "employeeName": "Dhiraj Shigavi",

            "departmentName": "Information technology"

        },

        {

            "employeeId": "7777",

            "employeeName": "John Den",

            "departmentName": "Electronic andtele communication"

        }

    ]

}


To Consume this in java follow below steps.
1. create java project in jdeveloper ( you can user any IDE of your choice).
2.add the GSON jar file downloaded in project properties as below



3. Create java Class and name it ConsumeRestServiceWrapper.java.
4. Now first we need to understand the response and create java equivalent classes of  it so we can parse the response using Gson jar file

In this case my response contains employeeList which is list so i will create a class which contains list object of employeeList ,now type of List object contains employeeId,employeeName,departmentName so will create another class which will have these three names of String object in as below.
So My Employee Class is as below.
 
public class Employee {
    private String employeeId;
    private String employeeName;
    private String departmentName;

    public Employee(String employeeId, String employeeName, String departmentName) {
        this.employeeId = employeeId;
        this.employeeName = employeeName;
        this.departmentName = departmentName;
    }
    public String getEmployeeId() {
        return employeeId;
    }
    public void setEmployeeId(String employeeId) {
        this.employeeId = employeeId;
    }
    public String getDepartmentName() {
        return departmentName;
    }
    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }
   public String getEmployeeName() {
        return employeeName;
    }
    public void setEmployeeName(String employeeName) {
        this.employeeName = employeeName;
    }
    public Employee() {
        super();
    }
}
My EmployeeResponse class will contain List<Employee>  with name employeeList. 
Please note here name has to match with name in your rest response.
import java.util.List;
public class EmployeeResponse {
    List<Employee> employeeList;
    public EmployeeResponse() {
        super();
    }
    public void setEmployeeList(List<Employee> employeeList) {
        this.employeeList = employeeList;
    }
    public List<Employee> getEmployeeList() {
        return employeeList;
    }
}
















Now main part is to write method in service wrapper class which will call the service and populate the data in object of EmployeeResponse class.
I have written getEmployees method which returns me object of EmployeeResponse created above.
Please note below line which populated the String response into Object that we can use in object format

EmployeeResponse employeeResponse = new Gson().fromJson(response.toString(), EmployeeResponse.class);






























package com.service;

import com.google.gson.Gson;
import com.payload.Employee;
import com.payload.EmployeeResponse;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class ConsumeRestServiceWrapper {
    public ConsumeRestServiceWrapper() {
        super();
    }

    public static void main(String[] args) {
        ConsumeRestServiceWrapper service = new ConsumeRestServiceWrapper();
        try {
            EmployeeResponse response = service.getEmployees();
            if (response != null) {
                if (response.getEmployeeList() != null && response.getEmployeeList().size() > 0) {
                    System.out.println("Employee  list");
                    System.out.println("*****************");
                    for (Employee e : response.getEmployeeList()) {
                        System.out.println("Employee Id-" + e.getEmployeeId());
                        System.out.println("Employee Name-" + e.getEmployeeName());
                        System.out.println("Employee Department-" + e.getDepartmentName());
                        System.out.println("*****************");
                    }

                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }

    }


    public EmployeeResponse getEmployees() throws Exception {

        URL url = new URL(null, "http://localhost:8080/employees", new sun.net.www.protocol.http.Handler());
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setRequestMethod("GET");
        conn.setDoOutput(true);
        conn.setRequestProperty("Content-Type", "application/json");

        int responseCode = conn.getResponseCode();
        System.out.println("URL...: " + url + "  Response Code..: " + responseCode);
        if (responseCode >= 200 && responseCode < 300) {

            BufferedReader br = new BufferedReader(new InputStreamReader((conn.getInputStream())));
            String line;
            StringBuffer response = new StringBuffer();
            while ((line = br.readLine()) != null) {
                response.append(line);

            }
            br.close();
            System.out.println("Rest response for employee is -" + response);

            EmployeeResponse employeeResponse = new Gson().fromJson(response.toString(), EmployeeResponse.class);


            return employeeResponse;
        } else {
            BufferedReader in = new BufferedReader(new InputStreamReader(conn.getErrorStream()));
            String line;
            StringBuffer errorResponse = new StringBuffer();

            while ((line = in.readLine()) != null) {
                errorResponse.append(line);
            }
            in.close();
            throw new RuntimeException(conn.getResponseCode() + " Invalid Response " + errorResponse);
        }

    }
}


when i run above class i get response as below















Some of rest service response just contains the list without the name as below

























In this case when you run above code ,you would get exception as com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 2 path $

so change the line in getEmployees method as below and it will directly populate in List<Employee>

List<Employee> employeeResponse = new Gson().fromJson(response.toString(), List.class);




hope this helps to know how to consume rest API using Gson jar file.

Wednesday, May 26, 2021

ADF dropdown Adjusting width with af:panelFormLayout

In ADF width of af:selectOneChoice is adjusted to fit its content and sometime we dont want that to happen specifically when we use af:panelFormLayout with multiple input components like af:inputText af:selectoneChoice.

In this example i am using below code 











My UI Looks like Below and you can see dropdown is not align with input textbox.










To align this af:selectOneChoice with af:inputText set  contentStyle="width:100%;"  of af:selectOneChoice as shown below






With this your dropdown will be aligned as below



Sunday, May 23, 2021

Call Stored procedure with Array as input parameter from java

Requirement-It is very common requirement to call stored procedure which takes array as input parameter. In below example i am calling the stored procedure from Impl class of application module.

My procedure is having String of array as second parameter.When we want to pass String of array to Stored procedure we need to convert this String of array to Sql array type.For this we need below two things 

  1. The array that we pass should be declared in data as type in database as shown in below CST_LTG_ARRAY_VARCHAR2 is declared as type in database.Same type will be used in stored procedure input parameter as shown in screenshot 2
  2. We need to convert the java.sql.Connection to oracle.jdbc.OracleConnection object as shown in code snippet
Now use this OracleConnection reference to create array reference that we need to pass to stored procedure using below line.Remember minute details here -dont forget to mention schema name dot your type name in database in all uppercase otherwise code will throw java.sql.SQLException: invalid name pattern.


       Array subSetCodesArray = oraConn.createARRAY("EL_EGWH_EXT_WORK.CST_LTG_ARRAY_VARCHAR2", subSetCodes);

Now final step is to pass this subSetCodesArray  array to callableStatement setArray method as below

 statement.setArray(2, subSetCodesArray);


Final method looks like below initializeDataSource is methd used to get connection reference from dataSource in weblogic server.

    public String callApplyClusterStoredProcedure(Long batchNumber, String[] subSetCodes) {


        DBTransactionImpl dbtrx = (DBTransactionImpl) getDBTransaction();

        CallableStatement statement =

            dbtrx.createCallableStatement(("BEGIN " + "SCHEMA_NAME.PROCEDURE_NAME(?,?,?,?);" + "END;"), 0);

        try {

            DataSource ds = initializeDataSource();

            java.sql.Connection conn = ds.getConnection();

            OracleConnection oraConn = conn.unwrap(OracleConnection.class);

            statement.setLong(1, batchNumber);

            if (subSetCodes != null) {

                Array subSetCodesArray = oraConn.createARRAY("EL_EGWH_EXT_WORK.CST_LTG_ARRAY_VARCHAR2", subSetCodes);

                statement.setArray(2, subSetCodesArray);

            } else {

                //use below code to set Null if array is empty or null

                statement.setNull(2, java.sql.Types.ARRAY,"EL_EGWH_EXT_WORK.CST_LTG_ARRAY_VARCHAR2");

            }


            statement.registerOutParameter(3, java.sql

                                                  .Types

                                                  .VARCHAR);

            statement.registerOutParameter(4, java.sql

                                                  .Types

                                                  .VARCHAR);

            statement.execute();

            //Long balanceToInclude = statement.getLong(4);

            String result = statement.getString(3);

            String message = statement.getString(4);

            System.out.println("result -" + result);

            System.out.println("message-" + message);

            return result;

        } catch (SQLException sqlerr) {

            throw new JboException(sqlerr.getMessage());

        } finally {

            try {

                if (statement != null) {

                    statement.close();

                }

            } catch (SQLException closeerr) {

                throw new JboException(closeerr.getMessage());

            }

        }

    }


    private DataSource initializeDataSource() {

        InitialContext ctxt = null;

        DataSource dataSource = null;

        try {

            ctxt = new InitialContext();

            dataSource = (DataSource) ctxt.lookup("jdbc/EgwhDS");

            ctxt.close();

        } catch (Exception e) {

            e.printStackTrace();

        }

        return dataSource;

    }

Thursday, May 20, 2021

ADF view object with bind parameter and like operator .

 Requirement:

In this post i am explaining how to create ADF view object with like operator and bind parameter in where clause. requirement is very simple get all rows from employee table with employee containing runtime value entered by user.


In this case while we create new object in Jdeveloper give query as below

Query here is -


select EMPLOYEE_NAME,EMPLOYEE_ID from EMPLOYEE 

where  ( (UPPER(EMPLOYEE_NAME) LIKE UPPER('%' || :pEmployeeName || '%') )
















In the next screen give bind parameter pEmployeeName of type string as below














After this pass the bind parameter from UI as user entered value .Hope this helps

Saturday, March 27, 2021

Oracle Cloud Infrastructure 2020 Certified Architect/1Z0-1072-20 -EXAM questions/Dump

 HI All,

Recently i passed the exam for Oracle Cloud Infrastructure 2020 Certified Architect. Its tough exam with 60% passing percentage.

Attached are exam dump questions that i got along with answers for each. You will definitely pass the exam with only following the document questions


click link for Dump questions and answers

All the Best :)

Friday, March 12, 2021

ADF table -Achieve case insensitive sort for af:column

 In Oracle ADF when we use sortable="true" on af:column By default sorting will be done case-sensitively ,which means that upper case data will be shown first and then lower case data will shown .As shown in below screenshot






,









To make this work case insensitively , we can use sortStrength="Primary" attribute on af:column as below






Now my work works case insenstive as below.














Please note this works only with 11.1.1.7 and above version

Wednesday, March 10, 2021

Setting NULL value using af:setPropertyListener in ADF

 Usually we come across common requirement to set value of session scope or pageFlowScope variable to NULL on click of adf button or  af:commandLink to do this you can af:setPropertyListener inside af:commandLink as below and use EL as #{null}

<af:commandLink text="Clear">

            <af:setPropertyListener  from="#{null}"

                                                  to="#{sessionScope.userName}"

                                                   type="action"/>

</af:commandLink>


in above case i am setting userName to null.

Tuesday, March 9, 2021

Reset ADF table filters programmatically

Requirement-When we use ADF table i.e af:table with filters on each column ,It is very common requirement to clear filter data and reset table result to its initial state.

One way to do is to add af:column as first column in af:table and set rowHeader="true" attribute in af:column.This will show icon in first column to clear filter and reset table results.


There may be a requirement to do this on click of button which is outside af:table .So in this case add below code in button actionListener.



    public void backActionListener(ActionEvent actionEvent) {

        // Add event code here...

        FilterableQueryDescriptor fqd = (FilterableQueryDescriptor)deleteUserTableBinding.getFilterModel();

                      if (fqd != null && fqd.getFilterCriteria() != null) {

                        fqd.getFilterCriteria().clear();

                        deleteUserTableBinding.queueEvent(new QueryEvent(deleteUserTableBinding, fqd));          

                       

                     }

    }

Note: deleteUserTableBinding is my af:table component binding name.(change as per yours)

This will work as long as you are on same page on click of reset button in my case i call it back button. But if are redirecting to different jsff or jspx on click of your reset button above code will throw error saying binding not found because on the page which you are redirecting to does not have table binding iterators and tree binding .


Solution to solve this problem is go to first page's page defination file and copy tree binding and iterator binding ,now paste this in page defination file of next page which you are redirecting to so when we queue event in above code snippet it will find the required binding and wont throw exception.


Monday, March 8, 2021

ADF table- case Insensitive search on column filter of af:table

when we add table filters to ADF table the filter is case sensitive by default and common requirement is to have case insensitive filter.

Solution for this is very simple -Set af:column attribute filterFeatures="caseInsensitive"


and filter will work case insensitive.

Saturday, March 6, 2021

ADF LOV based dropdown not showing all records

 It is very common requirement to show dropdown with values coming database .In ADF we use Model based LOV dropdown or we drag the View object as af:selectOneChoice in our fragment or jspx page as below



now code that gets generated is as below








When you run this page the dropdown that is shown is just having 10 values as below















Where as in Database  i have 27 department names present .Reason for having 10 records in dropdown is if you go to page definition file of above dropdown page it looks like below and iterator binding of the DepartmentView is having range size as 10










Now to see all records of department names present in database change the range size 

value to -1 and run the page again to see dropdown show all values of department name as below .



Tuesday, March 2, 2021

Change Default look or CSS of ADF button

 Requirement-It is very common requirement in any adf application to change the default color of adf button,adf button text color as per client requirement of UI design.


when we use af:commandButton in 11g or af:button component in 12c it comes with default look as below.









Now requirement is to change the default look to something else as per your project standards so that we dont have to apply inline style each time we use adf button in application.

In my case I converted it to green background color with text color white.

Add below snippet of css in you ADF application css file and run the application again to see new look and feel of default button.


Code Snippet in CSS

.af_commandButton.p_AFTextOnly,

.af_commandButton, button.af_commandButton,button,button:focus,.af_commandButton:focus,.af_commandButton:active:hover,.af_commandButton:focus:hover.af_commandButton:focus:active,.af_commandButton:active:focus{

  background: #40A828 !important;

  text-decoration: none ;

  color:#ffffff !important;

  padding:3px 10px 3px 10px !important;

  border:none  !important;

  border-style: none !important;

  outline:none !important;

  cursor: pointer;

}

New button look will be something like below.Now just just af:commandbutton component anywhere in application and button color will be as below.










you can also have two three types of button css in you application but for that different style class need to be created.

Sunday, August 2, 2020

OIM ADF Customization-Adding ADF custom taskflow

Requirement:In OIM ADF customization very common requirement is to open new custom taskflow on click of icon. Follow below steps to achieve it in OIM. 

1.   Export the sandbox and unzip it.

2.    Open the Home page jsff.xml file that you are working on by using a text editor. Oracle Identity Manager has the following default Home pages for Self Service, Manage, and Compliance:

oracle/iam/ui/homepage/home/pages/mdssys/cust/site/site/self-service-manage.jsff.xml

3.    Locate the oim:DashboardBox element in the XML file. The element looks similar to the following: 

<oim:DashboardBox xmlns:oim="/componentLib1" instructionText="My user details" titleText="My Details" image="/images/Dashboard/myAccess.png" hoverImage="/images/Dashboard/myAccess_s2.png" iconClickable="true" id="e8533237995"/>

4.    Ensure that the value of iconClickable is set to true.

5.    Add a new element attribute named iconClickAction, set the value of the attribute to:

#{backingBeanScope.dashboardNavigationBean.launchTaskFlow}

6.    Add two new af:clientAttribute elements as child elements of oim:DashboardBox, as follows:

  <oim:DashboardBox xmlns:oim="/componentLib1" instructionText="Manage profiles" titleText="Profile Management" image="/images/Dashboard/myAccess.png" hoverImage="/images/Dashboard/myAccess_s2.png" iconClickable="true" id="e8381776527" iconClickAction="#{backingBeanScope.dashboardNavigationBean.launchTaskFlow}">

          <af:clientAttribute xmlns:af="http://xmlns.oracle.com/adf/faces/rich" xmlns:f="http://java.sun.com/jsf/core" name="taskFlowId" value="/WEB-INF/oracle/iam/ui/custom/profile-management-tf.xml"/>

            <af:clientAttribute xmlns:af="http://xmlns.oracle.com/adf/faces/rich" name="title" value="Profile Management"/>   

          </oim:DashboardBox>

 Please note that in above code xmlns:f="http://java.sun.com/jsf/core"  is very important as i am using faces components it is important to add that in af:clientAttribute .My taskflow jsff is as follows.

    <?xml version='1.0' encoding='UTF-8'?>

    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"

          xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core">

    <c:set var="BTExtensionBundleUI" value="#{adfBundle['ro.bt.adf.view.bundle.BTExtensionBundle']}"/>

    <af:outputText value="Profile Management" id="ot1"/>

    </jsp:root>

Make sure that oim:DashboardBox now has opening and closing tags, as shown in the example. Also, ensure that the component IDs are unique.

Set values of taskFlowId and title client attributes. taskFlowId specifies which task flow will be launched, and title specifies the title of the new tab. 

7.       Save the jsff.xml file, and re-create the sandbox ZIP file with the same name and structure as the original ZIP file.

8.       Import the sandbox to Oracle Identity Manager.

9.       Verify the changes and functionality of the new Home page tile.

10.     Export the sandbox and publish it to make the changes available to all users.

New Icon when clicked new taskflow opens in new tab as below


   

 



Tuesday, July 14, 2020

1Z0-1085-20: Oracle Cloud Infrastructure Foundations 2020 Associate- Questions /Answers


Exam Name
1Z0-1085-20: Oracle Cloud Infrastructure Foundations 2020 Associate


Sample questions and answers

Assessment Questions for OCI Foundations Certification

Cloud Concepts

Which of the following is not a core characteristic of cloud computing as defined by NIST standards?

A.      On-demand self-service access

B.      Upfront license payments

C.      Rapid elasticity

D.      Measured services

Answer: B

A, C, D are characteristics as defined by NIST; cloud computing enables pay-as-you-pricing and does not involve paying for licenses upfront.

Which statement below is NOT correct regarding a highly available system?

A.      Highly available systems always involve manual intervention to maintain high availability.

B.      Highly available systems typically have redundant hardware and software

C.      Highly availability systems avoid having single points-of-failure

D.      Highly available systems involve a failover process that moves processing performed by the failed component to the backup component

Answer: A

It is possible to have some manual intervention, but typically, highly available systems do not involve manual failover processes. The more transparent the failover is, the more highly available the system is.

What does compute vertical scaling imply?

A.      Compute scaling out is called vertical scaling

B.      Compute scaling in is called vertical scaling

C.      Compute scaling up (or down) is called vertical scaling

D.      In cloud, you can cannot scale compute instances

Answer: C

Scale in or out is horizontal scaling.

Which one of the following is not a cloud pricing model?

A.      Pay-as-you-go

B.      Commitment based pricing

C.      Consumption based pricing

D.      Enterprise license based pricing

Answer: D

Enterprise license based pricing is not a cloud pricing model, while the others are. In cloud computing, you only pay for resources that you use and in some cases, pay only for how much you consume. 

OCI Architecture

 

Which statement below is NOT true regarding an Oracle Cloud Infrastructure Region?

A.      Each region has at least one Availability Domain.

B.      Availability domains are isolated from each other and very unlikely to fail simultaneously.

C.      Each Fault Domain has multiple Availability Domains.

D.      Each Availability Domain has three Fault Domains.

 

Answer: C

Each Availability Domain has three Fault Domains and not the other way around.

 

Which two are valid reasons to use an Oracle Cloud Infrastructure Fault Domain?

A.      Protect against unexpected hardware or power supply failures

B.      Protect against planned hardware maintenance

C.      To mitigate the risk of large scale events such as earthquakes

D.      Build replicated systems for disaster recovery

E.       To meet requirements for legal jurisdictions

 

Answer: A, B

You can use fault domains to (1) protect against unexpected hardware failures or power supply failures (2) protect against planned outages because of compute hardware maintenance.

 

Which statement below is NOT true regarding Oracle Cloud Infrastructure High Availability Architecture?

A.      Fault Domains provide protection against failures within an Availability Domain

B.      In a multi-AD region, Availability Domain provides protection from an entire Availability Domain failure

C.      OCI region pair enables disaster recovery while meeting compliance and data residency requirements

D.      Compartments enable a high availability design within an Availability Domain

Answer: D

A compartment is a collection of related resources and provides logical not physical isolation.

Which two are valid reasons to deploy your apps in multiple Oracle Cloud Infrastructure regions?

 

A.      To mitigate the risk of region-wide events such as large weather systems or earthquakes

B.      To achieve high availability and real time data synchronization

C.      To meet varying requirements for legal jurisdictions, tax domains, and other business or social criteria

D.      To lower costs, as some OCI regions have lower pricing than others

 

Answer: A, C

In OCI, pricing is not region-specific. In addition, if you deploy apps to multiple regions, you cannot achieve real-time data synchronization as regions can be separated by vast distances—across countries or even continents

 

You have two web servers and a clustered database running in a single OCI Availability Domain. Which step below can help you achieve high availability?

A.      Group one web server and one database node in one fault domain and the other half of each pair in another fault domain

B.      OCI provides high availability by default, so you don’t need to do anything

C.      Put both web servers in the same fault domain and database nodes in another fault domain

D.      Put both database nodes in the same fault domain and web servers in another fault domain

Answer: A

Grouping web server and a database node and placing a pair in two separate fault domains ensure that a failure of any one fault domain does not result in an outage for your application.

Networking

How do instances in Private Subnets in OCI Virtual Cloud Network communicate to Internet?

A. Through a Service Gateway

B. Through a Dynamic Routing Gateway

C. Through a NAT Gateway

D. Through an Internet gateway

 

Answer: C

NAT is a networking technique commonly used to give an entire private network access to the internet without assigning each host a public IP address. OCI provides a managed NAT Gateway service that gives cloud resources without public IP addresses access to the internet without exposing those resources to incoming internet connections.

 

Which of the following statement is true about VCN peering?

A. A VCN peering connection is a networking connection between two VCNs within a single region.

B. A VCN peering connection is a VPN-based connection.

C. VCN peering does not require using any Gateways, Local or Remote

D. Peered VCNs can exist in different regions.

 

Answer: D

Remote Peering connects VCNs across regions

You are setting up a proof of concept (POC) and need to cost-effectively establish a secure connection between an on-premises data center and Oracle Cloud Infrastructure (OCI). Which OCI service would you use?

A. VPN Connect

B. Service Gateway

C. Internet Gateway

D. FastConnect

 

Answer: A

VPN Connect provides a site-to-site IPSec VPN between your on-premises network and your virtual cloud network (VCN). It can be used for a proof of concept setup: VPN Connect is a free service with no port hour charges. Data transfer cost is covered under networking cloud pricing.

 

You are building out a site-to-site VPN connection from an on-site network to a private subnet within a Virtual Cloud Network. Which of the following might you need for this connection to function properly?

A. NAT Gateway

B. Service Gateway

C. Internet Gateway

D. Dynamic Routing Gateway

E. VPN Gateway

 

Answer: D

DRG is a virtual router that provides a path for private traffic (that is, traffic that uses private IPv4 addresses) between your VCN and an on-premises network.

 

If you choose to use both Security Lists and Network Security Groups in an OCI VCN, at what two levels is security functioning? (choose TWO)

 

A.      VPN Level

B.      VCN Level

C.      Subnet Level

D.      Instance Level

E.       Gateways Level

 

Answer: C, D

NSG rules apply to an instance (vNIC) while Security Lists applies at the subnet level (and all instances in that particular subnet). If you choose to use both, a packet is allowed if any rule in any of the relevant Security Lists and Network Security Groups allows the traffic 

 

Storage

Which of the following is NOT true about Oracle Cloud Infrastructure Object Storage service?

A. Maximum object size that can be stored in OCI Object Storage buckets is 10 TB.

B. Standard Object storage buckets cannot be downgraded to Archive storage.

C. Archive Storage buckets cannot be upgraded to Standard Object storage.

D. Object Storage is eventually consistent.

 

Answer: D

OCI Object Storage supports strong consistency that means that when a read request is made, Object Storage always serves the most recent copy of the data that was written to the system.

 

You have a requirement to store application backups in OCI for 6-12 months, but retrieve data immediately based on business needs. Which OCI storage service can be used to meet this requirement?

A.      Object Storage (standard)

B.      Block Volume

C.      Archive Storage

D.      File Storage

Answer: A

You can use Object Storage for data to which you need fast, immediate, and frequent access. You can use Archive Storage for data to which you seldom or rarely access, but that must be retained and preserved for long periods.

 

Which Oracle Cloud Infrastructure storage service can provide a shared file system across multiple compute instances?

A.      File Storage

B.      Archive Storage

C.      Object Storage

D.      Local NVMe

Answer: A

Oracle Cloud Infrastructure File Storage service provides shared, scalable, secure, enterprise-grade storage across multiple compute instances.

 

Which storage service offers the lowest pricing (per GB)?

A.      Archive Storage

B.      Object Storage

C.      Block Volume

D.      File Storage

Answer: A

Archive Storage is ideal for storing data that is accessed infrequently and requires long retention periods. Archive Storage is more cost effective than Object, Block and File storage services

 

What is the smallest block volume size that can be provisioned on Oracle Cloud Infrastructure?

A. 1 GB

B. 50 GB

C. 1 TB

D. 1 MB

 

Answer: B

Block Volume service supports volumes that can be from 50 GB to 32 TB in size.

 

 

Compute

Which Oracle Cloud Infrastructure service allows you to run code without provisioning any underlying infrastructure resources and invoke the code in response to events?

A.      Oracle Functions

B.      Oracle Container Engine for Kubernetes

C.      OCI Bare Metal

D.      OCI Virtual Machine

 

Answer: A

The serverless and elastic architecture of Oracle Functions means there is no need to provision or maintain compute instances, and operating system software patches and upgrades. You can deploy your code and call it directly or trigger it in response to events.

 

You are planning to deploy Oracle JDE on Oracle Cloud Infrastructure (OCI). The application will require a database and several servers. Which two OCI services are best suited for this project?

A.      Oracle Container Engine for Kubernetes

B.      Oracle Object Storage

C.      Virtual Machine (VM) or Bare Metal (BM) compute instances

D.      Virtual Machine (VM) or Bare Metal (BM) DB Systems

E.       Object File Storage

 

Answer: C, D

In this case, you can use compute instances – VM or Bare Metal and managed DB systems – VM or Bare Metal.

 

You want to render fluid dynamic jobs on your compute instance in Oracle Cloud Infrastructure (OCI). Which compute shape is the best for your use case?

A.      OCI GPU Shapes

B.      OCI Flexible VM Shapes

C.      OCI Dedicated Virtual Machine Host

D.      OCI HPC Shapes

 

Answer: A

OCI GPU shapes are designed for hardware-accelerated workloads such as fluid dynamics jobs. GPU shapes include Intel CPUs and NVIDIA graphics processors.

What three characteristics constitute an Oracle Cloud Infrastructure Compute shape?

A.      Number of vCPU, amount of memory, network bandwidth

B.      Number of OCPU, amount of memory, network bandwidth

C.      Public or private visibility of the Compute instance

D.      Availability Domain and Fault Domain physical locations

Answer: B

The amount of memory, network bandwidth (and number of VNICs) scale proportionately with the number of OCPUs in a compute instance.

 

Which statement below is NOT true regarding OCI Compute Autoscaling?

A.      Autoscaling lets you scale-up and scale-down instance shapes

B.      If one VM fails in the Autoscaling group, others will keep working

C.      Autoscaling lets you match traffic demand by adding or removing VMs automatically

D.      There is no extra cost for using Autoscaling

 

Answer: A

Autoscaling is also referred to as scale-out or scale-in. Autoscaling does not Scale-up or Scale-down instance shapes.

 

Database

 

Which is a key benefit of using Oracle Cloud Infrastructure Autonomous Transaction Processing?

A.      Maintain root-level access to the underlying operating system

B.      Scale both CPU and Storage without downtime

C.      Use without any username and password

D.      Apply database patches as they become available

 

Answer: B

Autonomous Database allows you to scale the CPU and storage capacity of the database at any time without affecting availability or performance

 

Which of the following statements is NOT true regarding Oracle Data Safe?

 

A.      Data Safe can be used for protecting sensitive and regulated data in Oracle Cloud databases.

B.      Data Safe features include Security and User Assessments

C.      Data safe is not supported for Virtual Machine or Bare Metal DB Systems

D.      There is no extra cost to use Data safe service

 

Answer: C

Data Safe is supported for VM and BM DB Systems.

 

On Oracle Cloud Infrastructure DB systems, Real Application Clusters (RAC) can be configured for which of the options below?

A. Autonomous shared databases

B. 2-node virtual machine DB systems

C. Bare metal DB systems

D. Autonomous dedicated databases

 

Answer: B

Oracle Cloud Infrastructure offers 1-node DB systems on either bare metal or virtual machines, and 2-node RAC DB systems on virtual machines only.

Which OCI database service below uses Block Volumes for storing data?

 

A. Virtual Machine database systems

B. Bare Metal database systems

C. Exadata database systems

D. Autonomous databases

 

Answer: A

VM DB Systems leverage OCI Block Volumes for data storage; BM DB Systems use Local NVMe, and Exadata and Autonomous Database use Local disks and NVMe flash cards.

 

Oracle Data Guard is primarily used for which of the below scenarios?

A. To support automatic backups

B. To survive disaster and data corruption

C. To support rolling patching

D. To support auto scaling

 

Answer: B

Oracle Data Guard provides a set of services that create, maintain, manage, and monitor one or more standby databases to enable Oracle databases to survive disasters and data corruptions. It maintains synchronization between the primary and the standby databases.

 

IAM

 

Which of the following is NOT a component of the Oracle Cloud Infrastructure (OCI) Identity and Access Management (IAM) service?

A. User

B. Group

C. Role

D. Policy

 

Answer: C 

OCI IAM service components include Users, Groups, Policies and Compartments.

 

Which of the following is NOT a valid method for authenticating a Principal in Oracle Cloud Infrastructure (OCI) Identity and Access Management (IAM) service?

A. User name, Password

B. API Signing Key

C. Auth Tokens

D. Certificate based auth

 

Answer: D

The supported authentication methods for OCI IAM service include user name, password; Auth Tokens and API Signing Keys.   

Which of the following is the valid syntax for an Oracle Cloud Infrastructure (OCI) Identity and Access Management (IAM) Policy?

A. Allow group <group_name> to <verb> <resource-type> in tenancy

B. Allow user <user_name> to <verb> <resource-type> in tenancy

C. Deny group <group_name> to <verb> <resource-type> in tenancy

D. Deny user <user_name> to <verb> <resource-type> in tenancy

 

Answer: A

OCI IAM policy is defined at the group level and written in the following syntax:

Allow group <group_name> to <verb> <resource-type> in tenancy

  

Which of the following is NOT a valid statement regarding Oracle Cloud Infrastructure (OCI) Compartments?

A. Each resource belongs to a single compartment

B. Resources can interact with other resources in different compartments

C. Resources cannot be moved from one compartment to another

D. You can give group of users access to compartments by writing policies

 

Answer: C

In OCI, resources can be moved from one compartment to another.

 

You are writing an Oracle Cloud Infrastructure (OCI) Identity and Access Management (IAM) Policy. Where can it be attached? Choose TWO

A. User

B. Group

C. Tenancy

D. Compartment

 

Answer: C, D

Policies can be attached to a compartment or the tenancy. Where you attach it controls who can then modify it or delete it

 

Security

Which of the below use cases is supported by Oracle Cloud Infrastructure Identity and Access Management service?

 

A. Single sign-on to identity providers

B. Workload isolation

C. DDoS Protection

D. Centralized key management

Answer: A

Oracle Cloud Infrastructure IAM service supports federation and single sign-on with Oracle Identity Cloud Service, Microsoft Active Directory, Microsoft Azure Active Directory, and other identity providers that supports the Security Assertion Markup Language (SAML) 2.0 protocol.

 

What is the primary purpose of using Oracle Cloud Infrastructure Web Application Firewall?

A. Network security control

B. Hardware based key storage

C. Patch management

D. Filter malicious web traffic

Answer: D

Oracle Cloud Infrastructure Web Application Firewall (WAF) is a cloud-based global security service that protects applications from malicious and unwanted internet traffic.

Which of the Oracle Cloud Infrastructure services support encryption of data at rest and in-transit? Choose TWO

A. OCI Block Volume

B. OCI File Storage

C. Local NVMe storage

D. OCI Virtual Cloud Network

Answer: A, B

OCI Block Volume and File Storage services provide data encryption at-rest and in-transit

Which of the below option is NOT recommended for securing your Oracle Cloud Infrastructure virtual cloud networks (VCN)?

A. VCN Private subnets

B. OCI Object Storage service

C. VCN Network Security Groups

D. VCN Security Lists

 

Answer: B

The Oracle Cloud Infrastructure Object Storage service is an internet-scale, high-performance storage platform that offers reliable and cost-efficient data durability.

Oracle cloud Infrastructure is compliant with which three industry standards?

A.      ISO/IEC 27001:2013—International Organization for Standardization 27001

B.      Health Care Compliance Association (HCCA)

C.      Health Insurance Portability and Accountability Act (HIPAA)

D.      SOC 1 – Systems and Organizational Controls 1

E.       CJIS – Criminal Justice Information Services

Answer: A, C, D

List of certifications is available here, https://www.oracle.com/cloud/cloud-infrastructure-compliance/

 

Pricing and Billing

You are running two compute instances in Oracle Cloud Infrastructure (OCI): VM.Standard2.1 and VM.Standard2.16.

Which of these two instances costs more per OCPU?

 

A. VM.Standard2.1

B. VM.Standard2.16

C. Both cost the same per OCPU

D. Depends on how many cores you use in your instance

 

Answer: C

In OCI, compute instances are priced per OCPU and both VM.Standard2.1 and VM.Standard2.16 belong to the same category (Compute – VM Standard – X7). 

Which of the following factors does NOT impact pricing in Oracle Cloud Infrastructure (OCI)?

A. Resource size

B. Resource type

C. Data transfer

D. Compartment size

 

Answer: D

Resource type, size and data transfer impact pricing but pricing is independent of compartments

Which of the following features help you set up budgets in Oracle Cloud Infrastructure (OCI)?

A. Free-form tags

B. Budget tags

C. Compartment tags

D. Cost-tracking tags

 

Answer: D

You can use cost-tracking tags to track resource usage and costs and set up budgets.

Which of the following are valid targets for setting Oracle Cloud Infrastructure (OCI) budgets? 
Choose TWO.

 

A. Compartment

B. Tenancy

C. IAM group

D. Cost-tracking tag

E. Budget tag

 

Answer: A, D

Budgets are set on cost tracking tags or on compartments to track all spending in that cost-tracking tag or for that compartment.

 

Where are Oracle Cloud Infrastructure (OCI) cost and usage reports stored?

A. User-specified object storage bucket

B. Oracle-owned object storage bucket

C. User-specified HTTPS end-point

D. OCI Cloud Shell

 

Answer: B

Both cost and usage reports are automatically generated daily, and stored in an Oracle-owned Object Storage bucket


Which two statements are true about Autonomous Database?

  1. It is built and operates on Exadata infrastructure.
  2. Users have access to the OS of the Autonomous Database stack.
  3. Customers are responsible for managing updates.
  4. It makes use of Machine Learning for database tuning.
Answer is 1 and 4


What is the maximum number of OCPUs that can be deployed for an Oracle DB on Bare Metal?

  1. 48
  2. 52
  3. 24
  4. 12

Answer is 52


Which are the three types of autonomous databases you can deploy?

  1. Autonomous Document Database
  2. Autonomous Ledger Database
  3. Autonomous Transaction Processing
  4. Autonomous JSON Database
  5. Autonomous Data Warehouse
Answer is 3,4 and 5

Which Autonomous Database edition provides Active Data Guard?

  1. Standard Edition 2
  2. Enterprise Edition High Performance
  3. Enterprise Edition Extreme Performance
  4. Enterprise Edition
Answer is -Enterprise Edition Extreme Performance

Which two features are available in the Enterprise Edition of Oracle Autonomous Database?

  1. Tablespace Encryption
  2. Oracle Rac
  3. Database In-Memory
  4. Data Guard
Answer is - 4. Data Guard


You have a mission critical application which requires to be globally available at all times

Which deployment strategy should you adopt?

      A) Use multiple Fault domains in each availability domain in one region

      B) Use multiple availability domains in one region

      C) Use multiple fault domains in one region

       D) Use multiple fault domains in any availability domain in multiple regions

 

Answer -D


Which Oracle Cloud Infrastructure service allows you to run code without provisioning any underlying infrastructure resources?

      A) Computer Service

      B) Storage Gateway

      C) Oracle container engine for Kubernetes

       D) Oracle functions

Answer -D


Which three methods can you use to create or modify Oracle Cloud Infrastructure (OCI)resources?

     A) Rest API

     B) OCI Desktop client

     C) Secure Shell

     D) OCI Console

     E) Command Line interface

     F) Remote Desktop protocol

     G) Serial Console Connection

Answer –A,D,E


which CANNOT be used with My Oracle Support (MOS)?

A) Add or change a tenancy administrator

B) Request a service limit increase 

C) Request  the password or unknow the account for the Tenancy Administrator

D) Troubleshoot your resources in oracle cloud infrastructure  free trial account


Answer -D


which is a key benefit of using oracle cloud infrastructure autonomous data warehouse?

A) No username or password required

B) Scale both CPU and storage without downtime

C) Apply database patches as they become available.

D) Maintain Root level access to underlying operating system


Answer -B 


which 3 components are part of OCI identity and access managementservice?

A) region subnets

B) Policies

C) Users

D) Compute Instances

E) Dynamic Groups

F) Roles

G) Virtual Cloud Networks


Answer- B,C,E


Which OCI storage service can be used to meet the requirement?

A) File Storage 

B) Block Volume 

C) Archive Storage

D) Object Storage


Answer-A

what does compute instance horizonal scaling mean?

A) Stopping/Starting Instance

B) Backing up data to object storage

C) adding additional compute instances

D) Changing compute instance size


Answer-C


 OCI budgets can be set on which two options?

A) Cost tracking tracks

B) free-form tags

C) Compartments

D) Virtual Cloud Network

E) Tenancy 


Answer -A,C


You are analyzing your Oracle cloud infrastructure usage with cost analysis tool in OCI console 

which is NOT a default feature of tool?

A) filter cost by applications

B) filter cost by compartments

C) filter cost by tags

D) filter cost by date


Answer -A


which OCI Identity and access management capability helps you to organize multiple users into teams?

A) Policies 

B) Groups 

C) Dynamic groups

D) Users


Answer-B


 what is the frequency of OCI usage report generation?


A) Weekly 

B) Monthly 

C) Annually 

D) Daily 


Answer-D


which service is the most effective for moving large amounts of data from your on-premises to OCI?

A) Data Transfer Appliance 

B) Data Safe

C) Internet Gateway 

D) Dynamic routing gateway 


Answer-A


which capability can be used to protect against unexpected hardware or power supply failures within an availability domain?

A) Fault Domains

B) Compartments

C) Top of rack Switches

D) Power distribution units

Answer- A


A Customer looking to migrate their old database backups from their on premises data center to Oracle Cloud Infrastructure .

Which OCI service is most effective ?

A) File Storage

B) Object Storage (Standard)

C) Block Volume 

D) Archive Storage


Answer -D



A banking platform is redesigned to a microservices based architecture using docker containers for deployment.

Which service can you use to deploy containers on Oracle cloud infrastructure (OCI)?

A) Container engine for Kubernetes (OKE)

B) Streaming Service

C) API Gateway 

D) File Storage Service


Answer- A

 You are setting up a proof of concept (POC) and need to quickly establish a secure connection between on premise datacenter and Oracle cloud infrastructure(OCI) 

Which OCI service should you implement?

A) VCN peering 

B) FastConnect

C) Internet Gateway

D) IPSec VPN


Answer -D


Which is not available as part of Oracle cloud free Tier?

A) Oracle Cloud monitoring 

B) Oracle Cloud Exadata DB systems

C) Oracle Cloud Infrastructure autonomous data warehouse

D) Oracle Cloud Infrastructure Compute

Answer -B


Which oracle cloud infrastructure service can be used to protect sensitive and regulated data in OCI database services?

A) Oracle Data Guard

B) OCI Audit

C) Oracle Data Safe

D) OCI OS management 


Answer- C


A customer wants dedicated connection with minimum network latency from their on premises datacenter to Oracle cloud infrastructure 

which service they should choose?

A) Public Internet

B) Virtual cloud network remote pairing 

C) OCI fastconnect 

D) IPSec Virtual Private Network (VPN)


Answer- C


What do the term OpEx and CapEx refer to?

A) OpEx refers to Operational Excellance and CapEx refers to Capital Excellence

B) OpEx refers to Operational Expenditure and CapEx refers to Capital Expenditure 

C) OpEx refers to Operational Expansion and CapEx refers to Capital Expenses

D) OpEx refers to Operational Example and CapEx refers to Capital Example.


Answer -B 


Which feature is NOT a  component of Oracle Cloud Infrastructure(OCI)  and Access Management Service?

A) User Credential

B) Network Security Group

C) Federation 

D) Policies 


Answer-B


Which gateway can be used to provide internet access to an Oracle cloud infrastructure compute instances in private subnet ?

A) NAT Gateway 

B) Service Gateway 

C) Dynamic Routing Gateway 

D) Internet Gateway


Answer-A


Which two should be considered when designing fault tolerant solution in Oracle cloud infrastructure (OCI)?

A) Ensuring your solution compartments are distributed across OCI Fault domains

B) Performing data integrity check when using OCI File Storage Service

C) Writing custom script that will monitor your solution 

D) Using Multiple OCI availability domains(AD),where available to deploy your solution 

E) Creating a manual cluster of compute instances

Answer-A,D


Which is not covered by Oracle cloud Infrastructure Service level agreement(SLA)?

A) Manageability

B) Performance

C) Reliability 

D) Availability 


Answer- C


Which is not required to register and log support request in My Oracle Support(MOS)?

A)Your Customer Support Identifies

B) Your Account password

C) Your Tenancy OCID (Oracle Cloud Identifier)

D) Your Resource OCID (Oracle Cloud Identifier)


Answer-B

Which Cloud infrastructure (OCI) Service can send you an alert when you might exceed your spending threshold ?

A) Budgets

B) Monitoring 

C) Streaming 

D) Events

Answer-A


Which Feature allows you to logically group and isolate your Oracle Cloud Infrastructure resources?

A) Tenancy 

B) Identity and Access management Group 

C) Compartments

D) Availability Domain

Answer-C


Which is not available to you whenever Oracle Cloud Infrastructure creates or resolves an incident?

A) Twitter Notification

B) Text Message Notification

C) Email Notification

D) Webhook Notification

Answer-A


Oracle Cloud infrastructure is compatible with which three standards?

A) SOC1 Type 2 and SOC2  Type 2 attestation 

B) NERC Critical infrastructure Protection standards

C) Health insurance portability and accountability Act(HIPPA)

D) ISO 27001 :2013 certification

E) Health care compliance association 

Answer- A,C,D

What does Oracle Payment Card industry Data security standards (PCI DSS) attestation provide to customer?

A) Customer can use these services for workloads that provides validation of card holder transaction        but only as third part vendor 

B) Customer can use these service for workload that process or transmit cardholder data but not share it

C) Customer can use these services for workloads that processes application for credit card approval securely 

D) Customer can use these services for workloads that store,process and transmit card holder data


Answer -D


 According to shared security model, Which two are a customer’s responsibilities inn OCI?

A) Physical security of OCI data center facilities

B) Virtual Machine hypervisor 

C) Local NMVe data persistence

D) Customer data

E) Object Storage data durability


Answer- D,E


Which describes key benefit of using Oracle cloud infrastructure ?

A) with OCI ,you can only run java based workloads on bare metal

B) With OCI ,you can only run cloud native workloads

C) Only care metal workloads are supported on OCI

D) OCI offers consistent performance with predictable pricing model

Answer-D



A New Customer has logged into oracle cloud infrastructure (OCI)  as an administrator for the first time. The Admin would like to deploy infrastructure into a region other than their home region

What is first step it must take to accomplish this task?

A) User API endpoints to create resources in desired region

B) Navigate to the desired region and begin creating resources 

C) Subscribe to the desired region

D) File a service request for access to each additional region

Answer- C


Which is NOT part of Oracle cloud always free eligible resources that you can provision in your tenancy ?

A) Fast connect (1 Gbps public peering )

B) Autonomous database (up to two database instances)

C) Block Volume (upto 100 GB total storage)

D) Load balancing (One load balancer)


Answer -A


Which service level agreement type  is NOT offered by Oracle Cloud Infrastrucutre Service?

A) Data plane

B) Performance

C) Application Plane 

D) Control Plane

Answer -C



Which statement about Oracle cloud infrastructure shared security model is true?

A) You are responsible for managing security controls within the physical OCI network?

B) You are not responsible for any aspect of security in OCI

C) You are responsible for securing all data that you place in OCI

D) You are responsible for securing all data that you place in OCI

Answer-C)


Which Oracle Cloud infrastructure service leverages Terraform to configure Infrastructure as code ?

A) Resource Manager 

B) Events

C) Compartment Explorer

D) Oracle fucntions


Answer-A


Which two are enabled by Oracle Cloud infrastructure fault domains?

A) Protect against unexpected hardware or power supply failures

B) To meet requirement for legal jurisdiction

C) To mitigate risk of large scale events such as  earthquakes 

D) Build replicated system for disaster recovery 

E) Protect against planned hardware maintenance

Answer-A,E


Which should you use t distribute incoming traffic between set of web servers?

A) Load balancer 

B) Internet gateway 

C) Autoscaling 

D) Dynamic Routing Gateway


Answer- A)


Which Three services with oracle cloud infrastructure Key management?

A) Functions

B) Block Volume 

C) Object storage 

D) Auto Scaling 

E) Identity and Access management

F) File Storage


Answer- B,F,C


Which statement accurately describes Oracle Cloud infrastructure region ?

A) Each availability Domain has single Fault domain

B) Each availability domain has three fault domain

C) Each Fault domain has multiple fault domains

D) Each region has single Fault Domain

Answer -B


Which characteristics are defined by an Oracle Cloud infrastructure Compute shape?

A) Number of vCPU ,Amount of RAM,Bandwidth

B) Availability domain and fault domain locations

C) Public or private visibility of compute instance

D) Number of OCPU ,Amount of RAM ,bandwidth


Answer-D

You want to migrate mission critical Oracle E-business Suite application to Oracle Cloud Infrastructure (OCI) with full control and access to underlying infrastructure 

Which options meets this requirement?

A) Replace E-Business suite with Oracle Saas Application

B) OCI Exadata DB systems and OCI Compute instances

C) OCI Exadata DB systems and  Oracle functions

D) Oracle Exadata Cloud at customer,Storage gateway and API Gateway

Answer-C