Oracle ORA-02287: sequence number not allowed here

I’ve recently hit an issue when trying to include a sequence.nextval in an Oracle database view. the database throws the following error: [crayon-5aba534de1f38771671729/] I can see why that might not be allowed – each time you select from the view you’ll get a new sequence number making it a bit daft for most circumstances. I

Oracle View Sequence Test

[crayon-5aba534de29e0881227783/]  

SQLDeveloper: User Defined Extensions and ForeignKey query revised

It was so fun: yesterday I wrote  a small article on creating a query on Foreign Keys refering a certain table. A post with content that I made up dozens of times in my Oracle carreer. And right away I got 2 good comments. One was on the blog itself.

And of course Anonymous is absolutely right. So I added 'U' as a constraint type option.

The other comment was from my much appreciated (more...)

Which tables have foreign keys refering to a particular table?

Ok, this time a quick not so exciting post. Actually, I find my self recreating a query again, that I created many times in my carreer. So, why not post it?

Last year, I published my Darwin Object Type Accelerator (Dotacc). It allows you to generate objects from a datamodel. What it also does is create collection types for tables that refer to the tabel you want to generate an object for. For some you (more...)

Duplicating a Database on ODA

Introduction

Every so often, we get a request to duplicate a database for one of our customers using an Oracle Database Appliance (ODA). The process for doing that is relatively straightforward, but there are a couple of nuances along the way so I thought I’d write it up as a blog post in case it’s of use to others. Obviously, I have obfuscated any customer-specific information to protect their identity.

Configuration

The first nuance is (more...)

18c is now available (but only on the Cloud)

On Friday afternoon (16th February) we started to see tweets and blog posts from people in Oracle saying that Oracle 18c was now available. But is only available on Oracle Cloud and Engineered Systems.

It looks like we will have to wait until the Autumn before we can install it ourselves on our own servers :-(

Here is the link to the official announcement for Oracle 18c.

Oracle 18c is really Oracle 12.2.0. (more...)

Post GI / RDBMS Installation Configuration Steps

Introduction

This is the third article in a series of blog posts on building a test environment to closely match a Production environment so we could then upgrade the test environment from Oracle Database 12.1 to Oracle Database 12.2. In the first post, I covered performing a silent installation of the grid infrastructure software. In the second post, I followed that by performing a similar silent installation of the RDBMS software. (more...)

Oracle Exadata Smart Flash Logging

What is Exadata Smart Flash Logging?

In an OLTP environment, it is crucial to have fast response times to redo log writes i.e. low latency.  When multiplexing redo logs for high availability i.e. to protect against hardware failure, redo log writes are only acknowledge when redo is written to all redo log members i.e when the slowest disk completes the write.  By this nature, whenever a disk slows down even (more...)

Why I picked Postgres over Oracle, part III

This is the final episode of this short series of blog posts on some of my drivers for moving to Postgres from Oracle.
Please do read Part I and Part II of the series if you have not done so. It discussed the topics “History”, “More recently”, “The switch to Postgres”, “Realization”, “Pricing”, “Support” and “Extensibility”.

In summary:

  • Part one focused on “why not Oracle anymore, so much”
  • Part two discussed on the comparison (more...)

How to fix queries on DBA_FREE_SPACE that are slow

I found myself in a situation where OpsView a monitoring tool, was having difficulty monitoring the tablespaces for a particular pluggable database.

Upon investigation it was found the queries against the dictionary table DBA_FREE_SPACE were taking a very long time:

SQL> set timing on
SQL> select nvl(sum(dfs.bytes)/1024/1024,0) from dba_free_space dfs where dfs.tablespace_name = 'USERS';

NVL(SUM(DFS.BYTES)/1024/1024,0)
-------------------------------
 70.75

Elapsed: 00:00:10.98

There are 60 tablespaces in this pluggable database, which the time varied (more...)

Using SQL*Plus to Seed your Dockerized Oracle Database

In my last blog, you learned  to create a containerized Oracle database for your development/testing purpose. You also know how to connect to your container and run command in the container.

Most applications require some reference data e.g. example,my  OrderApp application based on Apache Tom EE  requires catalog data to be pre-populated before I can test my application. 

One of the readers asked me how can we run a SQL (more...)

Dockerizing Your Development and Test Oracle databases

You are probably reading this blog because your application depends on Oracle database. Most enterprises in the world depend on Oracle database to run their business. If you are a developer using Oracle database and getting started with Docker, you must be wondering how can you use a containerized Oracle database. 

In my last blog, I outlined how you can use a Dockerized Tomcat /Tom EE with an Oracle database. In this blog, (more...)

Dockerize Tomcat/Tom EE and Oracle database applications



Docker ... Docker -- everywhere ..

Docker has gained quite a bit of popularity in simplifying operations for micro services applications. It also helps reduce cost of development and testing applications improves developer productivity it’s the portable characteristics and by allowing them to create local development environment that mimics production.

In this article, I will show how you can containerize or Dockerize a simple web application application that uses Apache Tomcat / Tom EE and Oracle database. (more...)

Why I picked Postgres over Oracle, part II

Continuing this short series of blog posts on some of my drivers for moving to Postgres from Oracle.
Please do read Part I of the series if you have not done so. It discussed the topics “History”, “More recently” and “The switch to Postgres”.

Realization

In the last months, discussing Postgres with my Oracle peers, playing with the software and the tooling, I actually quite quickly realized Postgres is a lot cooler, at least to (more...)

Why I picked Postgres over Oracle, part I

As with many stories, if you have something to tell, it quickly takes up a lot of space. Therefor this will be a series of blog posts on Postgres and a bit of Oracle. It will be a short series, though…

Let’s begin

History

 I have started with databases quite early on in my career. RMS by Datapoint… was it really a database? Well, at least sort of. It held data in a central (more...)

Adaptive Query Performance Fixes for #DB12c Release 1

We all know adaptive query feature introduced in Oracle Database Release 1 is a problem. Recently I had the opportunity to review few 12cR1 databases and found that to alleviate the performance problems, the DBA set parameter OPTIMIZER_FEATURES_ENABLE=11.2.0.4 in Oracle Database 12c Release 1 (12.1.0.2). This observation is the catalyst for the blog “Adaptive Query …

New READ Object Privilege in 12cR1

In writing a blog post about:
Creating a Read Only Database User Account in an Oracle Database

It came to my attend of the new “READ” object privilege, which is a New Feature in 12.1.0.2:
Changes in Oracle Database 12c Release 1 (12.1.0.2)
READ and SELECT Object Privileges

The “SELECT” object privilege in addition to querying the table, allow the user to:
LOCK TABLE table_name (more...)

Creating a Read Only Database User Account in an Oracle Database

It can be quite common to create a “Read Only” database user account in an Oracle database.  To do this is pretty simple using the principle of least privilege:

CREATE USER READ_ONLY IDENTIFIED BY "password";
GRANT CREATE SESSION TO READ_ONLY;

Expected output:

SQL> CREATE USER READ_ONLY IDENTIFIED BY "password";

User created.

SQL> GRANT CREATE SESSION TO READ_ONLY;

Grant succeeded.

SQL>

To see specific tables for a schema:

SET HEADING OFF
SET PAGES  (more...)

“#PL/SQL: Therefore, whoever binds forever: automate your tests” – I’m a speaker at #DOAG2017

 

Today my presentation is confirmed: “Therefore, whoever binds forever: automate your tests”. Maybe the German pun will be the better understood: “PL/SQL: Drum test-automatisiere, wer sich sich ewig bindet!”

I will speak over my experiences with following

  • several PL/SQL testing tools like at least
  • I will give you a demo of this tools and compare their capabilities for
    • architecture
    • branching
    • continuous integration
    • code coverage

If you (more...)

TNS-12543: TNS:destination host unreachable

Scenario : Setting up a physical standby from Exadata to a non-Exadata single instance. tnsping from standby to primary works fine but tnsping from primary to standby fails with:

TNS-12543: TNS:destination host unreachable

I am able to ssh standby from primary, can ping as well but tnsping doesn’t work.  From the error description we can figure out that something is blocking the access. In this case it was iptables that was enabled on the standby (more...)