<?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"><channel><title><![CDATA[The ORA-WTF Blog - Oracle, DevSecOps+]]></title><description><![CDATA[Ramblings of a nerd into Oracle Cloud, DevSecOps, Oracle Database, Oracle Apex, Kubernetes, and Enterprise Cybersecurity.  Currently hold CASP+, CySa+, &amp; Pe]]></description><link>https://ora-wtf.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1737701391357/93420c43-6fe4-4bb2-8bda-14a69f5e273d.png</url><title>The ORA-WTF Blog - Oracle, DevSecOps+</title><link>https://ora-wtf.com</link></image><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 19:51:47 GMT</lastBuildDate><atom:link href="https://ora-wtf.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Enhance Oracle Cloud Security with Landing Zones]]></title><description><![CDATA[Oracle Enterprise Landing Zones are frameworks within Oracle Cloud Infrastructure (OCI) designed to create secure and scalable cloud environments for enterprises. They include various versions such as OELZ v1, OELZ v1 Lite, OELZ v2, and CIS OCI Landi...]]></description><link>https://ora-wtf.com/enhance-oracle-cloud-security-with-landing-zones</link><guid isPermaLink="true">https://ora-wtf.com/enhance-oracle-cloud-security-with-landing-zones</guid><category><![CDATA[oracle-cloud-security]]></category><category><![CDATA[oci-cis]]></category><category><![CDATA[cloudsecurity]]></category><category><![CDATA[Oracle Cloud]]></category><category><![CDATA[Oracle]]></category><category><![CDATA[oci-compliance]]></category><category><![CDATA[oci-security]]></category><dc:creator><![CDATA[Ryan Williams]]></dc:creator><pubDate>Sat, 30 Nov 2024 08:04:35 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1732953635667/97df5c6a-76aa-42b6-b4f8-82f28fa5ead6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>Oracle Enterprise Landing Zones are frameworks within Oracle Cloud Infrastructure (OCI) designed to create secure and scalable cloud environments for enterprises. They include various versions such as OELZ v1, OELZ v1 Lite, OELZ v2, and CIS OCI Landing Zone, each offering different levels of security, compliance, and complexity to accommodate organizational needs. OELZ v2 is the most comprehensive for advanced enterprise setups, while CIS focuses on stringent security. Selecting a landing zone depends on your enterprise's priorities such as scalability, security compliance, or industry-specific requirements. Deployment is facilitated through Terraform scripts, and a GitHub repository is available for quick deployment.</p>
</blockquote>
<p>The CIS OCI Landing Zone is a publicly available reference architecture for creating the foundations of a secure tenancy on OCI following best practices from the CIS Benchmark for OCI; along with best practices developed in OCI for our own Oracle PaaS, SaaS, and IT services. In addition to the reference architecture, the Landing Zone includes easy-to-deploy Terraform code (Quick Start) that automates the creation of a secure tenancy and a compliance checking script that can be used on new or existing tenancies that validates configuration in the tenancy for compliance with the CIS benchmark recommendations.</p>
<p>if you have read anything about them before the confusion starts quickly. Landing Zone V1 or V2? CIS or non CIS?</p>
<p>Oracle OCI Landing Zones provide structured environments to set up Oracle Cloud Infrastructure (OCI) following best practices and compliance standards.</p>
<p>Which one?</p>
<p><a target="_blank" href="https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/Content/cloud-adoption-framework/technology-implementation.htm#how-do-i-choose">https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/Content/cloud-adoption-framework/technology-implementation.htm#how-do-i-choose</a></p>
<h3 id="heading-oracle-enterprise-landing-zone-oelz-v1">Oracle Enterprise Landing Zone (OELZ) v1</h3>
<p><strong>Purpose and Scope:</strong></p>
<ul>
<li><p>The initial version is designed to provide a foundational setup for enterprises on OCI.</p>
</li>
<li><p>Focused on establishing a secure and scalable environment.</p>
</li>
</ul>
<p><strong>Key Features:</strong></p>
<ul>
<li><p><strong>Standardized Architecture:</strong> Provides a predefined architecture based on Oracle’s best practices.</p>
</li>
<li><p><strong>Security and Compliance:</strong> Basic security controls and compliance measures.</p>
</li>
<li><p><strong>Automated Deployment:</strong> Uses Terraform scripts for automated setup.</p>
</li>
<li><p><strong>Networking:</strong> Basic network configuration including VCNs, subnets, and security lists.</p>
</li>
<li><p><strong>IAM:</strong> Implements foundational IAM policies and compartments.</p>
</li>
<li><p><strong>Monitoring and Logging:</strong> Basic integration with OCI monitoring and logging services.</p>
</li>
<li><p><strong>Cost Management:</strong> Initial cost management practices included.</p>
</li>
</ul>
<h3 id="heading-oracle-enterprise-landing-zone-oelz-v1-lite">Oracle Enterprise Landing Zone (OELZ) v1 Lite</h3>
<p><strong>Purpose and Scope:</strong></p>
<ul>
<li><p>A simplified version of OELZ v1, designed for smaller organizations or initial cloud adoption phases.</p>
</li>
<li><p>Focused on providing a quick and straightforward setup.</p>
</li>
</ul>
<p><strong>Key Features:</strong></p>
<ul>
<li><p><strong>Simplified Architecture:</strong> Provides a minimal viable architecture to get started on OCI.</p>
</li>
<li><p><strong>Basic Security Controls:</strong> Essential security measures to protect the environment.</p>
</li>
<li><p><strong>Automated Deployment:</strong> Uses Terraform scripts for easy deployment.</p>
</li>
<li><p><strong>Networking:</strong> Basic network setup with essential components.</p>
</li>
<li><p><strong>IAM:</strong> Implements necessary IAM policies and compartments.</p>
</li>
<li><p><strong>Monitoring and Logging:</strong> Basic monitoring and logging configurations.</p>
</li>
<li><p><strong>Cost Management:</strong> Basic cost management practices.</p>
</li>
</ul>
<h3 id="heading-oracle-enterprise-landing-zone-oelz-v2">Oracle Enterprise Landing Zone (OELZ) v2</h3>
<p><strong>Purpose and Scope:</strong></p>
<ul>
<li><p>Designed for enterprises looking for a comprehensive cloud environment setup.</p>
</li>
<li><p>Provides a scalable and secure architecture that adheres to Oracle’s best practices.</p>
</li>
</ul>
<p><strong>Key Features:</strong></p>
<ul>
<li><p><strong>Modular Design:</strong> Allows for customization and scalability based on organizational needs.</p>
</li>
<li><p><strong>Security and Compliance:</strong> Built-in security controls and compliance with various regulations (e.g., GDPR, HIPAA).</p>
</li>
<li><p><strong>Automated Deployment:</strong> Uses Terraform scripts for automated provisioning and configuration.</p>
</li>
<li><p><strong>Networking:</strong> Configures a robust network architecture with VCN, subnets, security lists, and DRG.</p>
</li>
<li><p><strong>Identity and Access Management (IAM):</strong> Implements IAM policies and compartments to segregate and control access.</p>
</li>
<li><p><strong>Monitoring and Logging:</strong> Integrated with OCI monitoring and logging services for visibility and troubleshooting.</p>
</li>
<li><p><strong>Cost Management:</strong> Incorporates tagging and cost management best practices.</p>
</li>
</ul>
<h3 id="heading-cis-oci-landing-zone">CIS OCI Landing Zone</h3>
<p><strong>Purpose and Scope:</strong></p>
<ul>
<li><p>Developed by the Center for Internet Security (CIS) to provide a secure foundation for OCI based on CIS Benchmarks.</p>
</li>
<li><p>Focused primarily on security hardening and compliance.</p>
</li>
</ul>
<p><strong>Key Features:</strong></p>
<ul>
<li><p><strong>Security Hardening:</strong> Aligns with CIS OCI Foundations Benchmark to implement stringent security measures.</p>
</li>
<li><p><strong>Compliance:</strong> Ensures compliance with CIS standards, often a requirement for regulated industries.</p>
</li>
<li><p><strong>Automated Deployment:</strong> Utilizes Terraform scripts for quick deployment of a compliant OCI environment.</p>
</li>
<li><p><strong>Networking and IAM:</strong> Configures secure network architecture and IAM policies as per CIS recommendations.</p>
</li>
<li><p><strong>Auditing and Monitoring:</strong> Enables auditing and logging to track compliance and detect security incidents.</p>
</li>
</ul>
<h3 id="heading-other-oci-landing-zones">Other OCI Landing Zones</h3>
<ol>
<li><p><strong>OCI Well-Architected Framework (WAF) Landing Zone:</strong></p>
<ul>
<li><p><strong>Purpose:</strong> Implements OCI best practices based on the Well-Architected Framework.</p>
</li>
<li><p><strong>Features:</strong> Focuses on reliability, security, cost optimization, performance efficiency, and operational excellence.</p>
</li>
<li><p><strong>Use Case:</strong> Suitable for organizations seeking a balanced approach across all cloud operation aspects.</p>
</li>
</ul>
</li>
<li><p><strong>Industry-Specific Landing Zones:</strong></p>
<ul>
<li><p><strong>Purpose:</strong> Tailored for specific industries (e.g., healthcare, finance) with unique compliance and operational requirements.</p>
</li>
<li><p><strong>Features:</strong> Customized configurations to meet industry standards and regulatory requirements.</p>
</li>
</ul>
</li>
<li><p><strong>Custom Landing Zones:</strong></p>
<ul>
<li><p><strong>Purpose:</strong> Tailored to the specific needs of an organization.</p>
</li>
<li><p><strong>Features:</strong> Can be built from scratch or by modifying existing landing zone templates to meet unique requirements.</p>
</li>
</ul>
</li>
</ol>
<h3 id="heading-comparison-summary">Comparison Summary</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Feature / Aspect</td><td>OELZ v2</td><td>CIS OCI Landing Zone</td><td>OELZ v1</td><td>OELZ v1 Lite</td><td>Other Landing Zones</td></tr>
</thead>
<tbody>
<tr>
<td><strong>Primary Focus</strong></td><td>Enterprise setup, scalability</td><td>Security hardening, compliance</td><td>Foundational enterprise setup</td><td>Simplified initial setup</td><td>Varies (e.g., balanced architecture, industry-specific)</td></tr>
<tr>
<td><strong>Security Compliance</strong></td><td>Built-in security controls</td><td>CIS Benchmark alignment</td><td>Basic security controls</td><td>Essential security measures</td><td>Varies (e.g., Well-Architected, industry standards)</td></tr>
<tr>
<td><strong>Customization and Flexibility</strong></td><td>High, modular design</td><td>Moderate, focused on CIS compliance</td><td>Moderate, standardized architecture</td><td>Low, simplified architecture</td><td>High, varies by specific landing zone</td></tr>
<tr>
<td><strong>Automated Deployment</strong></td><td>Yes, using Terraform</td><td>Yes, using Terraform</td><td>Yes, using Terraform</td><td>Yes, using Terraform</td><td>Yes, using Terraform or other tools</td></tr>
<tr>
<td><strong>Network Architecture</strong></td><td>Robust, enterprise-grade</td><td>Secure, CIS compliant</td><td>Basic network configuration</td><td>Basic network setup</td><td>Varies, can be tailored to needs</td></tr>
<tr>
<td><strong>IAM and Access Control</strong></td><td>Detailed policies and compartments</td><td>Secure policies as per CIS</td><td>Foundational IAM policies</td><td>Essential IAM policies</td><td>Varies, based on specific requirements</td></tr>
<tr>
<td><strong>Monitoring and Logging</strong></td><td>Integrated with OCI services</td><td>Extensive logging for compliance</td><td>Basic monitoring and logging</td><td>Basic monitoring and logging</td><td>Varies, can be tailored to needs</td></tr>
<tr>
<td><strong>Cost Management</strong></td><td>Best practices included</td><td>Not primary focus</td><td>Initial cost management practices</td><td>Basic cost management practices</td><td>Varies, often included</td></tr>
</tbody>
</table>
</div><h3 id="heading-summary-of-key-differences">Summary of Key Differences:</h3>
<ul>
<li><p><strong>OELZ v2</strong> offers the most comprehensive and customizable setup, suitable for large enterprises with advanced needs.</p>
</li>
<li><p><strong>CIS OCI Landing Zone</strong> focuses on security hardening and compliance, ideal for organizations with strict security requirements.</p>
</li>
<li><p><strong>OELZ v1</strong> provides a foundational setup for enterprises, less advanced than v2 but still robust.</p>
</li>
<li><p><strong>OELZ v1 Lite</strong> is a simplified version for smaller organizations or those starting their cloud journey.</p>
</li>
<li><p><strong>Other Landing Zones</strong> vary widely and can be tailored to specific industries or organizational needs.</p>
</li>
</ul>
<p>Choosing the right landing zone depends on your organization's priorities, whether it's comprehensive enterprise architecture, stringent security compliance, or specific industry requirements.</p>
<h2 id="heading-deploy-from-github">Deploy from Github</h2>
<p>Here is the official GitHub repo, the simplest way to get started is the <code>Deploy to Oracle Cloud</code> button.</p>
<p><a target="_blank" href="https://github.com/oracle-quickstart/oci-cis-landingzone-quickstart">https://github.com/oracle-quickstart/oci-cis-landingzone-quickstart</a></p>
<p>Click deploy to the landing zone, log in and you will have a terraform wizard prompt to fill out. The 2 important options are</p>
<p><code>Service Label: A unique label that gets prepended to all resources created by the Landing Zone.</code> I used <code>lz</code></p>
<p><code>Use an enclosing compartment?</code> - uncheck to prevent the creation of a “top” compartment.</p>
<p>I recommend most of the other security options like vuln scanning, key vault etc. However, the service connector can generate enough logs to become billable.</p>
]]></content:encoded></item><item><title><![CDATA[PL/SQL Software Development Compliance by Cybersecurity Frameworks]]></title><description><![CDATA[The evolving cybersecurity landscape is driving significant changes in software development compliance and supply chain defense. Oracle APEX and PL/SQL present a unique challenge as they straddle the line between application and database, often leadi...]]></description><link>https://ora-wtf.com/plsql-software-development-compliance-by-cybersecurity-frameworks</link><guid isPermaLink="true">https://ora-wtf.com/plsql-software-development-compliance-by-cybersecurity-frameworks</guid><category><![CDATA[nist-800-218]]></category><category><![CDATA[nist-sp-800-53]]></category><category><![CDATA[nist-800-92]]></category><category><![CDATA[#oracle-apex]]></category><category><![CDATA[PL/SQL]]></category><category><![CDATA[#cybersecurity]]></category><category><![CDATA[Oracle Database]]></category><category><![CDATA[software development]]></category><category><![CDATA[develop secure software]]></category><dc:creator><![CDATA[Ryan Williams]]></dc:creator><pubDate>Thu, 22 Aug 2024 06:30:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1724308463193/fd2a3e9e-319d-4fe5-9a5a-11b9f7f4d9f8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The evolving cybersecurity landscape is driving significant changes in software development compliance and supply chain defense. Oracle APEX and PL/SQL present a unique challenge as they straddle the line between application and database, often leading to vulnerabilities due to their classification primarily as a database. Below is a list of critical topics and their relevance to PL/SQL.</p>
<h3 id="heading-1-code-review-and-peer-review">1. <strong>Code Review and Peer Review</strong></h3>
<ul>
<li><p><strong>NIST SP 800-218 (Secure Software Development Framework - SSDF)</strong>: Mandates code review practices to identify security vulnerabilities.</p>
</li>
<li><p><strong>Action</strong>: Implement mandatory peer code reviews for all PL/SQL code. Ensure that the review process is documented and that reviewers check for security flaws, coding standards compliance, and logic correctness.</p>
</li>
</ul>
<h3 id="heading-2-static-code-analysis">2. <strong>Static Code Analysis</strong></h3>
<ul>
<li><p><strong>NIST SP 800-53 (Security and Privacy Controls for Information Systems and Organizations)</strong>: Requires the use of automated tools to detect potential security issues in the code.</p>
</li>
<li><p><strong>CISA Guidance</strong>: Encourages the use of static analysis tools to identify vulnerabilities early in the development process.</p>
</li>
<li><p><strong>Action</strong>: Integrate static analysis tools (e.g., SonarQube, Fortify) into the development pipeline to automatically scan PL/SQL code for security vulnerabilities, code smells, and adherence to coding standards.</p>
</li>
</ul>
<h3 id="heading-3-automated-unit-testing">3. <strong>Automated Unit Testing</strong></h3>
<ul>
<li><p><strong>Executive Order 14028 (Improving the Nation's Cybersecurity)</strong>: Calls for robust testing practices, including automated testing, to ensure software security and reliability.</p>
</li>
<li><p><strong>NIST SP 800-218</strong>: Recommends the use of automated testing frameworks.</p>
</li>
<li><p><strong>Action</strong>: Use utPLSQL or similar frameworks to create and maintain comprehensive unit tests for all PL/SQL code. Ensure that these tests are automatically executed as part of the CI/CD pipeline.</p>
</li>
</ul>
<h3 id="heading-4-dynamic-application-security-testing-dast">4. <strong>Dynamic Application Security Testing (DAST)</strong></h3>
<ul>
<li><p><strong>CISA and NIST SP 800-53</strong>: Highlight the importance of testing applications dynamically to detect security vulnerabilities during runtime.</p>
</li>
<li><p><strong>Action</strong>: Conduct DAST on the application environment where PL/SQL code is deployed to identify security issues that may only appear during execution, such as SQL injection or buffer overflows.</p>
</li>
</ul>
<h3 id="heading-5-continuous-integration-and-continuous-deployment-cicd">5. <strong>Continuous Integration and Continuous Deployment (CI/CD)</strong></h3>
<ul>
<li><p><strong>NIST SP 800-218</strong>: Recommends the integration of automated security and quality checks within the CI/CD pipeline.</p>
</li>
<li><p><strong>Executive Order 14028</strong>: Emphasizes the use of automated tools and processes to enforce security throughout the software lifecycle.</p>
</li>
<li><p><strong>Action</strong>: Integrate PL/SQL code testing, static analysis, and security scanning into the CI/CD pipeline to ensure that code changes are automatically tested and verified before deployment.</p>
</li>
</ul>
<h3 id="heading-6-automated-code-formatting-and-standards-enforcement">6. <strong>Automated Code Formatting and Standards Enforcement</strong></h3>
<ul>
<li><p><strong>NIST SP 800-218</strong>: Advocates for consistent coding practices to reduce errors and vulnerabilities.</p>
</li>
<li><p><strong>Action</strong>: Utilize automated tools for code formatting (e.g., SQLcl, PL/SQL Developer) and enforce coding standards such as the <a target="_blank" href="https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.4/">Trivadis PL/SQL &amp; SQL Coding Guidelines</a>. Ensure that code conforms to established guidelines and standards before it is committed to the codebase.</p>
</li>
</ul>
<h3 id="heading-7-security-testing-and-vulnerability-management">7. <strong>Security Testing and Vulnerability Management</strong></h3>
<ul>
<li><p><strong>NIST SP 800-218 &amp; SP 800-53</strong>: Stress the importance of identifying and remediating vulnerabilities in software.</p>
</li>
<li><p><strong>CISA Guidance</strong>: Promotes proactive vulnerability management through regular scanning and remediation efforts.</p>
</li>
<li><p><strong>Action</strong>: Conduct regular security testing, including vulnerability scans, penetration testing, and security audits on PL/SQL code. Remediate identified vulnerabilities promptly.</p>
</li>
</ul>
<h3 id="heading-8-configuration-and-change-management">8. <strong>Configuration and Change Management</strong></h3>
<ul>
<li><p><strong>NIST SP 800-53</strong>: Requires the implementation of configuration management to control changes to software code.</p>
</li>
<li><p><strong>Action</strong>: Implement strict version control and change management policies for PL/SQL code. Use tools like Git to track code changes and ensure that all modifications go through the appropriate review and approval process.</p>
</li>
</ul>
<h3 id="heading-9-logging-and-monitoring">9. <strong>Logging and Monitoring</strong></h3>
<ul>
<li><p><strong>NIST SP 800-92 (Guide to Computer Security Log Management)</strong>: Recommends logging and monitoring of application activities for security purposes.</p>
</li>
<li><p><strong>Action</strong>: Ensure that PL/SQL code includes comprehensive logging of significant actions, errors, and security-related events. Implement monitoring systems to analyze these logs and alert on suspicious activities.</p>
</li>
</ul>
<h3 id="heading-10-compliance-auditing-and-reporting">10. <strong>Compliance Auditing and Reporting</strong></h3>
<ul>
<li><p><strong>NIST SP 800-53 &amp; CISA</strong>: Recommend regular auditing and reporting to ensure compliance with security policies and standards.</p>
</li>
<li><p><strong>Action</strong>: Perform regular audits of PL/SQL code and its associated processes to ensure compliance with relevant standards and policies. Generate compliance reports to document adherence and identify areas for improvement.</p>
</li>
</ul>
<h3 id="heading-11-documentation-and-traceability">11. <strong>Documentation and Traceability</strong></h3>
<ul>
<li><p><strong>NIST SP 800-53</strong>: Stresses the importance of documentation for maintaining traceability and accountability.</p>
</li>
<li><p><strong>Action</strong>: Maintain detailed documentation for all PL/SQL code, including test cases, review logs, security assessments, and change histories. Ensure that documentation is easily accessible and kept up to date.</p>
</li>
</ul>
<h3 id="heading-12-supply-chain-security">12. <strong>Supply Chain Security</strong></h3>
<ul>
<li><p><strong>Executive Order 14028</strong>: Emphasizes the need to secure the software supply chain.</p>
</li>
<li><p><strong>Action</strong>: Verify that all third-party PL/SQL components or libraries comply with security standards. Conduct regular assessments of these components for vulnerabilities and maintain an inventory of all third-party dependencies.</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Best Practices for Using utPLSQL for Unit Testing, Documentation, and Reporting in Oracle Database]]></title><description><![CDATA[utPLSQL is a powerful unit testing framework for PL/SQL in Oracle databases. It supports a wide range of testing capabilities, including assertions, test suites, code coverage analysis, and more. Below are best practices for using utPLSQL effectively...]]></description><link>https://ora-wtf.com/best-practices-for-using-utplsql-for-unit-testing-in-oracle-database</link><guid isPermaLink="true">https://ora-wtf.com/best-practices-for-using-utplsql-for-unit-testing-in-oracle-database</guid><category><![CDATA[unit testing]]></category><category><![CDATA[Oracle Database]]></category><category><![CDATA[PL/SQL]]></category><category><![CDATA[oracle pl/sql]]></category><dc:creator><![CDATA[Ryan Williams]]></dc:creator><pubDate>Tue, 20 Aug 2024 17:53:22 GMT</pubDate><content:encoded><![CDATA[<p>utPLSQL is a powerful unit testing framework for PL/SQL in Oracle databases. It supports a wide range of testing capabilities, including assertions, test suites, code coverage analysis, and more. Below are best practices for using utPLSQL effectively in your Oracle database projects.</p>
<h3 id="heading-1-organizing-test-suites-and-tests">1. <strong>Organizing Test Suites and Tests</strong></h3>
<ul>
<li><p><strong>Modular Test Suites</strong>: Organize your tests into modular test suites that correspond to the modules or packages in your application. This helps in isolating and identifying issues quickly.</p>
</li>
<li><p><strong>Naming Conventions</strong>: Use consistent and meaningful naming conventions for your test packages and procedures. For example, prefix your test packages with <code>ut_</code> and test procedures with <code>test_</code>.</p>
</li>
<li><p><strong>Granular Tests</strong>: Write granular tests that focus on a single aspect of a procedure or function. This improves test accuracy and makes it easier to diagnose failures.</p>
</li>
</ul>
<h3 id="heading-2-assertions-and-test-strategies">2. <strong>Assertions and Test Strategies</strong></h3>
<ul>
<li><p><strong>Use Assertions Wisely</strong>: utPLSQL provides a variety of assertions such as <code>ut.expect</code>, <code>ut.match</code>, and <code>ut.assert_true</code>. Use these to validate the output of your PL/SQL code against expected results.</p>
</li>
<li><p><strong>Boundary Testing</strong>: Include boundary cases in your tests to ensure your code handles edge cases correctly.</p>
</li>
<li><p><strong>Negative Testing</strong>: Test for expected failures, such as invalid inputs or exceptional conditions, to ensure your code handles errors gracefully.</p>
</li>
<li><p><strong>Code Coverage</strong>: Use utPLSQL’s code coverage feature to ensure that your tests cover all critical paths of your code. Aim for high coverage but prioritize meaningful test scenarios over reaching 100%.</p>
</li>
</ul>
<h3 id="heading-3-integration-and-continuous-testing">3. <strong>Integration and Continuous Testing</strong></h3>
<ul>
<li><p><strong>CI/CD Integration</strong>: Integrate utPLSQL with your Continuous Integration/Continuous Deployment (CI/CD) pipeline. This ensures that tests are automatically run with each code change, preventing regressions.</p>
</li>
<li><p><strong>Database Environment</strong>: Ensure that your test environment mirrors the production environment as closely as possible. This includes schema structures, data sets, and configuration settings.</p>
</li>
<li><p><strong>Automated Test Execution</strong>: Schedule regular automated test runs to catch issues early. Utilize features like utPLSQL’s command-line interface for this purpose.</p>
</li>
</ul>
<h3 id="heading-4-documentation-and-self-explaining-tests">4. <strong>Documentation and Self-Explaining Tests</strong></h3>
<ul>
<li><p><strong>Self-Documenting Tests</strong>: Write tests that are self-explanatory. The test name and content should clearly describe what is being tested and the expected outcome.</p>
</li>
<li><p><strong>Use Comments Sparingly</strong>: While tests should be self-explanatory, use comments to explain complex logic or to provide additional context where necessary.</p>
</li>
<li><p><strong>Test Case Descriptions</strong>: Use the <code>ut.test</code> block’s description parameter to provide concise descriptions of what each test case is validating. This enhances the readability and documentation quality.</p>
</li>
</ul>
<h3 id="heading-5-reporting-and-analysis">5. <strong>Reporting and Analysis</strong></h3>
<ul>
<li><p><strong>Custom Reporting</strong>: utPLSQL provides built-in reporting options, including HTML and XML reports. Customize these reports to meet your project needs, such as including specific metrics or code coverage details.</p>
</li>
<li><p><strong>Test Summary Reports</strong>: Regularly review and distribute summary reports from test executions to keep the development team informed of the overall quality and test coverage.</p>
</li>
<li><p><strong>Integrate with Issue Tracking</strong>: If a test fails, link it to your issue tracking system (e.g., JIRA) to document the defect and follow up on it. This creates a traceable record of issues and their resolution.</p>
</li>
<li><p><strong>Benchmark Testing</strong>: Incorporate performance benchmarks into your test suite to ensure that your code not only functions correctly but also meets performance criteria.</p>
</li>
</ul>
<h3 id="heading-6-automated-code-formatting">6. <strong>Automated Code Formatting</strong></h3>
<ul>
<li><p><strong>Use a Code Formatter</strong>: Instead of manually formatting your PL/SQL code, use an automated tool to ensure consistency and adherence to coding standards. Tools like <a target="_blank" href="https://www.oracle.com/database/technologies/appdev/sqlcl.html">SQLcl</a> or PL/SQL Developer can help automate this process.</p>
</li>
<li><p><strong>Adhere to Coding Guidelines</strong>: Follow established coding guidelines to maintain a uniform coding style across your project. The <a target="_blank" href="https://trivadis.github.io/plsql-and-sql-coding-guidelines/v4.4/">Trivadis PL/SQL &amp; SQL Coding Guidelines</a> is an excellent resource to standardize code formatting, naming conventions, and best practices.</p>
</li>
<li><p><strong>Integrate Formatting into CI/CD</strong>: Incorporate code formatting checks into your CI/CD pipeline to automatically enforce coding standards before merging code changes. This helps prevent style inconsistencies and makes the code easier to maintain and review.</p>
</li>
</ul>
<h3 id="heading-7-version-control-and-maintenance">7. <strong>Version Control and Maintenance</strong></h3>
<ul>
<li><p><strong>Version Control Tests</strong>: Store your test packages in version control (e.g., Git) alongside your application code. This ensures that your tests evolve with your codebase.</p>
</li>
<li><p><strong>Regular Maintenance</strong>: Regularly review and update your test cases to accommodate new features, changes in requirements, or deprecated functionality.</p>
</li>
</ul>
<h3 id="heading-8-continuous-improvement">8. <strong>Continuous Improvement</strong></h3>
<ul>
<li><p><strong>Refactor Tests</strong>: As your code evolves, refactor your test cases to remove redundancy, improve performance, or enhance clarity.</p>
</li>
<li><p><strong>Learn from Failures</strong>: When tests fail, use this as an opportunity to improve not only your code but also your testing strategy. Analyze the failure, identify root causes, and adjust your tests accordingly.</p>
</li>
<li><p><strong>Community Engagement</strong>: Engage with the utPLSQL community to stay informed about new features, best practices, and common challenges. Consider contributing to the open-source project or sharing your experiences with others.</p>
</li>
</ul>
<h3 id="heading-conclusion">Conclusion</h3>
<p>By following these best practices, you can maximize the effectiveness of utPLSQL in your Oracle database projects. Properly organized, well-documented, and comprehensive test suites will ensure that your PL/SQL code is reliable, maintainable, and ready for production deployment. Incorporate continuous integration, automated code formatting, and regular reporting to keep the development process streamlined and transparent.</p>
]]></content:encoded></item><item><title><![CDATA[Oracle Database 23ai + Oracle Apex with Docker Compose]]></title><description><![CDATA[Oracle's latest long-term release now has a developer-focused version available. Hopefully, our pleads for simplicity for the new setup are starting to show.
Note: The ORDS docker image is using ORDS 24.1 but with Apex 23.2. You can build your own im...]]></description><link>https://ora-wtf.com/oracle-database-23ai-oracle-apex-with-docker-compose</link><guid isPermaLink="true">https://ora-wtf.com/oracle-database-23ai-oracle-apex-with-docker-compose</guid><category><![CDATA[#oracle-db-23ai]]></category><category><![CDATA[#oracle-apex]]></category><category><![CDATA[Oracle DB]]></category><category><![CDATA[Oracle]]></category><category><![CDATA[Databases]]></category><category><![CDATA[Oracle Database]]></category><category><![CDATA[oracle ords]]></category><category><![CDATA[Docker compose]]></category><category><![CDATA[Docker]]></category><category><![CDATA[23c]]></category><category><![CDATA[#oracle-docker]]></category><category><![CDATA[Oracledocker]]></category><category><![CDATA[Oracle 23ai]]></category><dc:creator><![CDATA[Ryan Williams]]></dc:creator><pubDate>Fri, 19 Jul 2024 04:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1711429677386/f44db06b-9c0d-4f52-b026-2d35c91cb7dc.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Oracle's latest long-term release now has a developer-focused version available. Hopefully, our pleads for simplicity for the new setup are starting to show.</p>
<p><strong><em>Note: The ORDS docker image is using ORDS 24.1 but with Apex 23.2. You can build your own image with the latest version of Apex or update the ORDS container to host the new 24.1 Apex images.</em></strong> <a target="_blank" href="https://ora-wtf.com/oracle-database-23ai-oracle-apex-with-docker-compose#heading-update-ords-apex-images-to-241"><strong><em>See this section for the latter.</em></strong></a></p>
<p>I was able to modify my previous 21c docker setup with success.</p>
<p>Notable changes: no container registry login required, faster container runtime due to PDB being already set up, removal of Enterprise Manager. :(</p>
<p>I am using Ubuntu 22.04 fresh installation.</p>
<p>To start the container, we need to prepare a directory for the database files, which is mounted into the container and is persistent (so we can store and save everything, which is one of the basic things a database is used for). For this, I create a directory and set the userid and group id of the Oracle user (inside the container!)</p>
<h2 id="heading-setup-a-user-for-the-oracle-database">Setup a user for the Oracle database</h2>
<pre><code class="lang-bash">sudo groupadd --system --gid 54321 oracle
sudo adduser --system --shell /usr/sbin/nologin --gid 54321 --uid 54321 oracle
</code></pre>
<h2 id="heading-create-the-required-volume-folders-and-permissions">Create the required volume folders and permissions</h2>
<pre><code class="lang-bash">mkdir ~/oracle
mkdir ~/oracle/db
mkdir ~/oracle/ords
mkdir ~/oracle/db/oradata
mkdir ~/oracle/ords/ords_config
mkdir ~/oracle/ords/ords_secrets
mkdir ~/oracle/db/startup
mkdir ~/oracle/db/setup
sudo chmod 777 ~/oracle -R
sudo chown oracle:oracle ~/oracle/db/oradata
</code></pre>
<h2 id="heading-setup-firewall">Setup firewall</h2>
<pre><code class="lang-bash">sudo ufw allow 1521
<span class="hljs-comment"># sudo ufw allow 5500 # Enterprise Manager is disabled in 23c Free :(</span>
</code></pre>
<h2 id="heading-install-docker">Install Docker</h2>
<pre><code class="lang-bash">sudo apt update

sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
<span class="hljs-built_in">echo</span> <span class="hljs-string">"deb [arch=<span class="hljs-subst">$(dpkg --print-architecture)</span> signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu <span class="hljs-subst">$(lsb_release -cs)</span> stable"</span> | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce -y
sudo systemctl status docker
sudo usermod -aG docker <span class="hljs-variable">${USER}</span>

<span class="hljs-comment"># Reload shell then:</span>
docker ps
<span class="hljs-comment"># If prompting for sudo something is incorrect.</span>
</code></pre>
<h2 id="heading-install-docker-compose">Install Docker Compose</h2>
<pre><code class="lang-bash"><span class="hljs-comment">## Compose</span>

mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose

docker compose version
</code></pre>
<h2 id="heading-docker-composeyaml">Docker-compose.yaml</h2>
<p>Replace &lt;PASSWORD&gt;, &lt;EMAIL&gt; below. If running for a CI/CD setup consider using the lite version <code>23.4.0.0-lite</code></p>
<p>The <code>Lite</code> image has a smaller storage footprint than the <code>Full</code> image (~80% image size reduction) and a substantial improvement in image pull time. This image is useful in CI/CD scenarios and for simpler use cases where advanced database features are not required.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Each password should be different for security.</div>
</div>

<pre><code class="lang-dockerfile">version: <span class="hljs-string">'3'</span>
services:
  database:
    image: container-registry.oracle.com/database/free:<span class="hljs-number">23.4</span>.<span class="hljs-number">0.0</span>
    volumes:
      - ~/oracle/db/oradata:/opt/oracle/oradata <span class="hljs-comment"># persistent oracle database data.</span>
      - ~/oracle/db/startup:/opt/oracle/scripts/startup <span class="hljs-comment"># A volume with custom scripts to be run after database startup.</span>
      - ~/oracle/db/setup:/opt/oracle/scripts/setup <span class="hljs-comment">#  A volume with custom scripts to be run after database setup.</span>
    ports:
      - <span class="hljs-number">1521</span>:<span class="hljs-number">1521</span>
      - <span class="hljs-number">2484</span>:<span class="hljs-number">2484</span> <span class="hljs-comment">#SSL port</span>
    restart: unless-stopped
    environment:
      - ORACLE_PWD=&lt;PASSWORD&gt; <span class="hljs-comment"># use for Sys, System users</span>
    networks:
      - oracle_ntw
    ulimits:
      nofile:
        soft: <span class="hljs-number">65536</span>
        hard: <span class="hljs-number">65536</span>
  ords:
    image: container-registry.oracle.com/database/ords:<span class="hljs-number">24.2</span>.<span class="hljs-number">2</span>
    volumes:
      - ~/oracle/ords/ords_secrets:/opt/oracle/variables 
      - ~/oracle/ords/ords_config:/etc/ords/config/
    environment:
      - ORDS_PWD=<span class="hljs-string">"&lt;PASSWORD&gt;"</span>
      - APEX_ADMIN_EMAIL=&lt;EMAIL&gt;
      - APEX_ADMIN_PWD=&lt;PASSWORD&gt;
    ports:
      - <span class="hljs-number">8181</span>:<span class="hljs-number">8181</span>
    depends_on:
      - database
    restart: unless-stopped
    networks:
      - oracle_ntw
networks:
    oracle_ntw:
        <span class="hljs-comment"># use the bridge driver</span>
        driver: bridge
</code></pre>
<p>We need the DB to start before ORDS so run <code>docker compose up database</code></p>
<p>Wait until you see</p>
<pre><code class="lang-bash">oracle-database-1 | <span class="hljs-comment">######################### </span>
oracle-database-1 | DATABASE IS READY TO USE! 
oracle-database-1 | <span class="hljs-comment">#########################</span>
</code></pre>
<h2 id="heading-ords-setup">ORDS Setup</h2>
<p>Create a conn_string.txt to load the credentials into ORDS. This file is deleted when the container starts, and must be replaced if wrong values are provided. Replace &lt;PASSWORD&gt;</p>
<p>Note: the default 23c SID is <code>FREEPDB1</code></p>
<p><code>database</code> is the service name from the docker-compose file</p>
<pre><code class="lang-bash"><span class="hljs-comment">## ORDS</span>

<span class="hljs-comment"># mkdir ords_secrets ords_config</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">'CONN_STRING=sys/&lt;PASSWORD&gt;@database:1521/FREEPDB1'</span> &gt; ~/oracle/ords/ords_secrets/conn_string.txt
</code></pre>
<p>If everything is correct then use <code>docker compose up</code> to start the remaining ORDS service.</p>
<p>Use the below login credentials for first-time login to APEX service: (Also found in the container logs)</p>
<p><code>Workspace: internal</code></p>
<p><code>User:      ADMIN</code></p>
<p><code>Password:  Welcome_1</code></p>
<p>Create your workspace and enjoy getting the basic's started. :)</p>
<hr />
<h2 id="heading-misc-commands">Misc Commands</h2>
<p>View ORDS logs:</p>
<p><code>docker exec -it oracle-ords-1 tail -f /tmp/install_container.log</code></p>
<p>View logs of the database, limit to last 1k:<br /><code>docker logs oracle-database-1 -n 1000</code></p>
<p>To access the running container:</p>
<p><code>docker exec -it oracle-database-1 /bin/bash</code></p>
<p>Edit ORDS Config:</p>
<p><code>nano ords/ords_config/databases/default/pool.xml</code></p>
<p>Setup ORDS SSL:</p>
<pre><code class="lang-bash"><span class="hljs-comment">## ORDS SSL</span>
<span class="hljs-built_in">cd</span> ~/oracle/ords
mkdir -p ords_config/ssl
cp cert_file.crt ords_config/ssl/cert.crt
cp key_file.key  ords_config/ssl/key.key
</code></pre>
<h2 id="heading-update-ords-apex-images-to-241">Update ORDS Apex images to 24.1</h2>
<p>Since ORDS docker image has Apex bundled together you will have to point the ORDS config to look at new version 24.1 images. Otherwise you will be prompted of an error on login.</p>
<p>Run the standard Apex upgrade path to install the new Apex 24 schema. After installation, we have to update the images on the web server.</p>
<p>Download apex_latest.zip from the Oracle website, and mount the images directory in docker-compose file:</p>
<pre><code class="lang-dockerfile">- ~/apex_latest/images/:/opt/oracle/apex_images/<span class="hljs-number">24</span>/
</code></pre>
<p>Now edit the ORDS config to assign <code>apex-images</code> config variable to the path inside the container.</p>
<p><code>nano ords/ords_config/global/settings.xml</code></p>
<p>add entry:<code>&lt;entry key="apex-images"&gt;/opt/oracle/apex/images/24/&lt;/entry&gt;</code></p>
<p>Restart the docker container</p>
<p>Most importantly, clear the browser cache. All new images and icons will be available.</p>
<h3 id="heading-references">References</h3>
<p><a target="_blank" href="https://blogs.oracle.com/coretec/post/oracle-database-with-docker">https://blogs.oracle.com/coretec/post/oracle-database-with-docker</a></p>
<p><a target="_blank" href="https://docs.oracle.com/en/database/oracle/oracle-database/21/deeck/index.html#GUID-375BBD63-755D-4477-AE2A-13384B7B1631">https://docs.oracle.com/en/database/oracle/oracle-database/21/deeck/index.html#GUID-375BBD63-755D-4477-AE2A-13384B7B1631</a></p>
<p><a target="_blank" href="https://docs.oracle.com/en/operating-systems/oracle-linux/docker/docker-InstallingOracleContainerRuntimeforDocker.html#docker-install-storage-driver">https://docs.oracle.com/en/operating-systems/oracle-linux/docker/docker-InstallingOracleContainerRuntimeforDocker.html#docker-install-storage-driver</a></p>
<p><a target="_blank" href="https://datmt.com/backend/how-to-install-oracle-database-on-docker/">https://datmt.com/backend/how-to-install-oracle-database-on-docker/</a></p>
<p><a target="_blank" href="https://docs.oracle.com/en/operating-systems/oracle-linux/docker/docker-SecurityRecommendations.html#docker-security-images">https://docs.oracle.com/en/operating-systems/oracle-linux/docker/docker-SecurityRecommendations.html#docker-security-images</a></p>
]]></content:encoded></item><item><title><![CDATA[The ORA-WTF Blog]]></title><description><![CDATA[My name is Ryan Williams, welcome to my data terminal, a space dedicated to Oracle technology, Software Development, DevOps, DevSecOps, and Cybersecurity. My mission is to cut through the clutter of low-quality tech posts proliferating across the int...]]></description><link>https://ora-wtf.com/intro</link><guid isPermaLink="true">https://ora-wtf.com/intro</guid><category><![CDATA[General Programming]]></category><category><![CDATA[introduction]]></category><dc:creator><![CDATA[Ryan Williams]]></dc:creator><pubDate>Mon, 25 Mar 2024 04:00:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1721276999335/68d32605-6b1a-449d-b657-569f55e8448e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>My name is Ryan Williams, welcome to my data terminal, a space dedicated to Oracle technology, Software Development, DevOps, DevSecOps, and Cybersecurity. My mission is to cut through the clutter of low-quality tech posts proliferating across the internet by offering nuanced, in-depth content that transitions smoothly from basic introductions to complex, production-level setups.</p>
<p>In a world where "ORA-WTF??? What That Function?" resonates with too many of us, I've taken it upon myself to document and share the quirks and qualms of Oracle technology—sometimes more effectively than Oracle does. While my blog thrives on educational and informational content, it's worth noting that the views expressed here are entirely my own and do not reflect those of any entity I have been or will be associated with.</p>
<p>My journey in tech started when I was young, playing around with computer games. This early interest grew into real expertise across many areas of technology. I started modding games since the first game I played on PC as a kid.</p>
<p>On a professional front, my experiences are broad and deep. I've navigated the complexities of Oracle Database, Oracle Apex, E-Business Suite, Oracle Cloud Infrastructure, and Oracle Netsuite, along with cloud platforms like AWS, GCP, Azure, and Digital Ocean. My programming languages of choice—Java, Powershell, Python, and PL/SQL—reflect a versatile skill set honed over years of dedicated practice.</p>
<p>On the Cybersecurity side, I have been an early adopter of Zero Trust Architecture along with SMB experience as a cybersecurity consultant securing cloud and on-prem infrastructure. My background includes a BS in Computer Engineering Technology, and an MS in Cybersecurity and Informational Assurance.</p>
<p>Currently, my ambition stretches beyond the confines of technology itself; I'm passionately working towards integrating cybersecurity into SMBs, championing the belief that data is the new oil in today's digital economy. In this blog, I aim to share my knowledge and experiences and ignite a conversation about the importance of data security in the modern business landscape.</p>
<p>Feel free to reach out with any questions or feedback.</p>
]]></content:encoded></item></channel></rss>