<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Liana Lixandru on Medium]]></title>
        <description><![CDATA[Stories by Liana Lixandru on Medium]]></description>
        <link>https://medium.com/@liana.lixandru?source=rss-89d70869662------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fjMjabo_haHjBLjALX7uUA.jpeg</url>
            <title>Stories by Liana Lixandru on Medium</title>
            <link>https://medium.com/@liana.lixandru?source=rss-89d70869662------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 23:56:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@liana.lixandru/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Let’s get a taste of Macaron from Oracle Labs — performing SLSA checks with style]]></title>
            <link>https://medium.com/@liana.lixandru/lets-get-a-taste-of-macaron-from-oracle-labs-performing-slsa-checks-with-style-ba48b3b858d3?source=rss-89d70869662------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba48b3b858d3</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[oci]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[slsa]]></category>
            <dc:creator><![CDATA[Liana Lixandru]]></dc:creator>
            <pubDate>Thu, 25 May 2023 11:37:52 GMT</pubDate>
            <atom:updated>2023-05-25T11:45:59.034Z</atom:updated>
            <content:encoded><![CDATA[<h3>Let’s get a taste of Macaron from Oracle Labs — performing SLSA checks with style</h3><h4>Join me to take a quick look at this new open-source project from Oracle, that analyses software artifact build pipelines to verify their conformance with supply chain security frameworks and prevent build integrity attacks.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vRu_sISfXi6H6XLtEe0ffg.jpeg" /></figure><p>Macaron is a supply chain security analysis tool from <a href="https://labs.oracle.com/pls/apex/r/labs/labs/intro">Oracle Labs</a>, which focuses on the build integrity of an artifact and the artifact dependencies.</p><p>It is based on the <a href="https://slsa.dev/">Supply chain Levels for Software Artifacts (SLSA)</a> specification, which aims at preventing some of the software supply chain attacks as the systems get more complex, especially with respect to the use of open-source third-party code in applications.</p><p>Possible attacks may include stealing credentials, injecting malicious code etc., and it is critical to have security assurance on the third-party code to guarantee that the integrity of the code has not been compromised.</p><p>Macaron defines concrete rules for protecting software integrity that can be checked for compliance requirements automatically. It provides a customisable checker platform that makes it easy to define checks that depend on each other.</p><p>This is particularly useful for implementing checks for SLSA levels. In addition, Macaron also checks a user-specified policy for the repository to detect unexpected behaviour in the build process.</p><p><a href="https://github.com/oracle-samples/macaron">GitHub - oracle-samples/macaron: Macaron is a supply chain security analysis tool from Oracle Labs that checks conformance to SLSA framework.</a></p><blockquote>This is a work-in-progress project and currently supports Maven and Gradle Java build systems. Support has also been added for Python projects that use Pip or Poetry as their package managers, minus dependency analysis. We plan to support build systems for other languages in future.</blockquote><h3>Case Study</h3><p>Let’s take a look at how Macaron works, by using the Micronaut MuShop example.</p><p><a href="https://github.com/oracle-quickstart/oci-micronaut">GitHub - oracle-quickstart/oci-micronaut: Micronaut MuShop - Cloud Native microservices demo for Oracle Cloud Infrastructure</a></p><p>This is a cloud-native microservices sample for Oracle Cloud Infrastructure.</p><h4>Prerequisites</h4><ul><li>Python 3.11</li><li>Go 1.18</li><li>JDK 17</li></ul><h4>Preparing the environment</h4><p>Clone the project and install Macaron.</p><pre>make venv<br>. .venv/bin/activate<br>make setup</pre><blockquote>Note: Running the above command will prompt you for sudo access to install Soufflé Datalog engine.</blockquote><blockquote>You can install Soufflé on your system before running make setup to avoid getting prompted.</blockquote><blockquote>If you’re running this on MacOS instead of a Linux distribution, consider installing Soufflé by running brew install souffle first.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ETbfdDTggeKWze2WXbD_RQ.png" /><figcaption>make setup execution</figcaption></figure><h4>Running Macaron</h4><pre>usage: macaron [-h] [-v] [-o OUTPUT_DIR] {analyze,dump-defaults,verify-policy} ...</pre><p>The main parameters for Macaron are:</p><ul><li>[-v]: Run Macaron with more debug outputs.</li><li>[-o OUTPUT_DIR]: The directory to store the results. The default value will be the Macaron repo path.</li></ul><p>Apart from the main parameters listed above, you should choose the command to run, which requires other parameters. At the moment, Macaron has three commands.</p><ul><li>analyze: analyze the SLSA level of a single repository.</li><li>dump-defaults: dump the default values in the output directory.</li><li>verify-policy: verify a Datalog policy.</li></ul><h4>Obtaining the GitHub personal access token</h4><p>In order to use Macaron, you have to create your own Github access token (please refer to the instructions <a href="https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token">here</a>). When creating this token, make sure to assign at least repo permissions.</p><p>The GitHub token should be stored in an environment variable called GITHUB_TOKEN. Macaron will read the value of this Github token from the environment variable only if we use the analyze command (see instructions below).</p><h4>Analysing the SLSA levels of a repository</h4><pre>export GITHUB_TOKEN=&quot;&lt;your token here&gt;&quot;</pre><pre>python -m macaron [-v] analyze -rp &lt;path_to_target_repo&gt; [-b &lt;branch_name&gt;] [-d &lt;digest&gt;] -c &lt;config_path&gt; [-sbom &lt;sbom_path&gt;]</pre><blockquote>Note: for the rest of this section, we assume that the Github access token has been set as GITHUB_TOKEN environment variable.</blockquote><p>When we run Macaron on the Micronaut MuShop GitHub project, it automatically finds the project’s dependencies and runs checks for the top-level project and dependencies.</p><p>Analysing the GitHub repository of MuShop:</p><pre>python -m macaron -o output analyze -rp https://github.com/oracle-quickstart/oci-micronaut.git</pre><p>Doing the same thing as above, but using a config file:</p><pre>python -m macaron -o output analyze -c &lt;path-to-maven_config.yaml&gt;</pre><pre>target:<br>  id: &quot;oracle-quickstart/oci-micronaut&quot;<br>  branch: &quot;&quot;<br>  digest: &quot;&quot;<br>  path: &quot;https://github.com/oracle-quickstart/oci-micronaut.git&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yLEd3u9aVdSeYpVMAPpQyg.png" /><figcaption>Running macaron analyze</figcaption></figure><p>For the Micronaut MuShop project, Macaron identifies 48 dependencies that map to 24 unique repositories and generates an HTML report that summarises the check results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2rEjV5a-99udpnyS6fzs-Q.png" /><figcaption>The output is generated in the reports folder</figcaption></figure><p>The results show that 11 dependencies out of 24 produce SLSA <em>Level 3 </em>provenance documents and meet expectations, and 20 dependencies meet the build service requirement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*89PQB1Jy9GHJjSWdxVIEbQ.png" /><figcaption>The generated report</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ApokAkvY_TZ-FU2qbfr-A.png" /><figcaption>Macaron checks report</figcaption></figure><p>Currently the dependencies produced by Micronaut projects have a better security posture compared to other dependencies used by the Micronaut MuShop project because they produce non-falsifiable Level 3 provenance documents in their build pipelines.</p><p>For example, the <a href="https://github.com/micronaut-projects/micronaut-core">micronaut-core</a> project produces a provenance document called <em>multiple.intoto.jsonl </em>that attests to the artifacts in the <em>artifacts.zip </em>file as part of its <a href="https://github.com/micronaut-projects/micronaut-core/releases/tag/v3.9.0">GitHub release</a>. To read the content of the provenance document, use the following command:</p><pre>cat multiple.intoto.jsonl | jq -r &#39;.payload&#39; | base64 - decode | jq</pre><p>In principle, we can add a build expectation in the form of a <a href="https://cuelang.org/">Configure Unify Execute</a> (CUE) policy to ensure that Micronaut artifacts are actually generated by the Micronaut repository’s workflows and have not been tampered with by attackers. The provenance expectation check in Macaron uses expectation CUE files to verify if the expectations for Micronaut dependencies are satisfied.</p><p>Macaron’s policy engine accepts as input <a href="https://en.wikipedia.org/wiki/Datalog">Datalog</a> to specify the policy that needs to be satisfied.</p><p>An example policy can verify if the Micronaut MuShop project and all its dependencies pass the build service check and the Micronaut provenance documents meet expectations.</p><p>Thanks to Datalog’s expressive language model, it’s easy to add exception rules if certain dependencies do not meet a requirement. For example, the <a href="https://github.com/mysql/mysql-connector-j">Mysql Connector/J</a> dependency in the Micronaut MuShop project does not pass the build service check, but can be manually investigated and exempted if trusted.</p><p>Overall, policies expressed in Datalog can be enforced by Macaron as part of your CI/CD pipeline to detect regressions or unexpected behavior.</p><h3>Verifying a policy</h3><p>Macaron, currently, provides a PoC policy engine that checks a verified SLSA provenance against compliance requirements expressed as a policy. The result is reported in the JSON and HTML reports as a check called mcn_provenance_expectation_1.</p><pre>python -m macaron analyze -rp https://github.com/oracle-quickstart/oci-micronaut.git -pe &lt;path-to-provenance expectation&gt;</pre><p>The policy is a YAML file that contains expected values of predicates in SLSA provenance v0.2. Here is an example policy file:</p><pre>metadata:<br>  id: MACARON_1<br>  description: &quot;Micronaut policy - SLSA provenance v0.2.&quot;<br>definition:<br>  _type: https://in-toto.io/Statement/v0.1<br>  predicateType: https://slsa.dev/provenance/v0.2<br>  predicate:<br>    builder:<br>      id: https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@refs/tags/v1.2.1<br>    buildType: https://github.com/slsa-framework/slsa-github-generator/generic@v1<br>    invocation:<br>      configSource:<br>        uri: git+https://github.com/micronaut-projects/micronaut-security@refs/tags/v3.8.3<br>        entryPoint: .github/workflows/release.yml</pre><p>You can also run the policy verifier directly like below:</p><pre>python -m macaron verify-policy -d &lt;path-to-macaron.db&gt; -f &lt;path-to-the-policy&gt; [-s]</pre><blockquote>Note. The policy engine is under active development and will support more complex policies soon. Stay tuned.</blockquote><p>Please <a href="https://github.com/oracle-samples/macaron/discussions/171">let us know</a> what you think about Macaron. We look forward to feedback and contributions from the community.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba48b3b858d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Oracle Database 23c Free — Developer Release on Kubernetes with Helm]]></title>
            <link>https://medium.com/@liana.lixandru/deploying-oracle-database-23c-free-developer-release-on-kubernetes-with-helm-4b2542566bea?source=rss-89d70869662------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b2542566bea</guid>
            <category><![CDATA[oracle-database-23c]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[oke]]></category>
            <category><![CDATA[oracle-database]]></category>
            <dc:creator><![CDATA[Liana Lixandru]]></dc:creator>
            <pubDate>Fri, 28 Apr 2023 09:30:56 GMT</pubDate>
            <atom:updated>2023-04-29T09:25:18.519Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deploying Oracle Database 23c Free — Developer Release on Kubernetes with Helm</h3><h4>Whether you are a developer, a data scientist, a DBA, an educator, or just interested in databases, Oracle Database 23c Free — Developer Release is the ideal way to get started. Let’s take a look at how we can deploy it to a Kubernetes cluster.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2mc3cKq1vQHFP42RiuvSEQ.jpeg" /><figcaption>Oracle Database 23c Free — Developer Release is now available</figcaption></figure><p>In this article, we’ll be focusing on the deployment to Oracle Container Engine for Kubernetes (OKE). You can also get Oracle Database 23c — Developer Release as a container image, a VM or a package on Linux. Scroll down to the bottom of this article for more installation options.</p><p>So, let’s get started. First off, we need to create a cluster in OKE if we don’t have one available already. As a reminder, a lot of new features have been added to OKE recently, including support for enhanced clusters which come with many advantages.</p><p><strong>Enhanced clusters</strong> provide you with all the available features, including features not supported by basic clusters, enabling you to:</p><ul><li>Simplify node management through the use of virtual nodes.</li><li>Deploy and configure cluster add-ons in a more granular way.</li><li>Strengthen cluster security through the use of workload identity.</li><li>Provision more worker nodes in the cluster.</li><li>Rely on a financially-backed service level agreement (SLA) tied to Kubernetes API server uptime and availability.</li></ul><h3>Creating a new cluster in OKE</h3><blockquote>You can of course skip this step if you already have created a cluster, and move on to the deployment section of the article.</blockquote><p>We have multiple ways of achieving this, either from a local machine by using the OCI command line interface, through REST API calls, or directly from the dashboard UI.</p><p>Let’s head on over to the <strong>Console</strong> — <strong>Developer Services</strong> — <strong>Kubernetes Clusters (OKE) </strong>under Containers &amp; Artifacts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iWZCqM28gpkgDuInmZTXqQ.png" /><figcaption>Navigating to the OKE service</figcaption></figure><p>Once on that page, we’ll click on <strong>Create Cluster </strong>and pick Quick Create:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3KP3gIBpjJFuKmPLLzbJg.png" /><figcaption>Quick Create Wizard for OKE</figcaption></figure><p>In the wizard, we also have the option to pick the new type of node, virtual nodes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UQPSIMvZ7X6RjHi-ES8tfQ.png" /><figcaption>Selecting Virtual Nodes as the type in the OKE Wizard</figcaption></figure><p>Clicking on <strong>Next,</strong> and then <strong>Create Cluster</strong> on the Review page will start all the tasks to create our cluster and give it access to the network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ENM9Rn5VgRMu6Ff5VxUCcA.png" /><figcaption>Creating the cluster</figcaption></figure><p>Once our cluster status switches to Available, we can go ahead and click on <strong>Access Cluster</strong> and follow the guide to add our new cluster to ~/.kube/config , in order to be able to manage it locally through the OCI command line interface.</p><p>You can also pick Cloud Shell Access if you’d rather do it all from the Console and don’t want to configure kubectl locally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URwlJWQ9VOlGMQcKgiI3Rw.png" /><figcaption>Access Cluster interface</figcaption></figure><p>Once that’s done and we can access our cluster via kubectl , we can go ahead and deploy Oracle Database 23c Free — Developer Release on it.</p><h3>Deploying Oracle Database 23c Free to OKE with Helm</h3><p>For ease of use, I used the existing <a href="https://github.com/oracle/docker-images/tree/main/OracleDatabase/SingleInstance/helm-charts/oracle-db">oracle-db</a> Helm chart as a base and modified it for 23c Free. You can clone the modified chart from the GitHub repo below:</p><p><a href="https://github.com/llixandru/oracle-db23c-free">GitHub - llixandru/oracle-db23c-free: Helm chart for Oracle Database 23c Free - Developer Release</a></p><p>For this helm chart, we’re using the image available on the Oracle Container registry: <a href="https://container-registry.oracle.com/">container-registry.oracle.com</a>.</p><p>Clone the repo and execute the following command to generate oracle-db23c-free-1.0.0.tgz:</p><pre>$ helm package oracle-db23c-free</pre><h3>Installing the Chart</h3><p>To install the chart with the release name db23cfree:</p><pre>$ helm install db23cfree oracle-db23c-free-1.0.0.tgz</pre><p>The command deploys Oracle Database 23c Free on the Kubernetes cluster in the default configuration.</p><h3>Uninstalling the Chart</h3><p>To uninstall/delete the db23cfree deployment:</p><pre>$ helm uninstall db23cfree</pre><p>The command removes all the Kubernetes components associated with the chart and deletes the release.</p><h3>Configuration</h3><p>Check out the README of the GitHub repo to see which parameters are configurable. ORACLE_SID and ORACLE_PDB are not configurable for Oracle Database 23c Free — Developer Release.</p><pre>ORACLE_SID = FREE<br>ORACLE_PDB = FREEPDB1</pre><p>Specify each parameter using the --set key=value[,key=value] argument to helm install.</p><h4>Deploying the Helm chart with a custom password</h4><p>To deploy the chart and set a custom password for the SYS, SYSTEM, and PDBADMIN administrative user accounts, instead of the auto-generated one:</p><pre>$ helm install db23cfree --set oracle_pwd=&lt;your_password&gt; oracle-db23c-free-1.0.0.tgz</pre><p>The above command sets the Oracle Database password to &lt;your_password&gt;.</p><blockquote>Oracle recommends that your password should be at least 8 characters in length, contain at least 1 upper case character, 1 lower case character and, 1 digit [0–9].</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U4CvNLDhayc0GCV_mLP7GQ.png" /><figcaption>Checking deployment status with kubectl</figcaption></figure><h3>Connecting to Oracle Database 23c Free — Developer Release</h3><p>Let’s see how we can connect to our newly deployed database.</p><pre>$ kubectl get pods</pre><p>Connecting to the Container Database (CDB) as SYSDBA:</p><pre>$ kubectl exec -it pods/pod-name -- sqlplus sys/&lt;your_password&gt;@FREE as sysdba</pre><p>Connecting to the Pluggable Database (PDB) as SYSDBA:</p><pre>$ kubectl exec -it pods/pod-name -- sqlplus sys/&lt;your_password&gt;@FREEPDB1 as sysdba</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QVLDW1n9ZuuPjdEL4Vrs1g.png" /><figcaption>Connecting to the database running on OKE</figcaption></figure><h3>Other installation options</h3><p>You can also get Oracle Database 23c — Developer Release as a container image, a VM or a package on Linux.</p><p>Be sure to check out the link below if you’re interested in any of these options:</p><p><a href="https://www.oracle.com/database/free/get-started/">Free Oracle Database - Quick Start Guide</a></p><p>I’ve also explored in a different article how we can install Oracle Database 23c Free — Deveoper Release on a compute instance running Oracle Linux 8 in OCI:</p><p><a href="https://medium.com/@liana.lixandru/how-to-set-up-oracle-database-23c-developer-release-and-ords-on-oci-2207f41c3d57">How to set up Oracle Database 23c — Developer Release and ORDS on OCI</a></p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b2542566bea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Yo! Let’s manage OCI instances like pros]]></title>
            <link>https://awstip.com/yo-lets-manage-oci-instances-like-pros-215e2a843866?source=rss-89d70869662------2</link>
            <guid isPermaLink="false">https://medium.com/p/215e2a843866</guid>
            <category><![CDATA[instance-management]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[oci]]></category>
            <category><![CDATA[oracle]]></category>
            <dc:creator><![CDATA[Liana Lixandru]]></dc:creator>
            <pubDate>Tue, 25 Apr 2023 19:15:02 GMT</pubDate>
            <atom:updated>2023-05-02T14:43:19.842Z</atom:updated>
            <content:encoded><![CDATA[<h4>Yo is an open source command-line client for managing OCI compute instances. It makes launching OCI instances as simple as telling your computer “yo, launch an instance”.</h4><blockquote>Yo was originally designed to help developers in the Oracle Linux team quickly launch disposable VMs for testing, but is slowly gaining users outside of OL.</blockquote><p>Here are some examples of how yo tries to improve on the OCI command line and browser tools:</p><ul><li>yo <strong>hides</strong> other people’s VMs from you, so you can just manage your own instances.</li><li>yo <strong>doesn’t make you type</strong> any more than you need. Compartment IDs, common shape configurations, etc can all be stored in your config. It really can be as simple as yo launch (or, for the lazier, yo la).</li><li>yo lets you refer to your instances <strong>by name</strong>. You should never need to memorize an IP address again.</li><li>yo aggressively <strong>caches data</strong> to make operations as quick as possible.</li></ul><h3>Sounds interesting? Let’s take a look at how it works.</h3><blockquote>A minimum of Python 3.6 is required in order to use Yo.</blockquote><p>Check out the GitHub repo here:</p><p><a href="https://github.com/oracle-samples/yo">GitHub - oracle-samples/yo: A fast and simple command line OCI client</a></p><p>Installing via pip:</p><pre>pip install yo oci-cli</pre><p>It’s recommended that you use the above command to install yo. If you run it as a non-root user, it will install to your home directory. The above will also install the oci-clipackage, which will help you configure yo.</p><h3>Initial Configuration</h3><p>If you run yo at this point, you should be greeted by a message asking you to configure OCI and/or yo.</p><h3>OCI Configuration</h3><p>yo depends on the OCI SDK in order to manage your compute instances. If yo is installed, then the oci command line utility should also be alongside it.</p><p>If it’s a fresh install of oci-cli, the OCI SDK requires some keys to be created and associated with your account, but thankfully, this can be easily achieved with the command:</p><pre>oci setup bootstrap</pre><p>Follow the prompts to authenticate with your tenancy. If you don’t know your region, open the OCI Web UI and see what it defaults to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sVQKYGvjfYzFClCPlsq_Yg.png" /><figcaption>Starting up the OCI setup bootstrap</figcaption></figure><blockquote>If you already have oci-cli and a config file set up, you can skip this step.</blockquote><p>For more information, check out the <a href="https://oracle-samples.github.io/yo/install.html">documentation</a>.</p><h3>Yo Configuration</h3><p>The Yo configuration is stored inside .oci/yo.ini . You can use it to customise the types of instances that you want to create, and add a compartment, VCN, subnet and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x7luMa6MbbU1utWy4ydNBw.png" /><figcaption>yo.ini configuration file</figcaption></figure><p>Yo allows you to create “Instance Profiles” in the configuration file.</p><p>These specify details such as the operating system, shape, name, availability domain, and SSH keys. You can refer to these by name and simply launch an instance from a profile.</p><h3>Using Yo</h3><p>Let’s launch an instance:</p><pre>yo launch [-p PROFILE]</pre><p>If you don’t specify -p, you’ll use the DEFAULT profile instead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yd3c0jp9Qfj72lP0nXirQw.png" /><figcaption>yo launch</figcaption></figure><p>But what if we want to configure the instance a bit more? Let’s say we want a different shape, which we’ll pick from the list returned by yo shapes and then a custom number of cores and memory:</p><pre>yo shapes<br><br>yo launch -S VM.Standard.E4.Flex --cpu 3 --mem 12</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ANCjLiPpw7I92woV8MIVkQ.png" /><figcaption>yo launch with custom choices</figcaption></figure><p>Let’s try to list all the instances in my compartment:</p><pre>yo list</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BsgxfBb8rho7JaDOG25IOA.png" /><figcaption>yo list</figcaption></figure><p>And if we want to terminate an instance we don’t need anymore?</p><pre>yo terminate instance</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XJyECGXGN152_g5yhUv4aQ.png" /><figcaption>yo terminate</figcaption></figure><p>Check out all the available commands below:</p><p><a href="https://oracle-samples.github.io/yo/guide/commands.html">yo</a></p><p>And if you want to contribute, feel free to!</p><h4>Happy coding!</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=215e2a843866" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/yo-lets-manage-oci-instances-like-pros-215e2a843866">Yo! Let’s manage OCI instances like pros</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring JSON-Relational Duality Views in Oracle Database 23c Free — Developer Release]]></title>
            <link>https://medium.com/@liana.lixandru/exploring-json-relational-duality-views-in-oracle-database-23c-free-developer-release-5f57555157f8?source=rss-89d70869662------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f57555157f8</guid>
            <category><![CDATA[oracle-database-23c]]></category>
            <category><![CDATA[oracle-database]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <dc:creator><![CDATA[Liana Lixandru]]></dc:creator>
            <pubDate>Thu, 13 Apr 2023 09:27:11 GMT</pubDate>
            <atom:updated>2023-04-26T12:05:07.897Z</atom:updated>
            <content:encoded><![CDATA[<h3>Exploring JSON-Relational Duality Views in Oracle Database 23c Free — Developer Release</h3><h4>JSON-relational duality views combine the advantages of using JSON documents with the advantages of the relational model, while avoiding the limitations of each. It exposes data stored in relational tables as JSON documents, which are <em>generated</em> on demand, not stored as such.</h4><h4>Let’s take an in-depth look at how we can use this new and exciting feature with REST APIs via ORDS.</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6CXGz5V920E%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6CXGz5V920E&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F6CXGz5V920E%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3c6d8d9931e7e29fd4bf1483ea7e385/href">https://medium.com/media/a3c6d8d9931e7e29fd4bf1483ea7e385/href</a></iframe><p>To access JSON-Relational duality views through REST APIs, Oracle REST Data Services (ORDS) version 23.1 needs to be installed and configured for your 23c Database.</p><blockquote>If you’re looking for an installation guide, make sure to check out the link below.</blockquote><p><a href="https://medium.com/@liana.lixandru/how-to-set-up-oracle-database-23c-developer-release-and-ords-on-oci-2207f41c3d57">How to set up Oracle Database 23c — Developer Release and ORDS on OCI</a></p><h3>What are JSON-Relational Duality Views?</h3><p>Duality views give your data both a <strong>conceptual</strong> and an <strong>operational</strong> <strong>duality</strong>: it’s organized both <em>relationally and hierarchically</em>.</p><p>You can base different duality views on data stored in one or more of the same tables, providing different JSON hierarchies over the same, shared data.</p><p>This means that applications can access (create, query, modify) the same data as a set of <em>JSON documents</em> or as a set of <em>related tables and columns</em>, and both approaches can be employed at the same time.</p><h3>How are JSON-Relational Duality Views used?</h3><p><strong>Document-centric applications</strong> can use document APIs, such as Oracle Database API for MongoDB, and Oracle REST Data Services (ORDS), or they can use SQL/JSON document functions.</p><p>You can manipulate documents realized by duality views in the ways you’re used to, using your usual drivers, frameworks, tools, and development methods. In particular, applications can use any programming languages — JSON documents are the <em>lingua franca</em>.</p><p><strong>Other applications</strong>, such as database analytics, reporting, and machine learning, can make use of the same data directly, relationally (as a set of table rows and columns), using languages such as <em>SQL</em>, <em>PL/SQL</em>, <em>C</em>, and <em>JavaScript</em>. You need not adapt an existing database feature or code that makes use of table data to instead use JSON documents.</p><p>A duality view can be read-only or completely or partially <em>updatable</em>, depending on how you define it. You can define a duality view, and its updatability, <em>declaratively</em> (what/where, not how), using SQL or a subset of the <a href="https://graphql.org/">GraphQL</a> language.</p><h3>How do modifications work?</h3><p>When you modify a duality view — to insert, delete, or update JSON <em>documents</em>, the relevant relational (table) data underlying the view is <strong>automatically</strong> updated accordingly.</p><p>Conversely, if you <em>modify data in tables</em> that underlie one or more duality views then those changes are <strong>automatically</strong> and <strong>immediately</strong> reflected in the documents supported by those views.</p><h3>Car Racing Example</h3><p>Let’s start exploring JSON-relational duality views using the car racing example below.</p><blockquote>For this exercise, I will be using Visual Studio Code with the <a href="https://marketplace.visualstudio.com/items?itemName=Oracle.oracledevtools">Oracle Developer Tools</a> and <a href="https://marketplace.visualstudio.com/items?itemName=rangav.vscode-thunder-client">Thunder Client</a> extensions installed, to access Oracle Database and the ORDS APIs, respectively. Please feel free to use the IDEs or applications you’re most comfortable with.</blockquote><p>Data for Formula 1 car races is used in this example to present the new features. We suppose a document-centric application that uses three kinds of JSON documents: <strong>driver</strong>, <strong>race</strong>, and <strong>team</strong>. Each of these kinds shares some data with another kind. For example:</p><ul><li>A <em>driver document</em> includes, in its information about a driver, identification of the driver’s <em>team</em> and information about the <em>races</em>the driver has participated in.</li><li>A <em>race document</em> includes, in its information about a particular race, information about the podium standings (first-, second-, and third-place winners), and the results for each <em>driver</em> in the race. Both of these include driver and <em>team</em> names. The racing data is for a single season of racing.</li><li>A <em>team document</em> includes, in its information about a team, information about the <em>drivers</em> on the team.</li></ul><p>Operations the application might perform on this data include the following:</p><ul><li>Adding or removing a driver, race, or team to/from the database</li><li>Updating the information for a driver, race, or team</li><li>Adding a driver to a team, removing a driver from a team, or moving a driver from one team to another</li><li>Adding race results to the driver and race information</li></ul><h3>Setting up the schema and enabling ORDS</h3><ul><li>In Visual Studio Code — Oracle Developer Tools, connect to your Oracle Database 23c — Developer Release as sysdba:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UKAA7x5Kzm60yhnzuceFmA.png" /><figcaption>Connecting to Oracle Database 23c — Developer Release as sysdba</figcaption></figure><p>The <strong>tnsnames.ora</strong> file that we’re using in Visual Studio Code looks like this, where you should replace the [IP] placeholder with the IP address of your Compute instance:</p><pre># tnsnames.ora Network Configuration File<br>FREE =<br>  (DESCRIPTION =<br>    (ADDRESS = (PROTOCOL = TCP)(HOST = [IP])(PORT = 1521))<br>    (CONNECT_DATA =<br>      (SERVER = DEDICATED)<br>      (SERVICE_NAME = FREE)<br>    )<br>  )<br><br>FREEPDB1 =<br>  (DESCRIPTION =<br>    (ADDRESS = (PROTOCOL = TCP)(HOST = [IP])(PORT = 1521))<br>    (CONNECT_DATA =<br>      (SERVER = DEDICATED)<br>      (SERVICE_NAME = FREEPDB1)<br>    )<br>  )<br><br>LISTENER_FREE =<br>  (ADDRESS = (PROTOCOL = TCP)(HOST = [IP])(PORT = 1521))</pre><ul><li>Open a new SQL file and create a database schema that will host JSON-Relational duality views and their tables. In this guide, I will be using <em>RDVTEST</em> as the schema name.</li></ul><pre>create user RDVTEST identified by [password];<br><br>grant create session to RDVTEST;<br><br>grant RESOURCE to RDVTEST;<br><br>grant unlimited tablespace to RDVTEST;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nblhMqo_VOZ8xD4qLUHasw.png" /><figcaption>Click on Execute All or Ctrl+R on Mac to run all the SQL commands</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2e_TKMsnbsPrZNtD3lTJZQ.png" /><figcaption>The Results screen opens</figcaption></figure><ul><li>Once this is done, we can log in as the newly created user. We’ll update the connection in Visual Studio Code with the new user and their password, close all the open files, and reconnect.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dq4LozjjeHCHANSSUVQlUA.png" /><figcaption>Update the connection with the new user and login as the Default role</figcaption></figure><ul><li>In a new SQL file, we will need to enable ORDS for this schema.</li></ul><pre>exec ords.enable_schema;<br><br>commit;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EQhDhcSdBHZM0iaN3BJvZA.png" /><figcaption>Enabling ORDS</figcaption></figure><p>With that, ORDS will serve APIs at the following base URI:</p><p><a href="http://localhost:8080/ords/rdvtest">http://localhost:8080/ords/rdvtest</a></p><blockquote>Since in this exercise we’re remotely connecting to a database running on a Compute instance in OCI (like shown in the installation guide linked above), we’ll be using the <strong><em>IP address</em></strong> of the instance instead of <strong><em>localhost</em></strong> in the screenshots that you’ll see below.</blockquote><h3>What is AutoREST?</h3><p>Before continuing, let’s talk a bit first about AutoREST.</p><p>Publishing REST APIs for your database objects can be as easy as simply enabling them for access. Our REST API technology includes a feature known as <strong>AutoREST</strong>, where one or more objects are enabled, and REST API endpoints are automatically published.</p><p>For example, a table can be enabled for GET, PUT, POST, DELETE operations to get one or more rows, insert or update rows, delete rows, or even batch load multiple rows in a single request.</p><p>This feature has been enhanced for 23c to include similar REST access for JSON-Relational duality views.</p><p>For the sake of simplicity, the REST APIs in this exercise are <strong>unprotected</strong>.</p><p>Oracle Database REST APIs offer performance and secure access for application developers, and it is <strong>highly recommended</strong> you protect your endpoints with the proper web privileges and roles.</p><h3>Creating JSON-Relational Duality Views</h3><ul><li>[OPTIONAL] To start with a clean slate, if you’ve run this exercise before, we can first drop all the tables and views if they exist in the schema already:</li></ul><pre>drop view if exists team_dv;<br>drop view if exists race_dv;<br>drop view if exists driver_dv;<br>drop table if exists driver_race_map;<br>drop table if exists race;<br>drop table if exists driver;<br>drop table if exists team;</pre><ul><li>Create the<em> TEAM, DRIVER, RACE, </em>and<em> DRIVER_RACE_MAPS </em>tables</li></ul><pre>CREATE TABLE IF NOT EXISTS TEAM (<br>    TEAM_ID INTEGER GENERATED BY DEFAULT ON NULL AS IDENTITY,<br>    NAME VARCHAR2(255) NOT NULL UNIQUE,<br>    POINTS INTEGER NOT NULL,<br>    CONSTRAINT TEAM_PK PRIMARY KEY(TEAM_ID)<br>);<br><br>CREATE TABLE IF NOT EXISTS DRIVER (<br>    DRIVER_ID INTEGER GENERATED BY DEFAULT ON NULL AS IDENTITY,<br>    NAME VARCHAR2(255) NOT NULL UNIQUE,<br>    POINTS INTEGER NOT NULL,<br>    TEAM_ID INTEGER,<br>    CONSTRAINT DRIVER_PK PRIMARY KEY(DRIVER_ID),<br>    CONSTRAINT DRIVER_FK FOREIGN KEY(TEAM_ID) REFERENCES TEAM(TEAM_ID)<br>);<br><br>CREATE TABLE IF NOT EXISTS RACE (<br>    RACE_ID INTEGER GENERATED BY DEFAULT ON NULL AS IDENTITY,<br>    NAME VARCHAR2(255) NOT NULL UNIQUE,<br>    LAPS INTEGER NOT NULL,<br>    RACE_DATE DATE,<br>    PODIUM JSON,<br>    CONSTRAINT RACE_PK PRIMARY KEY(RACE_ID)<br>);<br><br>CREATE TABLE IF NOT EXISTS DRIVER_RACE_MAP (<br>    DRIVER_RACE_MAP_ID INTEGER GENERATED BY DEFAULT ON NULL AS IDENTITY,<br>    RACE_ID INTEGER NOT NULL,<br>    DRIVER_ID INTEGER NOT NULL,<br>    POSITION INTEGER,<br>    CONSTRAINT DRIVER_RACE_MAP_PK PRIMARY KEY(DRIVER_RACE_MAP_ID),<br>    CONSTRAINT DRIVER_RACE_MAP_FK1 FOREIGN KEY(RACE_ID) REFERENCES RACE(RACE_ID),<br>    CONSTRAINT DRIVER_RACE_MAP_FK2 FOREIGN KEY(DRIVER_ID) REFERENCES DRIVER(DRIVER_ID)<br>);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2z7kwYKtVPOdewhC4iJOA.png" /><figcaption>Creating the tables</figcaption></figure><ul><li>Create a trigger on the <em>DRIVER_RACE_MAP </em>table to populate the <em>POINTS </em>column in the <em>TEAM </em>and<em> DRIVER </em>tables based on race results</li></ul><pre>CREATE OR REPLACE TRIGGER DRIVER_RACE_MAP_TRIGGER BEFORE<br>    INSERT ON DRIVER_RACE_MAP FOR EACH ROW<br>DECLARE<br>    V_POINTS  INTEGER;<br>    V_TEAM_ID INTEGER;<br>BEGIN<br>    SELECT<br>        TEAM_ID INTO V_TEAM_ID<br>    FROM<br>        DRIVER<br>    WHERE<br>        DRIVER_ID = :NEW.DRIVER_ID;<br>    IF :NEW.POSITION = 1 THEN<br>        V_POINTS := 25;<br>    ELSIF :NEW.POSITION = 2 THEN<br>        V_POINTS := 18;<br>    ELSIF :NEW.POSITION = 3 THEN<br>        V_POINTS := 15;<br>    ELSIF :NEW.POSITION = 4 THEN<br>        V_POINTS := 12;<br>    ELSIF :NEW.POSITION = 5 THEN<br>        V_POINTS := 10;<br>    ELSIF :NEW.POSITION = 6 THEN<br>        V_POINTS := 8;<br>    ELSIF :NEW.POSITION = 7 THEN<br>        V_POINTS := 6;<br>    ELSIF :NEW.POSITION = 8 THEN<br>        V_POINTS := 4;<br>    ELSIF :NEW.POSITION = 9 THEN<br>        V_POINTS := 2;<br>    ELSIF :NEW.POSITION = 10 THEN<br>        V_POINTS := 1;<br>    ELSE<br>        V_POINTS := 0;<br>    END IF;<br>    UPDATE DRIVER<br>    SET<br>        POINTS = POINTS + V_POINTS<br>    WHERE<br>        DRIVER_ID = :NEW.DRIVER_ID;<br>    UPDATE TEAM<br>    SET<br>        POINTS = POINTS + V_POINTS<br>    WHERE<br>        TEAM_ID = V_TEAM_ID;<br>END;<br>/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xiI6EG-zIl4m28DOTIzaGw.png" /><figcaption>Creating the trigger</figcaption></figure><ul><li>Create the <em>RACE_DV</em>, <em>DRIVER_DV</em>, and <em>TEAM_DV</em> JSON-Relational duality views</li></ul><pre>-- Create race view, RACE_DV<br>CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW RACE_DV AS<br>    SELECT<br>        JSON {&#39;raceId&#39; IS R.RACE_ID,<br>        &#39;name&#39; IS R.NAME,<br>        &#39;laps&#39; IS R.LAPS WITH NOUPDATE,<br>        &#39;date&#39; IS R.RACE_DATE,<br>        &#39;podium&#39; IS R.PODIUM WITH NOCHECK,<br>        &#39;result&#39; IS [<br>        SELECT<br>            JSON {&#39;driverRaceMapId&#39; IS DRM.DRIVER_RACE_MAP_ID,<br>            &#39;position&#39; IS DRM.POSITION,<br>            UNNEST (<br>            SELECT<br>                JSON {&#39;driverId&#39; IS D.DRIVER_ID,<br>                &#39;name&#39; IS D.NAME}<br>            FROM<br>                DRIVER D WITH NOINSERT UPDATE NODELETE<br>            WHERE<br>                D.DRIVER_ID = DRM.DRIVER_ID)}<br>            FROM<br>                DRIVER_RACE_MAP DRM WITH INSERT UPDATE DELETE<br>            WHERE<br>                DRM.RACE_ID = R.RACE_ID ]}<br>            FROM<br>                RACE R WITH INSERT UPDATE DELETE;<br><br>-- Create driver view, DRIVER_DV<br>CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW DRIVER_DV AS<br>    SELECT<br>        JSON {&#39;driverId&#39; IS D.DRIVER_ID,<br>        &#39;name&#39; IS D.NAME,<br>        &#39;points&#39; IS D.POINTS,<br>        UNNEST (<br>        SELECT<br>            JSON {&#39;teamId&#39; IS T.TEAM_ID,<br>            &#39;team&#39; IS T.NAME WITH NOCHECK}<br>        FROM<br>            TEAM T WITH NOINSERT NOUPDATE NODELETE<br>        WHERE<br>            T.TEAM_ID = D.TEAM_ID),<br>            &#39;race&#39; IS [<br>            SELECT<br>                JSON {&#39;driverRaceMapId&#39; IS DRM.DRIVER_RACE_MAP_ID,<br>                UNNEST (<br>                SELECT<br>                    JSON {&#39;raceId&#39; IS R.RACE_ID,<br>                    &#39;name&#39; IS R.NAME}<br>                FROM<br>                    RACE R WITH NOINSERT NOUPDATE NODELETE<br>                WHERE<br>                    R.RACE_ID = DRM.RACE_ID),<br>                    &#39;finalPosition&#39; IS DRM.POSITION}<br>                FROM<br>                    DRIVER_RACE_MAP DRM WITH INSERT UPDATE NODELETE<br>                WHERE<br>                    DRM.DRIVER_ID = D.DRIVER_ID ]}<br>                FROM<br>                    DRIVER D WITH INSERT UPDATE DELETE;<br><br>-- Create team view, TEAM_DV<br>CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW TEAM_DV AS<br>    SELECT<br>        JSON {&#39;teamId&#39; IS T.TEAM_ID,<br>        &#39;name&#39; IS T.NAME,<br>        &#39;points&#39; IS T.POINTS,<br>        &#39;driver&#39; IS [<br>        SELECT<br>            JSON {&#39;driverId&#39; IS D.DRIVER_ID,<br>            &#39;name&#39; IS D.NAME,<br>            &#39;points&#39; IS D.POINTS WITH NOCHECK}<br>        FROM<br>            DRIVER D WITH INSERT UPDATE<br>        WHERE<br>            D.TEAM_ID = T.TEAM_ID ]}<br>        FROM<br>            TEAM T WITH INSERT UPDATE DELETE;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ud34zzd-ixiqZ7yZK_WBhg.png" /><figcaption>Creating the duality views</figcaption></figure><ul><li>Enable the Duality Views for REST APIs. Make sure to replace the schema name in each PL/SQL statement below if necessary.</li></ul><blockquote>Note the P_OBJECT_ALIAS parameter defines the URI, making the duality views addressable in the REST APIs. These aliases are customizable and can be used to hide database implementation details from your REST API consumers.</blockquote><pre>BEGIN<br>    ORDS.ENABLE_OBJECT(<br>        P_ENABLED =&gt; TRUE,<br>        P_SCHEMA =&gt; &#39;RDVTEST&#39;,<br>        P_OBJECT =&gt; &#39;DRIVER_DV&#39;,<br>        P_OBJECT_TYPE =&gt; &#39;VIEW&#39;,<br>        P_OBJECT_ALIAS =&gt; &#39;driver_dv&#39;,<br>        P_AUTO_REST_AUTH =&gt; FALSE<br>    );<br>    COMMIT;<br>END;<br>/<br><br>BEGIN<br>    ORDS.ENABLE_OBJECT(<br>        P_ENABLED =&gt; TRUE,<br>        P_SCHEMA =&gt; &#39;RDVTEST&#39;,<br>        P_OBJECT =&gt; &#39;RACE_DV&#39;,<br>        P_OBJECT_TYPE =&gt; &#39;VIEW&#39;,<br>        P_OBJECT_ALIAS =&gt; &#39;race_dv&#39;,<br>        P_AUTO_REST_AUTH =&gt; FALSE<br>    );<br>    COMMIT;<br>END;<br>/<br><br>BEGIN<br>    ORDS.ENABLE_OBJECT(<br>        P_ENABLED =&gt; TRUE,<br>        P_SCHEMA =&gt; &#39;RDVTEST&#39;,<br>        P_OBJECT =&gt; &#39;TEAM_DV&#39;,<br>        P_OBJECT_TYPE =&gt; &#39;VIEW&#39;,<br>        P_OBJECT_ALIAS =&gt; &#39;team_dv&#39;,<br>        P_AUTO_REST_AUTH =&gt; FALSE<br>    );<br>    COMMIT;<br>END;<br>/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pC4vgvryi8_n92dx-y3pGw.png" /><figcaption>Enabling the duality views for REST</figcaption></figure><h3>Testing the Duality Views</h3><h4>OpenAPI Documentation</h4><p>The OpenAPI information for our APIs is available at the following URIs:</p><pre>http://localhost:8080/ords/rdvtest/open-api-catalog/team_dv/<br><br>http://localhost:8080/ords/rdvtest/open-api-catalog/driver_dv/<br><br>http://localhost:8080/ords/rdvtest/open-api-catalog/race_dv/</pre><p>You can copy and paste the JSON returned by those URIs in the <a href="https://editor-next.swagger.io/">Swagger Editor</a>, to get the auto-generated definitions of each endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eQ6lSgl4RQHxfjluhWHoyA.png" /><figcaption>Swagger for Duality Views AutoREST</figcaption></figure><h4>List all documents in a duality view</h4><p>To list all documents in a duality view, issue a GET request with the corresponding collection name.</p><p>For example, to list all documents in the <em>DRIVER_DV</em> duality view, run:</p><pre>curl -X GET http://localhost:8080/ords/rdvtest/driver_dv/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3XJ8OjhOg1IgOSfDHxDpBA.png" /><figcaption>Thunder Client — GET on the Driver Duality View API</figcaption></figure><h3><em>Populate duality views</em></h3><h4><em>Single document insert</em></h4><p>To insert a single document use POST, with the document content provided as the body.</p><blockquote>Note that while the write operations in this tutorial are performed on duality views, the actual data is transparently written to the underlying tables (as the duality views themselves do not hold any data).</blockquote><pre>POST http://localhost:8080/ords/rdvtest/team_dv/</pre><pre>{<br>  &quot;teamId&quot;: 2,<br>  &quot;name&quot;: &quot;Mercedes&quot;,<br>  &quot;points&quot;: 0,<br>  &quot;driver&quot;: [<br>    {<br>      &quot;driverId&quot;: 105,<br>      &quot;name&quot;: &quot;George Russell&quot;,<br>      &quot;points&quot;: 0<br>    },<br>    {<br>      &quot;driverId&quot;: 106,<br>      &quot;name&quot;: &quot;Lewis Hamilton&quot;,<br>      &quot;points&quot;: 0<br>    }<br>  ]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ivxhwUzV-0aK7IUVt1TQNQ.png" /><figcaption>Single document POST</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NvD8zxHg_1CzKLJrDDbxIA.png" /><figcaption>TEAM table showing the data after the POST</figcaption></figure><p>Oracle Database generates an <strong>eTag</strong> for each document inserted into the duality view. This information is returned under the <strong>_metadata</strong> field in the response body. These eTags are critical for upcoming examples involving updates using PUTs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rSkmyWXkyQOHZs0kFFIPhA.png" /><figcaption>Returned Headers</figcaption></figure><p>In addition, the response includes a <em>Content-Location</em> header redirecting the client to the new resource, in this case the Mercedes team. The <em>self</em> link shows where to address the new record. The record locator is derived from the TEAM primary key column, in this case, <em>teamId</em>.</p><h4>Bulk insert</h4><p>You can also insert multiple records into a duality view in one request, using POST to the REST duality view, with the <em>/batchload</em> URI and an accompanying array of JSON objects in the request body.</p><pre>POST http://localhost:8080/ords/dvtest/team_dv/batchload</pre><pre>[<br>  {<br>    &quot;teamId&quot;: 301,<br>    &quot;name&quot;: &quot;Red Bull&quot;,<br>    &quot;points&quot;: 0,<br>    &quot;driver&quot;: [<br>      {<br>        &quot;driverId&quot;: 101,<br>        &quot;name&quot;: &quot;Max Verstappen&quot;,<br>        &quot;points&quot;: 0<br>      },<br>      {<br>        &quot;driverId&quot;: 102,<br>        &quot;name&quot;: &quot;Sergio Perez&quot;,<br>        &quot;points&quot;: 0<br>      }<br>    ]<br>  },<br>  {<br>    &quot;teamId&quot;: 302,<br>    &quot;name&quot;: &quot;Ferrari&quot;,<br>    &quot;points&quot;: 0,<br>    &quot;driver&quot;: [<br>      {<br>        &quot;driverId&quot;: 103,<br>        &quot;name&quot;: &quot;Charles Leclerc&quot;,<br>        &quot;points&quot;: 0<br>      },<br>      {<br>        &quot;driverId&quot;: 104,<br>        &quot;name&quot;: &quot;Carlos Sainz Jr&quot;,<br>        &quot;points&quot;: 0<br>      }<br>    ]<br>  }<br>]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O1iAfHvbbGqyll6PJMhIMw.png" /><figcaption>Team batch load</figcaption></figure><p>The AutoREST Duality View API includes a POST /batchload endpoint for batch loading multiple JSON documents as rows in the view.</p><p>The response body is a report showing the number of records processed, rows that failed with an error, and rows successfully committed to the underlying duality views.</p><p><strong>Let’s do the same for the race information:</strong></p><pre>POST http://localhost:8080/ords/dvtest/race_dv/batchload</pre><pre>[<br>  {<br>    &quot;raceId&quot;: 201,<br>    &quot;name&quot;: &quot;Bahrain Grand Prix&quot;,<br>    &quot;laps&quot;: 57,<br>    &quot;date&quot;: &quot;2022-03-20T00:00:00&quot;,<br>    &quot;podium&quot;: {}<br>  },<br>  {<br>    &quot;raceId&quot;: 202,<br>    &quot;name&quot;: &quot;Saudi Arabian Grand Prix&quot;,<br>    &quot;laps&quot;: 50,<br>    &quot;date&quot;: &quot;2022-03-27T00:00:00&quot;,<br>    &quot;podium&quot;: {}<br>  },<br>  {<br>    &quot;raceId&quot;: 203,<br>    &quot;name&quot;: &quot;Australian Grand Prix&quot;,<br>    &quot;laps&quot;: 58,<br>    &quot;date&quot;: &quot;2022-04-09T00:00:00&quot;,<br>    &quot;podium&quot;: {}<br>  }<br>]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sz1hbS8hkLe3d1B-Humr0A.png" /><figcaption>Race batch load</figcaption></figure><h3>Query Parameters</h3><p>Query Parameters are pattern-like queries for JSON data, also expressed in JSON.</p><p>Records satisfying specific conditions can be retrieved by supplying query parameters. Let’s say we want to pull up a particular race, the Bahrain Grand Prix.</p><p>We will supply them in the <strong>q</strong> parameter of our REST request.</p><pre>http://localhost:8080/ords/rdvtest/race_dv/?q=[filter]</pre><h4>Equals</h4><p>This operation uses query parameters with the following content:</p><pre>{&quot;name&quot;:{&quot;$eq&quot;:&quot;Bahrain Grand Prix&quot;}}</pre><p>This query parameter will find all records having that name. To retrieve records matching this filter run:</p><pre>curl -X GET \<br>  &#39;http://localhost:8080/ords/rdvtest/race_dv/?q=%7B%22name%22%3A%7B%22%24eq%22%3A%22Bahrain%20Grand%20Prix%22%7D%7D&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TSHbeWiehAA9Irk4KQifRg.png" /><figcaption>Query Parameter (equals)</figcaption></figure><blockquote>Note also that the individual race can be retrieved by the raceId attribute. Since the underlying RACE table has a primary key defined on RACE_ID, the corresponding AutoREST enabled Duality View’s raceId attribute can be used as a key for working with specific races.</blockquote><h4><em>Replace a record identified by the Duality View ID (table Primary Key)</em></h4><p>To replace a target document, use PUT with the ID as the trailing step. Let’s update the Bahrain Grand Prix and add the podium information.</p><pre>PUT http://localhost:8080/ords/rdvtest/race_dv/201</pre><pre>{<br>  &quot;_metadata&quot;: {<br>    &quot;etag&quot;: &quot;2E8DC09543DD25DC7D588FB9734D962B&quot;<br>  },<br>  &quot;raceId&quot;: 201,<br>  &quot;name&quot;: &quot;Bahrain Grand Prix&quot;,<br>  &quot;laps&quot;: 57,<br>  &quot;date&quot;: &quot;2022-03-20T00:00:00&quot;,<br>  &quot;podium&quot;: {<br>    &quot;winner&quot;: {<br>      &quot;name&quot;: &quot;Charles Leclerc&quot;,<br>      &quot;time&quot;: &quot;01:37:33.584&quot;<br>    },<br>    &quot;firstRunnerUp&quot;: {<br>      &quot;name&quot;: &quot;Carlos Sainz Jr&quot;,<br>      &quot;time&quot;: &quot;01:37:39.182&quot;<br>    },<br>    &quot;secondRunnerUp&quot;: {<br>      &quot;name&quot;: &quot;Lewis Hamilton&quot;,<br>      &quot;time&quot;: &quot;01:37:43.259&quot;<br>    }<br>  },<br>  &quot;result&quot;: [<br>    {<br>      &quot;driverRaceMapId&quot;: 3,<br>      &quot;position&quot;: 1,<br>      &quot;driverId&quot;: 103,<br>      &quot;name&quot;: &quot;Charles Leclerc&quot;<br>    },<br>    {<br>      &quot;driverRaceMapId&quot;: 4,<br>      &quot;position&quot;: 2,<br>      &quot;driverId&quot;: 104,<br>      &quot;name&quot;: &quot;Carlos Sainz Jr&quot;<br>    },<br>    {<br>      &quot;driverRaceMapId&quot;: 9,<br>      &quot;position&quot;: 3,<br>      &quot;driverId&quot;: 106,<br>      &quot;name&quot;: &quot;Lewis Hamilton&quot;<br>    },<br>    {<br>      &quot;driverRaceMapId&quot;: 10,<br>      &quot;position&quot;: 4,<br>      &quot;driverId&quot;: 105,<br>      &quot;name&quot;: &quot;George Russell&quot;<br>    }<br>  ]<br>}</pre><blockquote>Note that the <strong>eTag</strong> value supplied in the content is used for out-of-the-box optimistic locking, to prevent the “lost update” problem that can occur with concurrent operations.</blockquote><blockquote>During the replace by ID operation, the database checks that the eTag provided in the replacement document matches the latest eTag of the target duality view document. If the eTags do not match, which can occur if another concurrent operation updated the same document, an error is thrown.</blockquote><blockquote>In case of such an error, you can reread the updated value (including the updated eTag), and retry the replace operation again, adjusting it (if desired) based on the updated value.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TrAvt26a48g3PaMEvhrzew.png" /><figcaption>Updating a document</figcaption></figure><p>Updating the race again requires a valid eTag. This can be retrieved with a HEAD request.</p><pre>curl -i -X HEAD http://localhost:8080/ords/rdvtest/race_dv/201</pre><p><strong>Greater Than</strong></p><p>Let’s use the greater than query parameter to retrieve information.</p><pre>{&quot;points&quot;:{&quot;$gt&quot;:40}}</pre><p>This query parameter will match all documents that have the points field greater than 40. To fetch documents matching this query filter parameter run:</p><pre>curl -X GET \<br>  &#39;http://localhost:8080/ords/rdvtest/team_dv?q=%7B%22points%22%3A%7B%22%24gt%22%3A40%7D%7D&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KF7y6L4cv6AR80-PHV2eNQ.png" /><figcaption>Query Parameter (greater than)</figcaption></figure><h3><em>Re-parenting of sub-objects between two documents</em></h3><p>Switching Charles Leclerc’s and George Russell’s teams can be done by updating the driver arrays in Mercedes and Ferrari documents of <em>TEAM_DV</em> duality view.</p><h4>In</h4><p>First we’ll have to find out the IDs of the Mercedes and Ferrari teams using the following query parameter filter:</p><pre>{&quot;name&quot;:{&quot;$in&quot;:[&quot;Mercedes&quot;,&quot;Ferrari&quot;]}}</pre><pre>curl -X GET \<br>  &#39;http://localhost:8080/ords/rdvtest/team_dv?q=%7B%22name%22%3A%7B%22%24in%22%3A%5B%22Mercedes%22%2C%22Ferrari%22%5D%7D%7D&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cquw4QLNgN-BLCTj-58NJw.png" /><figcaption>Query Parameter (in)</figcaption></figure><p><em>The ID for the Mercedes team is 2, and the ID for the Ferrari team is 302.</em></p><p>Now we can update both of the teams, using the following JSON documents:</p><pre>PUT http://localhost:8080/ords/rdvtest/team_dv/2</pre><pre>{<br>  &quot;_metadata&quot;: {<br>    &quot;etag&quot;: &quot;855840B905C8CAFA99FB9CBF813992E5&quot;<br>  },<br>  &quot;teamId&quot;: 2,<br>  &quot;name&quot;: &quot;Mercedes&quot;,<br>  &quot;points&quot;: 40,<br>  &quot;driver&quot;: [<br>    {<br>      &quot;driverId&quot;: 106,<br>      &quot;name&quot;: &quot;Lewis Hamilton&quot;,<br>      &quot;points&quot;: 15<br>    },<br>    {<br>      &quot;driverId&quot;: 103,<br>      &quot;name&quot;: &quot;Charles Leclerc&quot;,<br>      &quot;points&quot;: 25<br>    }<br>  ]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dKbzd5lTTUepofULl0RCZw.png" /><figcaption>Updating the Mercedes team</figcaption></figure><pre>PUT http://localhost:8080/ords/dvtest/team_dv/302</pre><pre>{<br>  &quot;_metadata&quot;: {<br>    &quot;etag&quot;: &quot;DA69DD103E8BAE95A0C09811B7EC9628&quot;<br>  },<br>  &quot;teamId&quot;: 302,<br>  &quot;name&quot;: &quot;Ferrari&quot;,<br>  &quot;points&quot;: 30,<br>  &quot;driver&quot;: [<br>    {<br>      &quot;driverId&quot;: 105,<br>      &quot;name&quot;: &quot;George Russell&quot;,<br>      &quot;points&quot;: 12<br>    },<br>    {<br>      &quot;driverId&quot;: 104,<br>      &quot;name&quot;: &quot;Carlos Sainz Jr&quot;,<br>      &quot;points&quot;: 18<br>    }<br>  ]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yh-F1G8HraD9DPRZ6lwrHQ.png" /><figcaption>Updating the Ferrari team</figcaption></figure><p><em>After these operations, Leclerc appears under the Mercedes team and no longer under Ferrari, and Russell appears under the Ferrari team and no longer under Mercedes, respectively.</em></p><h4>Or and Like</h4><p>The <em>DRIVER_DV</em> duality view has been updated as well. This can be verified by using the following query parameter filter:</p><pre>{&quot;$or&quot; : [{&quot;name&quot; : {&quot;$like&quot; : &quot;George%&quot;}}, {&quot;name&quot; : {&quot;$like&quot; : &quot;Charles%&quot;}}]}</pre><pre>curl -X GET \<br>  &#39;http://localhost:8080/ords/rdvtest/driver_dv?q=%7B%22%24or%22%20%3A%20%5B%7B%22name%22%20%3A%20%7B%22%24like%22%20%3A%20%22George%25%22%7D%7D%2C%20%7B%22name%22%20%3A%20%7B%22%24like%22%20%3A%20%22Charles%25%22%7D%7D%5D%7D&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NhQ0dtYWXOvrtrmyG1H_YA.png" /><figcaption>Query Parameter (or and like)</figcaption></figure><h3><em>Delete documents</em></h3><h4><em>Target document identified by document key</em></h4><p>You can delete a document with a given document key, in other words, its ID. For example, to delete the Bahrain Grand Prix document, we can run the following query:</p><pre>curl -X DELETE \<br>  &#39;http://localhost:8080/ords/dvtest/race_dv/201&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lY96VTlRoK13gXj1hcfxmA.png" /><figcaption>Deleting a document identified by it’s ID</figcaption></figure><h4><em>Target document(s) identified by a query parameter filter</em></h4><p>We can also delete records matching a query parameter filter. For example:</p><pre>{&quot;raceId&quot;:{&quot;$eq&quot;:202}}</pre><pre>curl -X DELETE \<br>  &#39;http://localhost:8080/ords/rdvtest/race_dv/?q=%7B%22raceId%22%3A%7B%22%24eq%22%3A202%7D%7D&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gSc2SLtK3m0AgKwQsoe8mw.png" /><figcaption>Deleting document(s) identified by a query filter</figcaption></figure><h3><em>Conclusion</em></h3><p>We looked together at some of the basics of the new JSON-Relational Duality View functionality, and how the REST APIs work.</p><p>The following operations were covered:</p><ul><li>Enabling a JSON-Relational duality view for REST API access</li><li>Fetching a record by its primary key</li><li>Fetching documents using query parameter filters</li><li>Fetching all records in a duality view</li><li>Replacing a record in a duality view, with optional eTag checking</li><li>Deleting a document identified by its document key</li><li>Deleting documents identified by a query filter parameter</li></ul><h4>Documentation</h4><blockquote>For more information on JSON-Relational duality views, make sure to check out the <a href="https://docs.oracle.com/en/database/oracle/oracle-database/23/jsnvu/">JSON-Relational Duality Developer’s Guide</a>.</blockquote><blockquote>For more information on the AutoREST APIs support for Oracle Database objects used for this example, see the <a href="https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/">ORDS Developer’s Guide</a>.</blockquote><blockquote>For an overview of query parameter filters using JSON syntax see <a href="https://docs.oracle.com/en/database/oracle/oracle-rest-data-services/23.1/orddg/developing-REST-applications.html#GUID-091748F8-3D14-402B-9310-25E6A9116B47">Filtering in Queries</a>.</blockquote><h3>Your feedback is important to us!</h3><p>Connect with us if you have any questions or feedback on Oracle Database 23c Free — Developer Release:</p><p><a href="https://community.oracle.com/">Welcome | Oracle Communities</a></p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f57555157f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to set up Oracle Database 23c — Developer Release and ORDS on OCI]]></title>
            <link>https://medium.com/@liana.lixandru/how-to-set-up-oracle-database-23c-developer-release-and-ords-on-oci-2207f41c3d57?source=rss-89d70869662------2</link>
            <guid isPermaLink="false">https://medium.com/p/2207f41c3d57</guid>
            <category><![CDATA[oracle-cloud]]></category>
            <category><![CDATA[oracle-database]]></category>
            <category><![CDATA[oraclecloudinfrastructure]]></category>
            <category><![CDATA[oracle]]></category>
            <dc:creator><![CDATA[Liana Lixandru]]></dc:creator>
            <pubDate>Wed, 12 Apr 2023 10:10:16 GMT</pubDate>
            <atom:updated>2023-04-28T08:45:08.350Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to set up Oracle Database 23c — Developer Release and ORDS on OCI</h3><h4>Let’s take a look at the newest release of Oracle Database, and how to set it up on a Compute instance running Oracle Linux 8</h4><p><em>For the first time in the history of Oracle, the next version of Oracle Database is available to developers first, for free and before it is generally available as a commercial version.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FlsG4BhxfBlw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DlsG4BhxfBlw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FlsG4BhxfBlw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/1dc86f3926f64c8fd716e6c0ea3fa3d5/href">https://medium.com/media/1dc86f3926f64c8fd716e6c0ea3fa3d5/href</a></iframe><p>This easy to download, install and run data-driven apps on developer release is jam-packed with new developer features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X1nWgWqydcr_kAW2tqNiDg.png" /><figcaption>What’s available in Oracle Database 23c Free — Developer Release</figcaption></figure><p>While in this article we’ll be focusing on installing on OCI, you can also get Oracle Database 23c — Developer Release as a container image or a VM. Be sure to check out the link below if you’re interested in any of these options:</p><p><a href="https://www.oracle.com/database/free/get-started/">Free Oracle Database - Quick Start Guide</a></p><h3>Installing Oracle Database 23c — Developer Release</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6T52vgK8BkE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6T52vgK8BkE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F6T52vgK8BkE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6138bb774f38d5c37cf24afbcce3a639/href">https://medium.com/media/6138bb774f38d5c37cf24afbcce3a639/href</a></iframe><p>Let’s start off by taking a look at how we can install Oracle Database 23c on an existing Compute instance, and access it from our local machine.</p><ul><li>Create a new Compute instance using the image of your preference. In this article, we will be using an instance running Oracle Linux 8 as an example. <em>Note that ARM architecture is not supported in this release.</em></li><li>Connect to your Compute instance using SSH.</li><li>Use sudo to log in as root.</li></ul><pre>$ sudo su -</pre><ul><li>Enable the Oracle Linux 8 Developer channel.</li></ul><pre># dnf config-manager --set-enabled ol8_developer</pre><ul><li>Run the <a href="https://yum.oracle.com/repo/OracleLinux/OL8/developer/x86_64/getPackage/oracle-database-preinstall-23c-1.0-0.5.el8.x86_64.rpm">Oracle Database Preinstallation RPM</a>.</li></ul><pre># dnf -y install oracle-database-preinstall-23c</pre><ul><li>Access the Oracle Database Free software <a href="https://www.oracle.com/database/technologies/free-downloads.html">download</a> page.<br>Download the oracle-database-free-23c-1.0-1.el8.x86_64.rpm RPM file required for performing an RPM-based installation to a directory of your choice.</li></ul><pre># wget https://download.oracle.com/otn-pub/otn_software/db-free/oracle-database-free-23c-1.0-1.el8.x86_64.rpm</pre><ul><li>Install the database software.</li></ul><pre># dnf -y localinstall oracle-database-free-23c-1.0-1.el8.x86_64.rpm</pre><h3>Creating and Configuring an Oracle Database 23c Free — Developer Release</h3><p>The configuration script creates a container database (FREE) with one pluggable database (FREEPDB1) and configures the listener at the default port (1521).</p><p>You can modify the configuration parameters by editing the /etc/sysconfig/oracle-free–23c.conf file.</p><p>The parameters set in this file are explained in detail in the silent mode installation procedure: <a href="https://docs.oracle.com/en/database/oracle/oracle-database/23/xeinl/installing-oracle-database-free.html#GUID-3F29EE7C-4546-49EE-B894-027EE3E371BF">Performing a Silent Installation</a>.</p><p>To create the database with the default settings:</p><ul><li>Log in as root using sudo.</li></ul><pre>$ sudo su -</pre><ul><li>Run the service configuration script:</li></ul><pre># /etc/init.d/oracle-free-23c configure</pre><ul><li>At the command prompt, specify a password for the SYS, SYSTEM, and PDBADMIN administrative user accounts. <br>Oracle recommends that your password should be at least 8 characters in length, contain at least 1 upper case character, 1 lower case character and, 1 digit [0-9].</li><li>Add the environment variables to the bash_profile. For the default settings:</li></ul><pre># Oracle Database environment variables<br>export ORACLE_SID=FREE<br>export ORACLE_HOME=/opt/oracle/product/23c/dbhomeFree<br>export ORAENV_ASK=NO<br>export PATH=$ORACLE_HOME/bin:$PATH</pre><h3>Connecting to Oracle Database 23c Free — Developer Release</h3><p>Let’s see how we can connect to our newly created database using sqlplus or a programming language.</p><h4>SQL Connect string</h4><p>[username]@[hostname]:[port]/[DB service name] [as sysdba]</p><ul><li>To connect to the first Pluggable Database (PDB) use:</li></ul><pre>$ sqlplus sys@localhost:1521/FREEPDB1 as sysdba</pre><ul><li>To connect to the Container Database (CDB) use:</li></ul><pre>$ sqlplus sys@localhost:1521/FREE as sysdba</pre><h4>Java</h4><pre>OracleDataSource ods = new OracleDataSource();<br>ods.setURL(&quot;jdbc:oracle:thin:@localhost:1521/FREEPDB1&quot;); // jdbc:oracle:thin@[hostname]:[port]/[DB service name]<br>ods.setUser(&quot;[Username]&quot;);<br>ods.setPassword(&quot;[Password]&quot;);<br>Connection conn = ods.getConnection();<br> <br>PreparedStatement stmt = conn.prepareStatement(&quot;SELECT &#39;Hello World!&#39; FROM dual&quot;);<br>ResultSet rslt = stmt.executeQuery();<br>while (rslt.next()) {<br>  System.out.println(rslt.getString(1));<br>}</pre><h4>Python</h4><pre>import oracledb<br><br>conn = oracledb.connect(user=&quot;[Username]&quot;, password=&quot;[Password]&quot;, dsn=&quot;localhost:1521/FREEPDB1&quot;)<br>with conn.cursor() as cur:<br>   cur.execute(&quot;SELECT &#39;Hello World!&#39; FROM dual&quot;)<br>   res = cur.fetchall()<br>   print(res)</pre><h4>Node.js</h4><pre>const oracledb = require(&#39;oracledb&#39;);<br>     <br>async function run() {<br>    let connection = await oracledb.getConnection({<br>    user : &quot;[Username]&quot;,<br>    password : &quot;[Password]&quot;,<br>    connectString : &quot;localhost:1521/FREEPDB1&quot; // [hostname]:[port]/[DB service name]<br>    });<br>    let result = await connection.execute( &quot;SELECT &#39;Hello World!&#39; FROM dual&quot;);<br>    console.log(result.rows[0]);<br>}<br>     <br>run();</pre><h3>Installing and enabling ORDS for Oracle Database 23c Free — Developer Release</h3><p>Now let’s see how we can install and enable Oracle REST Data Services for our newly created database.</p><p>ORDS is published in OL7 and OL8 repositories. Since we enabled the repo earlier, we can simply install ORDS using yum or dnf.</p><pre>$ sudo su -<br># dnf -y install ords</pre><p>The preceding command handles all the ORDS dependencies and place the ORDS program in /usr/local/bin/ords folder to set up your ORDS configuration and install or upgrade ORDS in the database.</p><p>Oracle recommends you to use /etc/ords/conf configuration directory. The following comand is used to configure ORDS:</p><pre># ords --config /etc/ords/config install</pre><p>If you want to use a different directory to place your ORDS configurations and you want to use the Linux system service management as system d or system v, then configure the ORDS config directory in /etc/ords.conf folder.</p><ul><li>Start the ORDS daemon</li></ul><pre># /etc/init.d/ords start</pre><h3>Allowing access to Oracle Database 23c Free — Developer Release and ORDS from a local machine</h3><p>In order to be able to access our Oracle Database instance as well as the ORDS services, we need to make two easy configurations, assuming your Compute instance has a public IP.</p><ul><li>Allow access to the Database and ORDS ports in the Security List of the subnet attached to the Compute instance. Create an Ingress Rule for each of the ports (default 1521 for Oracle Database and 8080 for ORDS).<br><em>You may want to restrict the Ingress Rule so that only specific IP addresses are allowed access.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BWNwu7LjF-kgXxvjHLQ0qA.png" /><figcaption>Ingress Rules in the Subnet Security List</figcaption></figure><ul><li>Open the two ports in the Oracle Linux firewall daemon</li></ul><pre>$ sudo su -<br># firewall-cmd --permanent --zone=public --add-port=1521/tcp<br># firewall-cmd --permanent --zone=public --add-port=8080/tcp<br># firewall-cmd --reload</pre><p>Now you will be able to use the Compute instance’s IP address and the two ports to access the services.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2207f41c3d57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pre-built Functions are now available in Oracle Cloud Infrastructure Functions]]></title>
            <link>https://awstip.com/pre-built-functions-are-now-available-in-oracle-cloud-infrastructure-functions-406ceb094209?source=rss-89d70869662------2</link>
            <guid isPermaLink="false">https://medium.com/p/406ceb094209</guid>
            <category><![CDATA[oci]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[oracle]]></category>
            <dc:creator><![CDATA[Liana Lixandru]]></dc:creator>
            <pubDate>Tue, 28 Mar 2023 12:44:53 GMT</pubDate>
            <atom:updated>2023-05-02T14:43:08.200Z</atom:updated>
            <content:encoded><![CDATA[<h3>Let’s take a look together and discover what they bring new to the service.</h3><p><a href="https://docs.oracle.com/en-us/iaas/Content/Functions/home.htm#top">Oracle Cloud Infrastructure Functions</a> (OCI Functions) is a fully managed, highly scalable serverless platform, powered by the <a href="https://fnproject.io/">Fn Project open source engine</a>.</p><p>With OCI Functions, you can write code in Java, Python, Node, Go, Ruby, and C# (and for advanced use cases, bring your own Dockerfile, and GraalVM). You can then deploy your code, call it directly or trigger it in response to events, and get billed only for the resources consumed during the execution.</p><h3>What are pre-built functions?</h3><p>Pre-built Functions (PBF) are ready-to-use tasks or actions implemented using OCI Functions. They provide you with a catalog of ready-to-use tasks or actions. You don’t need to write, build, package, and maintain function code.</p><p>These functions leverage the existing integration between various OCI services (Event Rules, Service Connector Hub) to help orchestrate service functionality using a guided experience.</p><h3>Where to find the pre-built functions?</h3><p>To navigate to Pre-Built Functions from the OCI menu, perform the following steps.</p><ol><li>Go to Main Menu.</li><li>Select <strong>Developer Services</strong>.</li><li>Under <strong>Functions</strong>, select <strong>Pre-Built Functions</strong>.</li><li>The console displays the list of pre-built functions.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D1BAnun_m7EO97tnSytLOg.png" /><figcaption>Pre-built functions in the OCI main menu</figcaption></figure><h3>Select Pre-Built Function</h3><p>After navigating to the PBF list, select the function to create. The following is list of pre-built function catalog pages that provide details about each function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*arWEWQjFhkoYCXTC0GuwMQ.png" /><figcaption>The list of pre-built functions</figcaption></figure><p>The pre-built function tasks are, at the time of this article’s publication:</p><h4><a href="https://docs.oracle.com/en-us/iaas/Content/Functions/Tasks/functions_pbf_catalog_media_workflow_job.htm"><strong>Media Workflow Job Spawner</strong></a></h4><p>Automate media processing using OCI Media Flow to transcode videos when they are uploaded to an Object Storage bucket.</p><p><strong>Common Usage Scenarios</strong></p><ul><li>Encode a video file in different resolutions after uploading a video file into a bucket.</li><li>Encode an audio file at different bit rates after uploading an audio file into a bucket.</li></ul><h4><a href="https://docs.oracle.com/en-us/iaas/Content/Functions/Tasks/functions_pbf_catalog_zero_quota_policy_creator.htm"><strong>Zero Quota Policy Creator</strong></a></h4><p>Automate creation of resource quota policies to enforce controls on your budgets as a part of your OCI environment for proactive cost governance.</p><p><strong>Common Usage Scenarios</strong></p><p>Create a zero quota policy that prevents creation of OCI resources after reaching a spending threshold. To do this, you need to configure a budget for a compartment and a budget alert rule, as well as an event rule in the <em>root</em> compartment to trigger from the budget alert.</p><h4><a href="https://docs.oracle.com/en-us/iaas/Content/Functions/Tasks/functions_pbf_catalog_object_storage_file_zip.htm"><strong>Object Storage File Zip</strong></a></h4><p>Extract files from sources that are zipped or stored in Object Storage for ingestion by the OCI Data Integration service.</p><p><strong>Common Usage Scenarios</strong></p><ul><li>Place files in object storage and use Data Integration to zip the files and store the resulting zip file in object storage.</li><li>Place files in object storage and directly invoke a function to zip the files and store the resulting zip file in object storage.</li></ul><h4><a href="https://docs.oracle.com/en-us/iaas/Content/Functions/Tasks/functions_pbf_catalog_object_storage_extractor.htm"><strong>Object Storage File Extractor</strong></a></h4><p>Integrate the unzip PBF function as a part of the Data Integration pipeline to successfully unzip source files using a data flow integration task.</p><p><strong>Common Usage Scenarios</strong></p><ul><li>Place a zip in object storage and use Data Integration to unzip the file and store the result in object storage.</li><li>Place a zip in object storage and directly invoke the function to unzip the files and store the result in object storage.</li></ul><h3>Creating a pre-built function</h3><p>Once you click on one of the pre-built functions available in the list, you have the possibility of creating a new function based on that PBF.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LCDqFueY75b24jaZkkgMhg.png" /><figcaption>Creating a new function from a pre-built task</figcaption></figure><p>After clicking on the <em>Create function</em> button, fill in the necessary parameters of the PBF you’re creating, and press <em>Create</em> once you’re satisfied with the setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VfYRWOAD9LsXyPc27Wf3BA.png" /><figcaption>Fill in the details to create the function and the required IAM policies</figcaption></figure><p>Once the function has been created, you will be redirected to it, and you can access its invoke endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MjhpRsSNb9tT2UYSvgCYrA.png" /><figcaption>Access the invoke endpoint of the newly-created PBF</figcaption></figure><h3>Invoking a Pre-built Function</h3><p>You can invoke the functions in the following ways:</p><ul><li>Invoke the function directly as documented in <a href="https://docs.oracle.com/iaas/Content/Functions/Tasks/functionsinvokingfunctions.htm#Invoking_Functions">Invoking Functions</a> by creating a request body as shown in the JSON example.</li><li>Invoke the function through a service (Data Integration, Events, etc).</li></ul><h4>Invoke flows</h4><ul><li><a href="https://docs.oracle.com/en-us/iaas/Content/Functions/Tasks/functions_pbf_catalog_media_workflow_job.htm#pbf-media-workflow-job-policies-plus__invoke-media-workflow">Media Workflow Job Spawner Invoke Flow</a></li><li><a href="https://docs.oracle.com/en-us/iaas/Content/Functions/Tasks/functions_pbf_catalog_object_storage_extractor.htm#pbf-object-storage-extractor-policies-plus__invoking-object-extractor">Object Storage File Extractor Invoke Flow</a></li><li><a href="https://docs.oracle.com/en-us/iaas/Content/Functions/Tasks/functions_pbf_catalog_object_storage_file_zip.htm#pbf-object-storage-file-zip-policies-plus__invoking-object-zip">Object Storage File Zip Invoke Flow</a></li><li><a href="https://docs.oracle.com/en-us/iaas/Content/Functions/Tasks/functions_pbf_catalog_zero_quota_policy_creator.htm#pbf-zero-quota-policies-plus__pbf-zero-quota-invoke">Zero Quota Policy Creator Invoke Flow</a></li></ul><p>Hope you found this information useful, and happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=406ceb094209" width="1" height="1" alt=""><hr><p><a href="https://awstip.com/pre-built-functions-are-now-available-in-oracle-cloud-infrastructure-functions-406ceb094209">Pre-built Functions are now available in Oracle Cloud Infrastructure Functions</a> was originally published in <a href="https://awstip.com/">AWS Tip</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Oracle Cloud Infrastructure Bastion with OpenSSH 8.8 or greater]]></title>
            <link>https://medium.com/@liana.lixandru/using-oracle-cloud-infrastructure-bastion-with-openssh-8-8-or-greater-45cdb33ad61a?source=rss-89d70869662------2</link>
            <guid isPermaLink="false">https://medium.com/p/45cdb33ad61a</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <dc:creator><![CDATA[Liana Lixandru]]></dc:creator>
            <pubDate>Fri, 17 Mar 2023 15:21:53 GMT</pubDate>
            <atom:updated>2023-03-21T10:25:33.354Z</atom:updated>
            <content:encoded><![CDATA[<p>While running tests for different use-cases in OCI, at a certain point I’ve had to create a Compute instance on a private network, and remotely connect to it.</p><p>This is typically a situation where we’d have to use a Bastion host to connect to our private instance, either through a Managed SSH connection or by SSH Port Forwarding.</p><p>The video version, if you’d rather watch it:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fe3qGTnA83s8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3De3qGTnA83s8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fe3qGTnA83s8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/37ef7577c1e99f8a0c51c0b8d554d514/href">https://medium.com/media/37ef7577c1e99f8a0c51c0b8d554d514/href</a></iframe><h3>But first: what is a Bastion?</h3><p>OCI Bastion is a service that provides restricted and time-limited access to target resources that don’t have public endpoints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*pAOi0M5sxo8TwmVKaftcHA.png" /><figcaption>Bastion Overview Diagram</figcaption></figure><p>Bastions let authorized users connect from specific IP addresses to target resources using SSH sessions. When connected, users can interact with the target resource by using any software or protocol supported by SSH.</p><p>For example, you can use the Remote Desktop Protocol (RDP) to connect to a Windows host, or use Oracle Net Services to connect to a database.</p><p>The Bastion target subnet should be the private subnet you want to connect to, the one our Compute instance is using.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*74rW1CcgltZz8cz35ATz3A.png" /><figcaption>OCI Bastion configuration</figcaption></figure><p>Before creating a session from the Bastion though, we have to make sure that:</p><ul><li>The <strong>Bastion</strong> plugin is enabled on the target compute <strong>instance</strong>. See <a href="https://docs.oracle.com/iaas/Content/Compute/Tasks/manage-plugins.htm#console">Managing Plugins with Oracle Cloud Agent</a>.</li><li>The VCN includes a <strong>service gateway </strong>and a route rule for the service gateway. See <a href="https://docs.oracle.com/iaas/Content/Network/Tasks/servicegateway.htm">Access to Oracle Services: Service Gateway</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hfBTu44jgCSYxGP6PG5CoA.png" /></figure><p>Once all this is done and we have our Bastion configured, and the Compute instance has its Bastion Plugin running, let’s try to connect then, shall we?</p><h3>Connecting to a private instance through the Bastion service</h3><p>First off, we’ll create a new session. We have a choice between a managed SSH session and SSH port forwarding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mhc9wPTqaiKFTxjxLZjJuw.png" /><figcaption>Creating a new Managed SSH session</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K_gfdxM06ZlgA7LEQdP0AA.png" /><figcaption>Creating a new SSH port forwarding session</figcaption></figure><p>Both are fairly straightforward, we need to pick our instance from the list, the port (we’ll be using the default 22), and then upload or let OCI generate a SSH key. In the case of a managed session, we also need to tell the Bastion our user. This is either <strong>opc</strong> or <strong>ubuntu</strong> depending on the image used to spin up the Compute instance. My instance is running Oracle Linux 8, so my user is <strong>opc</strong>.</p><p>Once the session is active, we can copy the SSH command by clicking on the three dots menu to the right of our session, and replace the placeholders appropriately.</p><p>In my case:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8acKVADTVN6XScel0u0Jdg.png" /><figcaption>Copying the SSH command of the active session</figcaption></figure><p>For managed SSH sessions, we need to replace the placeholder with the path to the private key (from the SSH key pair used to create the session).</p><pre>$ ssh -i &lt;privateKey&gt; -o ProxyCommand=&quot;ssh -i &lt;privateKey&gt; -W %h:%p -p 22 bastion-session-ocid@host.bastion.eu-amsterdam-1.oci.oraclecloud.com&quot; -p 22 opc@172.16.1.191</pre><p>For SSH port forwarding sessions, we need to replace the placeholders with the path to the private key and the local port on the machine from which we plan to run the SSH commands, respectively.</p><pre>$ ssh -i &lt;privateKey&gt; -N -L &lt;localPort&gt;:172.16.1.191:22 -p 22 bastion-session-ocid@host.bastion.eu-amsterdam-1.oci.oraclecloud.com</pre><p>And this is where the fun begins depending on the OpenSSH client version that’s running on our machine. If we’re running a version &lt; 8.8, the connection goes through and everything is great! But suppose we’re on 8.8 or higher:</p><pre>llixandru  ~<br> 🤍 17:03 ➜  ssh -V<br>OpenSSH_9.0p1, LibreSSL 3.3.6</pre><p>What now, you may ask?</p><h3>Troubleshooting the SSH connection: “no matching host key type found. Their offer: ssh-rsa”</h3><p>Well, now we’re getting error messages, of course!</p><pre>Unable to negotiate with X.X.X.X port 22: no matching host key type found. Their offer: ssh-rsa<br>kex_exchange_identification: Connection closed by remote host<br>Connection closed by UNKNOWN port 65535</pre><p>The error gets more detailed if we run the ssh command in verbose mode.</p><pre>OpenSSH_9.0p1, LibreSSL 3.3.6<br>debug1: Reading configuration data /Users/llixandru/.ssh/config<br>debug1: Reading configuration data /etc/ssh/ssh_config<br>debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files<br>debug1: /etc/ssh/ssh_config line 54: Applying options for *<br>debug1: /etc/ssh/ssh_config line 58: Applying options for *<br>debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling<br>debug1: Connecting to host.bastion.eu-amsterdam-1.oci.oraclecloud.com port 22.<br>debug1: Connection established.<br>debug1: identity file /Users/llixandru/Downloads/ssh-key-2023-03-17.key type 0<br>debug1: identity file /Users/llixandru/Downloads/ssh-key-2023-03-17.key-cert type -1<br>debug1: Local version string SSH-2.0-OpenSSH_9.0<br>debug1: Remote protocol version 2.0, remote software version Go<br>debug1: compat_banner: no match: Go<br>debug1: Authenticating to host.bastion.eu-amsterdam-1.oci.oraclecloud.com:22 as &#39;ocid1.bastionsession.oc1.eu-amsterdam-1.amaaaaaazgiyodqavz5fxvnk7o37doccube7yz5iuedmzqhyt7glqgep6pva&#39;<br>debug1: load_hostkeys: fopen /Users/llixandru/.ssh/known_hosts2: No such file or directory<br>debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory<br>debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory<br>debug1: SSH2_MSG_KEXINIT sent<br>debug1: SSH2_MSG_KEXINIT received<br>debug1: kex: algorithm: curve25519-sha256@libssh.org<br>debug1: kex: host key algorithm: ssh-rsa<br>debug1: kex: server-&gt;client cipher: aes128-ctr MAC: hmac-sha2-256-etm@openssh.com compression: none<br>debug1: kex: client-&gt;server cipher: aes128-ctr MAC: hmac-sha2-256-etm@openssh.com compression: none<br>debug1: expecting SSH2_MSG_KEX_ECDH_REPLY<br>debug1: SSH2_MSG_KEX_ECDH_REPLY received<br>debug1: Server host key: ssh-rsa SHA256:ILIs4rrGcjMfskHXdSbuGonj085YxR5FIgBGYxoucmY<br>debug1: load_hostkeys: fopen /Users/llixandru/.ssh/known_hosts2: No such file or directory<br>debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory<br>debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory<br>debug1: Host &#39;host.bastion.eu-amsterdam-1.oci.oraclecloud.com&#39; is known and matches the RSA host key.<br>debug1: Found key in /Users/llixandru/.ssh/known_hosts:21<br>debug1: rekey out after 4294967296 blocks<br>debug1: SSH2_MSG_NEWKEYS sent<br>debug1: expecting SSH2_MSG_NEWKEYS<br>debug1: SSH2_MSG_NEWKEYS received<br>debug1: rekey in after 4294967296 blocks<br>debug1: get_agent_identities: bound agent to hostkey<br>debug1: get_agent_identities: ssh_fetch_identitylist: agent contains no identities<br>debug1: Will attempt key: /Users/llixandru/Downloads/ssh-key-2023-03-17.key RSA SHA256:ObA5ICGMlvThX+9Spoih/O7FwKjFvpHxJevVHIV0Eh8 explicit<br>debug1: SSH2_MSG_SERVICE_ACCEPT received<br>debug1: Authentications that can continue: publickey<br>debug1: Next authentication method: publickey<br>debug1: Offering public key: /Users/llixandru/Downloads/ssh-key-2023-03-17.key RSA SHA256:ObA5ICGMlvThX+9Spoih/O7FwKjFvpHxJevVHIV0Eh8 explicit<br>debug1: send_pubkey_test: no mutual signature algorithm<br>debug1: No more authentication methods to try.<br>bastion-session-ocid@host.bastion.eu-amsterdam-1.oci.oraclecloud.com: Permission denied (publickey).</pre><p>Indeed, this is the line that’s interesting:</p><pre>debug1: send_pubkey_test: no mutual signature algorithm</pre><p>By default, RSA-SHA1 key pairs are not supported anymore in OpenSSH version 8.8 and greater, causing this error that we’re now seeing. In order to re-enable the support for RSA-SHA1 keys, we must add the following stanza to our SSH configuration.</p><pre>llixandru  ~<br> 🤍 17:11 ➜  nano .ssh/config</pre><pre>Host *<br>  HostkeyAlgorithms +ssh-rsa<br>  PubkeyAcceptedAlgorithms +ssh-rsa</pre><p>And then save the config file.</p><p>Retrying the SSH connection, and this time around it’s successful!</p><p>So, from the examples above, to port forward our connection, we run:</p><pre>$ ssh -i &lt;privateKey&gt; -N -L 15022:172.16.1.191:22 -p 22 bastion-session-ocid@host.bastion.eu-amsterdam-1.oci.oraclecloud.com</pre><p>Where <strong>15022</strong> is the local port I’ve chosen, and then to connect to the Compute instance:</p><pre>$ ssh -i .ssh/&lt;compute-privateKey&gt; opc@localhost -p 15022</pre><p>Hope this was informative! Happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45cdb33ad61a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Custom iOS Widget to Monitor Oracle Cloud Infrastructure Compute Instances]]></title>
            <link>https://medium.com/@liana.lixandru/building-a-custom-ios-widget-to-monitor-oracle-cloud-infrastructure-compute-instances-2ded6a65210a?source=rss-89d70869662------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ded6a65210a</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[oraclecloudinfrastructure]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <dc:creator><![CDATA[Liana Lixandru]]></dc:creator>
            <pubDate>Fri, 03 Mar 2023 12:20:44 GMT</pubDate>
            <atom:updated>2023-03-03T12:23:24.446Z</atom:updated>
            <content:encoded><![CDATA[<p>When discovering and playing around with new technologies, I’m always looking for ways in which to combine various tools to create something fun and engaging. That’s part of the enjoyment for me, and the sense of accomplishment brought when you manage to create something new is like a shot of dopamine!</p><p>That’s why, when I discovered <a href="https://scriptable.app/">Scriptable</a>, my first thought was about all the possibilities it opens to leverage cloud services like serverless functions and API creation and management tools.</p><p>The idea is very simple, yet incredibly versatile: automate iOS using JavaScript. I’m a big fan of iOS automation in general, the potential of personal automation to run actions based on events such as time of day, arrival at a location or the opening of an app is endless.</p><p>Your imagination is the limit. And that’s what makes it fun.</p><p>Scriptable uses Apple’s <a href="https://developer.apple.com/documentation/javascriptcore">JavaScriptCore</a>, which supports <a href="https://www.w3schools.com/js/js_es6.asp">ECMAScript 6</a>. When you combine all of the above with a popular language such as JavaScript, it opens it up to even more people who may want to try automation and iOS scripting out.</p><p>In the following tutorial, we will be using the public samples for Oracle Functions, create an API Gateway deployment to expose these serverless functions as REST APIs, and put it all together using the Scriptable extension for Visual Studio Code to program our simple widget.</p><p>If you’d rather watch all this in video form, you’re in luck! I have already posted a video showing all the steps. The step-by-step written guide is further below, including all the resources that you need to get started.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fa6YXpAK9gx8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Da6YXpAK9gx8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fa6YXpAK9gx8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f21b9e2dc52d50bb4325c0f30f189b95/href">https://medium.com/media/f21b9e2dc52d50bb4325c0f30f189b95/href</a></iframe><p>Here are the general steps to follow for this guide, including links to detailed how-tos for every step:</p><ol><li>Clone the <a href="https://github.com/oracle-samples/oracle-functions-samples">Oracle Functions Samples</a> <strong>GitHub</strong> <strong>repo</strong> and select the two functions that we will be using to help us display compute instances status:<br>- <a href="https://github.com/oracle-samples/oracle-functions-samples/tree/master/samples/oci-list-instances-python">oci-list-instances-python</a>, to list all the instances in a compartment and get their OCIDs<br>- <a href="https://github.com/oracle-samples/oracle-functions-samples/tree/master/samples/oci-compute-control-python">oci-compute-control-python</a>, to get the status of an instance by its OCID.</li><li>Create an <strong>Oracle Functions</strong> application on OCI, and if needed, follow the Getting Started guide to set it up either locally or using the cloud shell.</li><li>Upload the two functions that we got from the samples to your new application.<br><a href="https://docs.oracle.com/en-us/iaas/Content/Functions/Tasks/functionsquickstartcloudshell.htm#functionsquickstart_cloudshell">QuickStart on Cloud Shell</a> / <a href="https://docs.oracle.com/en-us/iaas/Content/Functions/Tasks/functionsquickstartlocalhost.htm#functionsquickstartlocalhost">QuickStart on local host</a></li><li>Create an <strong>API Gateway</strong> <a href="https://docs.oracle.com/en-us/iaas/Content/APIGateway/Tasks/apigatewaycreatingdeployment.htm#Deploying_an_API_on_an_API_Gateway_by_Creating_an_API_Deployment">deployment</a> that exposes the two serverless functions as REST endpoints.</li><li>Install Scriptable on your iPhone.<br><em>Optional</em>: install the<a href="https://scriptable.app/mac-beta/"> Scriptable beta app</a> on your Macbook / install the <a href="https://marketplace.visualstudio.com/items?itemName=gebeto.vscode-scriptable">Visual Builder Extension</a> for Scriptable for easier coding</li><li>Using an existing <strong>Scriptable</strong> sample as a starting point, code your widget. Personally, I used the <em>Random Scriptable API.js</em> sample.</li><li>Once the script is ready, add a new widget to your iPhone home screen, select Scriptable from the list, and then the widget size. Afterwards, long-pressing the widget will allow you to select the script you want it to execute. Once you do, you’ll be able to have a view of all your compute instances and their status!</li></ol><figure><img alt="Screenshot of the widget displayed in the Scriptable Macbook beta app" src="https://cdn-images-1.medium.com/max/1024/1*VV867r861-3Pb_ZTi5uL8g.png" /></figure><p>Sample snippet of how to call the API Gateway REST endpoints:</p><pre>async function loadItems() {<br>  let url = &quot;https://[YOUR_API_GATEWAY].apigateway.eu-frankfurt-1.oci.customer-oci.com/scriptable/compute-list&quot;<br>  const req = new Request(url)<br>  let json = await req.loadJSON()<br>  return json.instances<br>}<br><br>async function instanceControl(command, instanceId) {<br>  let url = &quot;https://[YOUR_API_GATEWAY].apigateway.eu-frankfurt-1.oci.customer-oci.com/scriptable/compute-control&quot;<br>  const req = new Request(url)<br>  req.method = &#39;POST&#39;<br>  req.body = JSON.stringify({command: command, instance_ocid: instanceId})<br>  req.headers = {<br>    &quot;Content-Type&quot;: &quot;application/json&quot;<br>  }<br>  let json = await req.loadJSON()<br>  return json.status<br>}<br>async function getInstanceList() {<br>  let items = await loadItems()<br>  let list = []<br>  for (var key in items) {<br>    if (items.hasOwnProperty(key)) {<br>      let inst = {name: items[key].name, description: items[key].id}<br>      list.push(inst)<br>    }<br>  }<br>  return list<br>}</pre><p>Sample snippet of other helper functions:</p><pre>async function loadAppIcon() {<br>  let url = &quot;https://is5-ssl.mzstatic.com/image/thumb/Purple124/v4/21/1e/13/211e13de-2e74-4221-f7db-d6d2c53b4323/AppIcon-1x_U007emarketing-0-7-0-85-220.png/540x540sr.jpg&quot;<br>  let req = new Request(url)<br>  return req.loadImage()<br>}<br><br>async function getImageFromURL(url) {<br>  let req = new Request(url)<br>  return req.loadImage()<br>}<br><br><br>function decode(str) {<br>  let regex = /&amp;#(\d+);/g<br>  return str.replace(regex, (match, dec) =&gt; {<br>    return String.fromCharCode(dec)<br>  })<br>}</pre><p>Sample snippet of how to define the background of your widget:</p><pre>let instances = await getInstanceList()<br><br>let widget = await createWidget(instances)<br>Script.setWidget(widget)<br>await widget.presentMedium()<br><br>Script.complete()<br><br>async function createWidget(instances) {<br>  <br>  let appIcon = await loadAppIcon()<br>  let title = &quot;My OCI Compute Instances Status&quot;<br>  let widget = new ListWidget()<br>  <br>  // Add background gradient<br>  let gradient = new LinearGradient()<br>  gradient.locations = [0, 1]<br>  gradient.colors = [<br>    new Color(&quot;141414&quot;),<br>    new Color(&quot;13233F&quot;)<br>  ]<br>  widget.backgroundGradient = gradient<br><br>  //Set padding on the List widget<br>  widget.setPadding(20, 20, 20, 20)<br>  <br>  // Show app icon and title<br>  let titleStack = widget.addStack()<br>  let appIconElement = titleStack.addImage(appIcon)<br>  appIconElement.imageSize = new Size(15, 15)<br>  appIconElement.cornerRadius = 4<br>  titleStack.addSpacer(4)<br>  <br>  let titleElement = titleStack.addText(title)<br>  titleElement.textColor = Color.white()<br>  titleElement.textOpacity = 0.7<br>  titleElement.font = Font.mediumSystemFont(13)<br>  widget.addSpacer(12)<br><br>  <br>  //get the list of instances and display their status<br>  [...]<br><br><br>}</pre><p>Sample snippet of how to show the status of each instance:</p><pre>async function createWidget(instances) {<br><br>//widget definition and background setup here<br>[..]<br><br><br>//get the list of instances and display their status<br>  for (const i in instances) {<br>    let instanceStack = widget.addStack()<br><br>    //Get the instance status to choose the correct icon to display between RUNNING, STOPPED and STARTING/STOPPING<br>    let status = await instanceControl(&quot;status&quot;, instances[i].description)<br><br>    let imagePath = &quot;&quot;<br>    if (status == &quot;RUNNING&quot;) {<br>      imagePath = await getImageFromURL(&quot;https://[URL]/started_icon.png&quot;)<br>    } else if (status == &quot;STOPPED&quot;) {<br>      imagePath = await getImageFromURL(&quot;https://[URL]/stopped_icon.png&quot;)<br>    } else if (status == &quot;STARTING&quot; || status == &quot;STOPPING&quot;) {<br>      imagePath = await getImageFromURL(&quot;https://[URL]/wait_icon.png&quot;)<br>    }<br><br>    //Display the status icon<br>    let imageElement = instanceStack.addImage(imagePath)<br>    imageElement.imageSize = new Size(14, 14)<br><br>    instanceStack.addSpacer(20)<br><br>    //Display the instance name<br>    let nameElement = instanceStack.addText(instances[i].name)<br>    nameElement.textColor = Color.white()<br>    nameElement.font = Font.boldSystemFont(14)<br>    nameElement.minimumScaleFactor = 1<br>  }<br><br>}</pre><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ded6a65210a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>