Oracle 12c: Show PDB saved state

As of PSU 12.1.0.2, Oracle introduced “PDB State Management Across CDB Restart”, which will automatically put a pluggable database in a previously defined state on database startup. To show the current saved state of the PDBs, you can query the documented view cdb_pdb_saved_states:

SQL> SELECT con_name, instance_name, state FROM cdb_pdb_saved_states;

CON_NAME		       INSTANCE_NAME		      STATE
------------------------------ ------------------------------ --------------
P1			       cdb2			      OPEN
P2			       cdb2			      OPEN

But beware: When you unplug and plug in the database, this saved state will be lost.

I think this is one of the more awesome improvements in 12.1.0.2, since the original startup trigger was more of a workaround than a real solution.

Script to find reclaimable space in the datafiles

Storage costs are a major matter of expense in any large database environment. Therefore, in order to operate a cost-optimized environment, it makes sense to regularly review all databases in terms of datafile sizes. Usage of these files can vary dramatically, depending on the application using the database. Therefore, we need a way to quickly identify datafiles which we can shrink in order to save storage costs.

Because we cannot really influence how Oracle places the extents in a datafile, we cannot simply look at the “used” size of the datafile and resize it to that value, but need to find the HWM (high water mark) of each datafile.

Read the rest of this entry

Java Service Wrapper 3.5.26 for Windows x64

A friendly developer (Hello Dannes :)) notified me that there is a new version of the Tanuki wrapper available. So I hereby provide the latest version 3.5.26 of the Tanuki Java Service Wrapper for Windows x64.

As always, I don’t guarantee anything, so please note:

Read the rest of this entry

iptables ACCEPT [0:0] brackets

So lately I have been working a lot more with Linux networking. Consider an iptables configuration like this:

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [7752:8249066]
[..]
-A RH-Firewall-1-FORWARD -p icmp -m icmp --icmp-type any -j ACCEPT 
-A RH-Firewall-1-FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT 
-A RH-Firewall-1-FORWARD -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT 
[..]
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited 
COMMIT
# Completed on Fri Nov 21 15:44:47 2014

Ever noticed the brackets right next to the chain? What are those? What do the numbers mean?

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [7752:8249066]

The answer is pretty easy and pretty obvious in hindsight. These numbers report

  • packet counter for the chain
  • byte counter for the chain

So in our example above, the OUTPUT chain matched 7752 packets and 8249066 bytes.

Tiny Tiny RSS / MySQL: Problems with UTF8 Emojis

Since Google shut down its Reader service, I am a regular user of the Tiny Tiny RSS reader. Having my own RSS reader installation gives me more power regarding my privacy and the services I am using. Consider me a happy user.

However, there are some issued regarding full UTF8 support when using MySQL. When a feed uses UTF8 emoijs, tt-rss will throw up and report an error. Unfortunately, this only manifests itself with log entries like this:

Read the rest of this entry

Target Types in Oracle EM Cloud Control 12c

So often when issuing a emctl (Enterprise Manager Command Line Utility) command, one needs to specify a target type. This is often the case when the command affects a certain target (for example emctl reload agent dynamicproperties ...).

The most often used target types are the following:

  • oracle_database (Oracle Instance)
  • oracle_emd (Agent)
  • host (Host Machine)

However, there are a lot of other target types available. We can get all available target types for Oracle Enterprise Manager Cloud Control 12c if we query the SYSMAN.EM_TARGET_TYPES table in the Enterprise manager repository:

Read the rest of this entry

Oracle introduces Recertification

So today I was disappointed to read that Oracle introduced a recertification requirement for the Oracle Database Administrator certificates:

The Oracle Certification Program is implementing a recertification requirement for our Oracle Database Administration credentials.
[..]
This new policy requires you as an Oracle Database credential holder to demonstrate your currency with the most recent trends, techniques and best practices in Oracle Database technology.

More details can be found on the new website for these new requirements.

Recertification, really? And probably you’ll then proceed to tell me that I need to attend an Oracle University course to upgrade my certification to a newer release, yeah? This is bullshit…

ORA-07274: spdcr: access error, access to oracle denied

So today, during the upgrade of a database, all other databases using the same ORACLE_HOME stopped dead in their tracks. The ALERT log reported the following:

2014-09-30 13:34:41.622000 +02:00
Archived Log entry 24398 added for thread 1 sequence 24398 ID 0x2d91d796 dest 1:
2014-09-30 13:47:39.764000 +02:00
Errors in file /u00/app/oracle/diag/rdbms/kdb12345/kdb12345/trace/kdb12345_psp0_57147560.trc:
ORA-07274: spdcr: access error, access to oracle denied.
IBM AIX RISC System/6000 Error: 2: No such file or directory
PSP0 (ospid: 57147560): terminating the instance due to error 7274
2014-09-30 13:47:41.346000 +02:00
System state dump requested by (instance=1, osid=57147560 (PSP0)), summary=[abnormal instance termination].
System State dumped to trace file /u00/app/oracle/diag/rdbms/kdb12345/KDB12345/trace/KDB12345_diag_49938448_20140930134741.trc
2014-09-30 13:47:44.779000 +02:00
Instance terminated by PSP0, pid = 57147560

Hmm, so what to do? In the trace file, we find out a bit more:

Read the rest of this entry

Oracle Primary Key Sequence Performance

With Oracle 12c, Oracle introduced a new way to insert primary keys into tables: The GENERATED BY DEFAULT and DEFAULT keywords.

In this post, I want to compare the performance of different methods to insert a primary key into a table in Oracle. The comparison will also include older methods, such as using a trigger or specifying the primary key in the INSERT statement. These methods can also be used in Oracle versions earlier than 12c.

First of all, let’s look at the possible ways to insert the value of a sequence into a table:

Read the rest of this entry

Hello world

My name is Simon Krenger, I am a Technical Account Manager (TAM) at Red Hat. I advise our customers in using Kubernetes, Containers, Linux and Open Source.

Elsewhere

  1. GitHub
  2. LinkedIn
  3. GitLab