Author Archives: José António Fernandes

Find LOB object parent table

Some times you find that there are some BIG lob segments and you don’t know which table they belong to…

Here’s the solution:

SELECT TABLE_NAME, column_name
FROM   user_lobs
WHERE  segment_name = (SELECT object_name
                       FROM   user_objects
                       WHERE  object_name = UPPER('&object_name')
                       AND    object_type = 'LOB');

in MacLochlainns Weblog

I hope it was useful!!!
Cheers

Recover GAP on Logical Standby with errors on apply

  • Verify logstandby background processes
SELECT PID, TYPE, STATUS, HIGH_SCN FROM V$LOGSTDBY;
  • Start logstandby apply processes
ALTER DATABASE START LOGICAL STANDBY APPLY IMMEDIATE;
  • If the processes stop, verify the logstandby events and generate the script to skip the transaction if necessary

NOTE: If it’s your production environment, please check with application development team the transactions with error.

set lines 200 pages 200
col status for a30
col script for a50
SELECT to_char(EVENT_TIME,'dd-mm-yyyy hh24:mi:ss'), XIDUSN, XIDSLT, XIDSQN, STATUS, STATUS_CODE,
'EXEC DBMS_LOGSTDBY.SKIP_TRANSACTION ('||XIDUSN||','||XIDSLT||','||XIDSQN||');' "SCRIPT"
FROM DBA_LOGSTDBY_EVENTS WHERE EVENT_TIME = (SELECT MAX(EVENT_TIME) FROM DBA_LOGSTDBY_EVENTS);
  • Skip Transaction
EXEC DBMS_LOGSTDBY.SKIP_TRANSACTION (XIDUSN=>10,XIDSLT=>40,XIDSQN=>36784);

The script above is generated on logstandby events query.

I hope it was useful!!!
Cheers

Oracle EM DBConsole don’t start due to Error starting ORMI server

If your Enterprise Manager Console won’t start due to “Error starting ORMI server … port 5520. The socket name is already in use”, here’s the solution:

  • Shutdown Enterprise Manager Console.
emctl stop dbconsole
  • Check if there are any processes with name like “oc4j”. If there are, kill them.
ps -ef | grep oc4j
kill -9 ....
  • Open Enterprise Manager Console.
emctl start dbconsole

in Bünyamin Balaban – Oracle Blog

I hope it was useful!!!
Cheers

Oracle RAC 11g R2 on AIX 7.1 installation issue on irman relink

If you are installing Oracle RAC 11g R2 on AIX 7.1, you may have the following error:

You press retry and the installation finish without any more errors. This error will occour on both CRS installation and Database installation.

After that I had a ORA-03113: end-of-file on communication channel on dbca database creation.

Checking installation log I found the following error:

0711-780 SEVERE ERROR: Symbol .ksmpfpva

It can happen during installation, re-linking or patching

If the relink error is ignored, the following error is reported when shutting down database:

ORA-03113: end-of-file on communication channel

In instance alert.log:

ORA-07445 [ksmpclrpga()+23248]

Call stack from trace file:

skdstdst ksedst1 ksedst dbkedDefDump ksedmp ssexhd 47dc opidcl opidrv sou2o opimai_real ssthrdmain main start

This problem is also known to generate large core files at the time of hitting ORA-7445 [ksmpclrpga]:
A core file is likely generated in $ORACLE_HOME/dbs

Cause

AIX OS issue.

Solution

The following AIX fix needs to be applied:

For AIX 7.1 apply IFIX IV09541: https://www-304.ibm.com/support/docview.wss?uid=isg1IV09541

At the time of this writing, IBM has pre-built the iFixes and uploaded to:

ftp://public.dhe.ibm.com/aix/efixes/

where the APAR numbers are:

5.3 TL11 – iv10538
5.3 TL12 – iv11158
6.1 TL4 – iv11167
6.1 TL5 – iv10576
6.1 TL6 – iv10539
6.1 TL7 – iv09580
7.1 TL0 – unaffected
7.1 TL1 – iv09541

Once the OS patch is applied, relink oracle binary so it will be effective.

in Oracle Support

This worked for me…

I hope it was useful!!!
Cheers

Configure NTP on AIX 7.1 for Oracle RAC

  1. Verify that you have a server suitable for synchronization. Enter:
  1. # ntpdate -d ip.address.of.server

    The offset must be less than 1000 seconds for xntpd to synch. If the offset is greater than 1000 seconds, change the time manually on the client and run the ntpdate -d again.

    If you get the message, "no server suitable for synchronization found", verify xntpd is running on the server (see above) and that no firewalls are blocking port 123.

  2. Specify your xntp server in /etc/ntp.conf, enter:
  1. # vi /etc/ntp.conf

    (Comment out the “broadcastclient” line and add server ip.address.of.server prefer.)Leave the driftfile and tracefile at their defaults.

  2. Start the xntpd daemon:
  1. # startsrc -s xntpd

    (Use the -x flag if it is appropriate for your environment.)

  1. Uncomment xntpd from /etc/rc.tcpip so it will start on a reboot.
  1. # vi /etc/rc.tcpip

    Uncomment the following line:

    start /usr/sbin/xntpd "$src_running" "-x"

    NOTE: Use the -x flag to prevent the clock from changing in a negative direction.

  2. Verify that the client is synched.
  1. # lssrc -ls xntpd

    NOTE: Sys peer should display the IP address or name of your xntp server. This process may take up to 6 minutes.

in IBM Support

ATENTION!!!

Check your Time Zone settings. We had to change to our Time Zone (Lisbon).

The default value is CST6DST. Run the commad:

smit chtz_user

and change the values to GMT0WET.

Here’s a list of the values you can use: http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.files%2Fdoc%2Faixfiles%2Fenvironment.htm

I hope it was useful!!!
Cheers

Install Adobe Flash Plugin on Ubuntu 12.04 LTS Precise Pangolin

After upgrade my Ubuntu 11.10 to the new Ubuntu 12.04 LTS almost everything worked perfectly.

The first thing I notice was that some of the shell extentions I had didn’t work (Alternate Menu). But that was not an issue.

The real issue was that the installation of Adobe Flash Player run successfully but the installation of flash plugin didn’t work that well…it raised the following error:

Failure to download extra dat file Name-or.UTF-8

After days of research, yesterday I found a question on Launchpad.net related to Ubuntu 12.04 Beta2 Adobe Flash Player Update issue.

Turns out that the solution to that issue, was the solution to my issue.

Here’s the commands to solve Adobe Flash Player Plugin installation on Ubuntu 12.04 LTS:

sudo apt-get --purge remove adobe-flash-properties-gtk adobe-flashplugin
sudo dpkg -P flashplugin-installer
sudo apt-get --purge autoremove
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install adobe-flashplugin

in Launchpad.net Answers

I hope it was useful!!!
Cheers

Install / Configure utl_mail and utl_smtp on Oracle 11g R2

Install utl_mail/utl_smtp

[host@oracle]$ cd $ORACLE_HOME/rdbms/admin
[host@oracle]$sqlplus / as sysdba
SQL> @utlmail
SQL> @utlsmtp
SQL> @prvtmail.plb
SQL> GRANT EXECUTE ON utl_mail TO PUBLIC;
SQL> GRANT EXECUTE ON utl_smtp TO PUBLIC;
SQL> alter system set smtp_out_server='mail.server.com' scope=both;

ACL: Access Control List

in White Horses Blog

Create ACL and privileges

Now first create an ACL as SYS (or any other user with DBMS_NETWORK_ACL_ADMIN execute granted), this will hold the privileges. You can add as many privileges as you like to this file, but I would recommend to split privileges in the ACL to specific tasks or users. You must create an ACL with at least one privilege, so lets start with the ‘connect’ privilege for user SCOTT, (also a role can be added as principal):

begin
  dbms_network_acl_admin.create_acl (
    acl         => 'utl_mail.xml',
    description => 'Allow mail to be send',
    principal   => 'SCOTT',
    is_grant    => TRUE,
    privilege   => 'connect'
    );
    commit;
end;

Add Privilege

Great, now that the ACL is created, you can add more privileges like the ‘resolve’ privilege:

begin
  dbms_network_acl_admin.add_privilege (
  acl       => 'utl_mail.xml',
  principal => 'SCOTT',
  is_grant  => TRUE,
  privilege => 'resolve'
  );
  commit;
end;

Assign ACL

Cool, you granted SCOTT to connect and resolve, but you have not defined to which resources he is allowed to connect:

begin
  dbms_network_acl_admin.assign_acl(
  acl  => 'utl_mail.xml',
  host => 'smtp server host name or address'
  );
  commit;
end;

I hope it was useful!!!
Cheers

How To Resize /dev/shm Filesystem In Linux

By default installation, RHEL and most Linux distributions mount tmpfs (a RAM-based temporarily filesystem) to /dev/shm directory and this temporarily filesystem size is always set to be half of the installed memory.

If that default size is not something expected, you can increase or reduce the /dev/shm filesystem size at wish.

To be even extreme, you may drop or disable this temporarily RAM-based filesystem entirely, to prevent it from auto-mount during system boots up, if none of the application in that Linux server relying on shared memory function or explicitly using tmpfs (as a quick-and-dirty trick to improve execution performance).

To increase or decrease /dev/shm filesystem size

1) Open /etc/fstab with vi or any text editor of your choice,

2) Locate the line of /dev/shm and use the tmpfs size option to specify your expected size,

e.g. 512MB:
tmpfs /dev/shm tmpfs defaults,size=512m 0 0
e.g. 2GB:
tmpfs /dev/shm tmpfs defaults,size=2g 0 0

The /etc/fstab content format is documented in man fstab and the tmpfs filesystem options can be found in man mount

3) To make change effective immediately, run this mount command to remount the /dev/shm filesystem:

mount -o remount /dev/shm

in Walker News

I hope it was useful!!!
Cheers

vmount: Not owner error on Linux NFS Export

While mounting NFS filesystem from AIX node named AIX_LPAR onto Linux NFS server Linux_NFS_server, got the error:

vmount: Not owner

root [AIX_LPAR] /tmp: mount Linux_NFS_Server:/local/home/app/media /mnt
mount: giving up on:
 Linux_NFS_Server:/local/home/app/media
vmount: Not owner

Solution:

Set parameter nfs_use_reserved_ports to 1 on client AIX_LPAR

root [AIX_LPAR] /tmp: nfso -o nfs_use_reserved_ports=1
Setting nfs_use_reserved_ports to 1
root [AIX_LPAR] /tmp: mount Linux_NFS_Server:/local/home/app/media /mnt

I hope it was useful!!!
Cheers

Oracle 11gR2 Enabling and Disabling Database Options After Installation

When you install Oracle Database, some options are enabled and others are disabled. To enable or disable a particular database feature for an Oracle home, shut down the database and use the chopt tool.

The chopt tool is a command-line utility that is located in the directory $ORACLE_HOME/bin. It uses the following syntax, where db_option is the option whose status you want to modify:

chopt [enable | disable] db_option

The possible values for db_option are:

Value Description
dm Oracle Data Mining Database Files
dv Oracle Database Vault
lbac Oracle Label Security
olap Oracle OLAP
partitioning Oracle Partitioning
rat Oracle Real Application Testing
ode_net Oracle Database Extensions for .NET 1.x
ode_net_2 Oracle Database Extensions for .NET 2.0

In this example, the chopt tool is used to enable Oracle Label Security in the database oradb1:

$ cd $ORACLE_HOME/bin
$ srvctl stop database -d oradb1
$ chopt enable lbac
$ srvctl start database -d oradb1

in Oracle 11g R2 Documentation

I hope it was useful!!!
Cheers

Optimization WordPress Plugins & Solutions by W3 EDGE