<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Oracle on Architecture and Data Blog</title>
    <link>https://sadalage.com/tags/oracle/</link>
    <description>Recent content in Oracle on Architecture and Data Blog</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 01 Aug 2017 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://sadalage.com/tags/oracle/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Static Analysis of PL/SQL code</title>
      <link>https://sadalage.com/post/static-analysis-of-plsql-code/</link>
      <pubDate>Tue, 01 Aug 2017 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/static-analysis-of-plsql-code/</guid>
      <description>&lt;p&gt;In all new development and sometimes during legacy codebase modernization, developers tend to add code quality checks and static analysis of codebase such as style checks, bug finders, cyclomatic complexity checking etc. into the CI/CD pipeline. When we inherit a codebase that has much PL/SQL and there is a desire to put the PL/SQL code base through the same types of code analysis, what options does a developer/dba have?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Usage of mixed case database object names is dangerous</title>
      <link>https://sadalage.com/post/mixed_case_database_objects/</link>
      <pubDate>Tue, 06 Aug 2013 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/mixed_case_database_objects/</guid>
      <description>&lt;p&gt;Some versions back, Oracle would not allow to create database object names with mixed cases, even if we tried to create them, we could not. In newer versions of Oracle we can create tables, columns, indexes etc using mixed case or lower case, when the names are put inside double quotes. For example&lt;/p&gt;</description>
    </item>
    <item>
      <title>Ruby OCI 2.0 Array binding</title>
      <link>https://sadalage.com/post/ruby_oci_20_array_binding/</link>
      <pubDate>Thu, 08 Oct 2009 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/ruby_oci_20_array_binding/</guid>
      <description>&lt;p&gt;We have been doing some data moving lately using Ruby and &lt;a href=&#34;http://ruby-oci8.rubyforge.org&#34;&gt;Ruby-OCI&lt;/a&gt;. We started with Ruby OCI 1.0 and did use prepared statements with bind variables (since we are using oracle database and pulling data from an oracle database and pushing data to an oracle database). Later we found this really cool feature in Ruby-OCI8 2.0 where you can bind a whole array and just make one database trip for many database operations.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Create an Index for all FK Columns in the database</title>
      <link>https://sadalage.com/post/create_an_index_for_all_fk_columns/</link>
      <pubDate>Thu, 03 Sep 2009 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/create_an_index_for_all_fk_columns/</guid>
      <description>&lt;p&gt;Most of the time I have seen database foreign key constraints on tables without indexes on those columns. Lets say the application is trying to delete a row from the CUSTOMER table&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;DELETE FROM CUSTOMER WHERE CUSTOMERID = 1000;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When the database goes about deleting the customerId of 1000, if there are foreign key constraints defined on customerId, then the database is going to try to find if the customerId of 1000 is used in any of those tables. Lets say ORDER table has the customerId column, the database is going to issue&lt;/p&gt;</description>
    </item>
    <item>
      <title>Materialized views and database links in oracle.</title>
      <link>https://sadalage.com/post/materialized_views_and_databases/</link>
      <pubDate>Mon, 10 Aug 2009 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/materialized_views_and_databases/</guid>
      <description>&lt;p&gt;Recently one of my colleague &lt;a href=&#34;http://blog.norrissoftware.com&#34;&gt;Jeff Norris&lt;/a&gt; had a weird error. He was trying to build a materialized view over some tables in his local database and some tables in his remote database using database links the sql to create the view ran fine and provided the results as expected, but when put inside a materialized view statement complained with &lt;strong&gt;ORA-00942&lt;/strong&gt; errors.&lt;/p&gt;&#xA;&lt;p&gt;Lets say the two databases in question are local and remote, so the sql to create the materialized view to load immediately and refresh everyday is&lt;/p&gt;</description>
    </item>
    <item>
      <title>Explicitly rollback when you encounter a deadlock.</title>
      <link>https://sadalage.com/post/explicitly_rollback_when_you_get_deadlock/</link>
      <pubDate>Tue, 26 May 2009 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/explicitly_rollback_when_you_get_deadlock/</guid>
      <description>&lt;p&gt;Dead lock is caused in the database when you have resources (connections) waiting for other connections to release locks on the rows that are needed by the session, resulting in all session being blocked. Oracle automatically detects deadlocks are resolves the deadlock by rolling back the statement  in the transaction that detected the deadlock. Thing to remember is that &lt;strong&gt;last statement is rolled back and not the whole transaction&lt;/strong&gt;, which means that if you had other modifications, those rows are still locked and the application should make sure that it does a explicit rollback on the connection.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Oracle for the Mac</title>
      <link>https://sadalage.com/post/oracle_for_the_mac/</link>
      <pubDate>Thu, 14 May 2009 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/oracle_for_the_mac/</guid>
      <description>&lt;p&gt;Ever since I moved to the Mac, I had to run some other OS inside a VM so that I could run Oracle and use it, since Oracle was not available for the the Mac. Now that is no longer the case. Oracle 10gR2 (10.2.0.4) is now available for Mac&lt;/p&gt;&#xA;&lt;p&gt;This is especially nice since the Oracle for Mac was the most voted requirement on mix.oracle.com&lt;/p&gt;</description>
    </item>
    <item>
      <title>In Oracle 11g password is case sensitive</title>
      <link>https://sadalage.com/post/oracle_11g_password_is_case_sensitive/</link>
      <pubDate>Wed, 06 May 2009 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/oracle_11g_password_is_case_sensitive/</guid>
      <description>&lt;p&gt;In Oracle 10g and before we all know that passwords are not case sensitive, so PASSWORD, Password, password would let you in and everything would be okay.&lt;/p&gt;&#xA;&lt;p&gt;If you upgrade to Oracle 11g (I know lot of you are waiting for 11gR2), you will find that passwords are case sensitive. Here is an example of case sensitive passwords.&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;c:\Software&amp;gt;sqlplus bddd/bddd@dosa&#xA;SQL*Plus: Release 11.1.0.6.0 - Production on Wed May 6 15:17:43 2009&#xA;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&#xA;Connected to:&#xA;Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production&#xA;With the Partitioning and OLAP options&#xA;BDDD@dosa &amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Lets try to connect with a upper case password&lt;/p&gt;</description>
    </item>
    <item>
      <title>Oracle Metadata can be mis-leading</title>
      <link>https://sadalage.com/post/oracle_metadata_can_be_misleading/</link>
      <pubDate>Tue, 31 Mar 2009 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/oracle_metadata_can_be_misleading/</guid>
      <description>&lt;p&gt;Oracle has metadata about all its objects in various tables/views. One such view is the USER_OBJECTS or ALL_OBJECTS, this view has a column named as STATUS which shows you if the given object is VALID or INVALID. The status applies to DB Code (Stored Procedures, Functions, Triggers etc).&lt;/p&gt;&#xA;&lt;p&gt;To find all the INVALID objects in the schema, issue&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#d0d0d0;background-color:#202020;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#6ab825;font-weight:bold&#34;&gt;SELECT&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;*&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#6ab825;font-weight:bold&#34;&gt;FROM&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;USER_OBJECTS&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;&lt;span style=&#34;color:#6ab825;font-weight:bold&#34;&gt;WHERE&lt;/span&gt;&lt;span style=&#34;color:#666&#34;&gt; &lt;/span&gt;STATUS=&lt;span style=&#34;color:#ed9d13&#34;&gt;&amp;#39;INVALID&amp;#39;&lt;/span&gt;;&lt;span style=&#34;color:#666&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;One problem with the way oracle maintains this metadata is, changing the underlying table on which the DB Code depends, oracle marks the objects are INVALID even though the underlying table may have changed in such a way, that it does not affect the DB Code at all (like adding a new column, or making a colum nullable). Here is some code which shows you what I mean. Run it through SQLPlus.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Storing just the time in Oracle</title>
      <link>https://sadalage.com/post/storing_time_in_oracle/</link>
      <pubDate>Thu, 12 Feb 2009 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/storing_time_in_oracle/</guid>
      <description>&lt;p&gt;We came across a need to save just the Time in the database, the requirement is to store time of the day, like say the user likes to have Breakfast at 8.15AM and Lunch at 12.32PM etc. Off course oracle does not have a time only data type.  So we ended up using DATE as the data type and just setting the time. for example:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;CREATE TABLE FOO (PREFERRED_TIME DATE NULL);&#xA;INSERT INTO FOO (TO_DATE(&amp;#39;11:34&amp;#39;,&amp;#39;HH24:MI&amp;#39;));&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;oracle automatically sets the date to the first day of the current month. so when you do a select from the FOO table the data would be&lt;/p&gt;</description>
    </item>
    <item>
      <title>ThoughtWorks at Oracle Open World</title>
      <link>https://sadalage.com/post/thoughtworks_at_oracle_open_world/</link>
      <pubDate>Tue, 30 Oct 2007 00:00:00 +0000</pubDate>
      <guid>https://sadalage.com/post/thoughtworks_at_oracle_open_world/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;http://thoughtworks.com&#34;&gt;Thoughtworks&lt;/a&gt; is going to be at &lt;a href=&#34;http://www.oracle.com/openworld/2007/index.html&#34;&gt;Oracle Open World&lt;/a&gt;. I&amp;rsquo;m excited about this especially since it will give ThoughtWorks and Me to talk about software practices and how to apply these software practices to the database development world, off course I will talk about my books Refactoring Databases and Continuous Database Integration. ThoughtWorks will have a booth at &lt;em&gt;343 Moscone South&lt;/em&gt; and I will be there on Nov 14.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
