Monday, April 23, 2018

Oracle GoldenGate replicat abends with ORA-01031 when trying to replicate a CREATE MATERIALIZED VIEW DDL statement


After enabling DDL replication, GoldenGate replicat abends with:

Oracle GoldenGate Delivery for Oracle, <replicat>.prm: Fatal error executing DDL replication: error [Error code [1031], ORA-01031: insufficient privileges SQL create materialized view "<USER>"."<MVNAME>" enable query rewrite as ...

This happens, although I have given the ggadmin replicat user all the required privileges to create the materialized view (CREATE ANY MATERIALIZED VIEW, SELECT ANY TABLE, GLOBAL QUERY REWRITE). Even dba is not sufficient for the replicat user to be able to create the MV on another schema.

Reason is, that the schema owning the table (SCOTT in my case) does not have the "CREATE TABLE" priviledge directly, but only through the RESOURCE role.

After granting CREATE TABLE to the owner of the table, the GoldenGate replicat user can now create the materialized view.

Thursday, May 04, 2017

Unable to install VBOXADDITIONS to Oracle Linux 7.x

After installing brand new Oracle Linux 7.3 as Virtual Box VM, I was unable to install VBOXADDITIONS. Error message in /var/log/vboxadd-install.log:
/tmp/vbox.0/Makefile.include.header:112: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again.

Solution is to install kernel-devel and kernel-uek-devel (if UEK is booted). So run:
yum update
yum install kernel-devel
yum install kernel-uek-devel

But then it was also required to set the environment variable as mentioned in the error message:
export KERN_DIR=/usr/src/kernels/4.1.12-94.2.1.el7uek.x86_64

and then run VBoxLinuxAdditions.run again.

Wednesday, December 07, 2016

GoldenGate fails with OGG-08221 Cannot register or unregister EXTRACT because of the following SQL error: OCI Error 1,031.

Problem:

When trying to register an extract in GoldenGate ggsci, the following error is returned:
OGG-08221 Cannot register or unregister EXTRACT <some_name> because of the following SQL error: OCI Error 1,031.

Solution:

The cause of this issue is the database initialization parameter THREADED_EXECUTION=TRUE
The solution is the same as in my other post here.

Thursday, August 11, 2016

sqlplus / as sysdba returns ORA-01017: invalid username/password; logon denied

Problem:

sqlplus / as sysdba fails with ORA-01017 while sqlplus sys/<pwd> as sysdba connects successfully to the database

Solution:

since Oracle 12.1. there is a new process model called "multithreaded Oracle Database model". This new feature is controlled by the initialization parameter THREADED_EXECUTION. If set to TRUE, some Oracle processes do NOT run as operating system processes, but as THREADS within a process.

So - if THREADED_EXECUTION = TRUE, operating system authentication (sqlplus / as sysdba) does not work. If set to false (ALTER SYSTEM SET THREADED_EXECUTION=FALSE SCOPE=SPFILE), os authentication works again (after restart of the database). But the database requires slightly more memory because each client spawns its own dedicated server process instead of thread.

The processes, in which those background threads are running, are called ora_u<xxx>_<sid> where <xxx> is some number (like 004) and <sid> is the ORACLE_SID value of the database.

The database view v$process now has a new column named STID which identifies the thread number within the process (SPID). So - if you are running the multithreaded model, you can see your OS process and thread by running something like the following query:

SELECT SPID, STID FROM V$PROCESS P, V$SESSION S
  WHERE P.ADDR = S.PADDR 
     AND S.USERNAME = <your user>

A
ps -ef | grep <SPID>
or
ps -eLf | grep <STID>
will show the background process in which the user's thread is running

Friday, April 08, 2016

How to create an icon to launch a new Terminal on the Desktop of an Oracle Linux 7 installation

Oracle Linux 7 uses  a new Gnome version. Since then it is no longer possible to "drag & drop" an icon from the menus to the desktop.

To create a new icon on your desktop to launch a Terminal session, do the following:
  1. Go to the "Desktop" folder of your login account
  2. Create a new file with the extension "desktop" e.g. gnome-terminal.desktop 
  3. Put the following content into that file:

    #!/usr/bin/env xdg-open

    [Desktop Entry]
    Name=Terminal
    Name[de]=Terminal
    Comment=Use the command line
    Comment[de]=Befehlszeile verwenden
    Keywords=shell;prompt;command;commandline;
    Keywords[de]=Shell;Prompt;Befehl;Befehlszeile;
    TryExec=gnome-terminal
    Exec=gnome-terminal
    Icon=/usr/share/icons/gnome/48x48/apps/utilities-terminal.png
    Type=Application
    X-GNOME-DocPath=gnome-terminal/index.html
    X-GNOME-Bugzilla-Bugzilla=GNOME
    X-GNOME-Bugzilla-Product=gnome-terminal
    X-GNOME-Bugzilla-Component=BugBuddyBugs
    X-GNOME-Bugzilla-Version=3.8.4
    Categories=GNOME;GTK;Utility;System;TerminalEmulator;
    StartupNotify=true
  4. Make the file "executable":
    chmod +x gnome-terminal.desktop
  5. Done :-)

Friday, March 18, 2016

Install Adobe flash player for use with Firefox into Oracle Linux 6

I am running an Oracle Linux 6 OS in my Virtual Box and just recognized that there is no Flash Player plugin in my local Firefox installation.

The approach seems easy: Go to the adobe site, download the flash plugin, install it and you are done. Hahaha ...
If I download the rpm installer (adobe-release-x86_64-1.0-1.noarch.rpm as the time of this writing) and run "sudo yum install adobe-release-x86_64-1.0-1.noarch.rpm" or "sudo rpm -i adobe-release-x86_64-1.0-1.noarch.rpm", the installation seems to be successful, but I still don't have a Flash plugin in my browser.

The solution is
download the .tar.gz file from https://get.adobe.com/flashplayer/otherversions/
unzip it into some directory
copy libflashplayer.so into the $HOME/.mozilla/plugins directory
and voila ... that's it.


Thursday, March 17, 2016

Oracle Linux 6 no longer boots in virtual box after update

After running yum update on my Oracle Linux 6.7 the system no longer boots into runlevel 5. The last message on the boot screen is
Starting atd: [ OK ]
but the system does not boot into graphical environment anymore.

I can boot into runlevel 3 by
  • pressing any key at the boot prompt to enter the boot menu
  • press the "e" key on the line of the kernel I want to boot
  • use the cursor keys to move to the line which starts with "kernel /vmlinuz [...]"
  • again press the "e" key on that "kernel" line 
  • append " 3" at the end of the line and press ENTER
  • and press the "b" key to boot with that modifications 
Now the system comes up. Looking into the /var/log directory, I see a couple of Xorg.<n>.log files.

One of those files shows the following error message:
(II) LoadModule: "vboxvideo"
(II) Loading /usr/lib64/xorg/modules/drivers/vboxvideo_drv.so
(II) Module vboxvideo: vendor="Oracle Corporation"
    compiled for 1.10.0, module version = 1.0.1
    Module class: X.Org Video Driver
    ABI class: X.Org Video Driver, version 10.0
(EE) module ABI major version (10) doesn't match the server's version (15)
(II) UnloadModule: "vboxvideo"
(II) Unloading vboxvideo
(EE) Failed to load module "vboxvideo" (module requirement mismatch, 0)
(EE) No drivers available.
(EE)
Fatal server error:
(EE) no screens found(EE)

The cause of this error is that the upgrade of the Linux OS does not re-configure the vbox additions (see https://www.virtualbox.org/ticket/13522)
So I need to run
/etc/init.d/vboxadd-x11 setup 
as root. A new reboot now boots into graphical mode again.

Another solution is to rename (or delete) /etc/X11/xorg.conf.

But the VBox Guest Addition is still not working (which it did before the upgrade). For this, the VBOXADDITIONS setup has to be run again.