Friday, October 2, 2015

Invalid password while logging 12c ASM instance

Customer complains that he cannot log into 12c ASM instance because of invalid username/password, but he is pretty sure username and password are correct.
$ . oraenv
ORACLE_SID = [+ASM] ? +ASM
The Oracle base remains unchanged with value /u01/app
$
$ sqlplus /nolog

SQL*Plus: Release 12.1.0.2.0 Production on Fri Oct 2 10:26:38 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

SQL> connect sys as sysasm
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied

Try to log in through OS authentication and reset the password:
SQL> conn / as sysasm
Connected.

SQL> alter user sys identified by abc123;
alter user sys identified by abc123
                             *
ERROR at line 1:
ORA-01918: user 'INTERNAL' does not exist

SQL> select * from v$pwfile_users;

no rows selected

Looks like the password file is missing:
$ ls -l $ORACLE_HOME/dbs
total 18
-rw-rw----   1 oragrid  oracle      2180 Jul 24 13:32 ab_+ASM.dat
-rw-rw----   1 oragrid  oracle      1544 Oct  2 10:28 hc_+ASM.dat
-rw-r--r--   1 oragrid  oracle      2992 Feb  3  2012 init.ora

Ok, the password file is not there as before. And we know it can be stored in ASM diskgroup from 12c, check if it is the case:
$ srvctl config asm -a
ASM home: 
Password file:
ASM listener: LISTENER
Spfile: +DATA/ASM/ASMPARAMETERFILE/registry.253.885907629
ASM diskgroup discovery string:
ASM is enabled.
ASM is individually enabled on nodes:
ASM is individually disabled on nodes:
$

The entry 'Password file' is empty, it is not expected configuration if password file does not exist in $ORACLE_HOME/dbs. Let us see if there is password file in ASM:
$ asmcmd
ASMCMD> ls -l
State    Type    Rebal  Name
MOUNTED  EXTERN  N      DATA/
MOUNTED  EXTERN  N      FRA/
ASMCMD> cd DATA
ASMCMD> ls -l
Type      Redund  Striped  Time             Sys  Name
                                            Y    ASM/
                                            Y    DB01/
PASSWORD  UNPROT  COARSE   JUL 14 09:00:00  N    orapwasm => +DATA/ASM/PASSWORD/pwdasm.256.885030391
ASMCMD> exit

The password file 'orapwasm' is in 'DATA' diskgroup, update Oracle Restart registry:
$ srvctl modify asm -pwfile +DATA/orapwasm
$ srvctl config asm -a
ASM home: 
Password file: +DATA/orapwasm
ASM listener: LISTENER
Spfile: +DATA/ASM/ASMPARAMETERFILE/registry.253.885907629
ASM diskgroup discovery string:
ASM is enabled.
ASM is individually enabled on nodes:
ASM is individually disabled on nodes:

try logging again:
$ sqlplus sys as sysasm

SQL*Plus: Release 12.1.0.2.0 Production on Fri Oct 16 11:16:04 2015

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Automatic Storage Management option

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM     CON_ID
------------------------------ ----- ----- ----- ----- ----- ----- ----------
SYS                            TRUE  TRUE  TRUE  FALSE FALSE FALSE          0
ASMSNMP                        TRUE  FALSE FALSE FALSE FALSE FALSE          0

It works.

Monday, September 21, 2015

Using Corrective Action to capture and email database status

As DBA, were you asked questions like:
I was blocked by other database sessions last night, could you please check who blocked me and what he was doing at that time?
My query ran into an temp tablespace space error, could you please check who was using large temporary space at that moment?
They are not hard questions, but you will find that it is not easy to answer them unless you have proactive consideration.

Here, I am going to show how easy it is to do that using Corrective Action in Oracle Enterprise Manager Cloud Control 12c.

1. Setting Up a Mail Server for Notifications
Log into OEM, from the [Setup] menu, select [Notifications], then select [Notification Methods]



2. Setting Up E-mail for Yourself
From [username] drop-down menu, select [Enterprise Manager Password & E-mail]. Click [Add Another Row] to create a new e-mail entry field in the E-mail Addresses table. Specify the e-mail associated with your Enterprise Manager account. All e-mail notifications you receive from  Enterprise Manager will be sent to the e-mail addresses you specify.



3. Set up a Notification Schedule 
Once you have defined your e-mail notification addresses, you will need to define a notification schedule.
From [Setup] menu, select [Notifications], then select [My Notification Schedule]. Follow the directions on the Notification Schedule page to specify when you want to receive e-mails


4.  Creating Incident Rules for the events you want to monitor
From the [Setup] menu, select [Incidents], then select [Incident Rules]. Click [Create Rule Set...]


In [Create Rule Set] page,  specify the [Name], [Description], and the [Targets] to which the rules set should apply. Then click [Create...] to display [Select Type of Rule to Create] window, select [Incoming Events and updates to events], click [Continue].


In [Create New Rule: Select Events] page, select [Specific events of type Metric Alert], click [Add] to display [Select Specific Metric Alert] page, select [User Block] for metric and appropriate options for [Severity] and [Corrective action status], then click [Ok]



Back to [Create New Rule: Select Events] page, click [Next] to display [Create New Rule: Add Actions] page. Click [Add] to display
[Add Actions] page, specify your username for [E-mail To] Notificatios, then click [Continue] to return to [Create New Rule: Add Actions] page. Click [Next] to specify Name and Description for new rule, then click [Next] to display [Create New Rule: Review] page, click [Continue]



Back to [Create Rule Set] page, click [Save] to return to [Incident Rules - All Enterprise Rules] page.



5.     Create Corrective Actions

In database home page, from [Oracle Database] menu, select [Monitoring], then click [Metric and Collection Settings] to display [Metric and Collection Settings]

In [Metric and Collection Settings], click [Disabled] in the [Collection Schedule] field after metric [User Block] to enable metric collection. Then click edit image after metric [Blocking Session Count] to display [Edit Advanced Settings: Blocking Session Count].
In [Edit Advanced Settings: Blocking Session Count], select [All others] then click [Edit] button to display [Edit Advanced Settings: Blocking Session Count for All others]

In  [Edit Advanced Settings: Blocking Session Count for All others], enter 2 for [Warning Threshold] and 5 for [Critical Threshold], then click [Add] button beside [Warning].

In [Add Corrective Action] page, select [SQL Script] from dropbox then click [Continue] button to display [Create 'SQL Script' Corrective Action].

In [Create 'SQL Script' Corrective Action]
* Enter Name and Description in tab [Gerneral]
* Enter SQL statements in tab [Parameters], here, SQL statements are what you want to run immediately after the alert is generated.
* Enter database credential and host credential information.



Then click [Continue] button and back to [Edit Advanced Settings: Blocking Session Count] page, then click [Continue], then click [Continue] again and back to [Metric and Collection Settings], then click [Ok] button to save changes.

6.    Make sure Notification Email include message of Corrective Actions' status

From [Setup] menu, select [Notifications], then select [Customize Email Formats]


Click [Customize] to bring up following window and make sure Corrective Actions' section is there (It is default configuration)


Now, you will receive a email when blocked sessions are more than 2 sessions and the query result of SQL statements created in Corrective Action will be included in the email.


Thursday, July 2, 2015

Agent status shows 'Availability Evaluation Error' on EM 12c Console

Background
During deploying agent 12.1.0.4 to new host for EM 12.1.0.4, the local firewall was enabled by accident and blocked incoming access. The deployment is successful. However, OEM shows error:
'Unable to connect to the agent at https://host01.dbaplus.ca:3872/emd/main/ [Connection establishment timed out])'

After stopping firewall on the new host, agent status is shown 'Availability Evaluation Error' on EM 12c Console.
Diagnose
On the new host:
$ /u01/app/oracle/product/12.1.0/agent/core/12.1.0.4.0/bin/emctl status agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
Agent Version          : 12.1.0.4.0
OMS Version            : 12.1.0.4.0
Protocol Version       : 12.1.0.1.0
Agent Home             : /u01/app/oracle/product/12.1.0/agent/agent_inst
Agent Log Directory    : /u01/app/oracle/product/12.1.0/agent/agent_inst/sysman/log
Agent Binaries         : /u01/app/oracle/product/12.1.0/agent/core/12.1.0.4.0
Agent Process ID       : 8366
Parent Process ID      : 8280
Agent URL              : https://host01.dbaplus.ca:3872/emd/main/
Local Agent URL in NAT : https://host01.dbaplus.ca:3872/emd/main/
Repository URL         : https://omshost.dbaplus.ca:1159/empbs/upload
Started at             : 2015-07-02 11:29:46
Started by user        : oracle
Operating System       : Linux version 2.6.39-400.17.1.el6uek.x86_64 (amd64)
Last Reload            : (none)
Last successful upload                       : (none)
Last attempted upload                        : (none)
Total Megabytes of XML files uploaded so far : 0
Number of XML files pending upload           : 0
Size of XML files pending upload(MB)         : 0
Available disk space on upload filesystem    : 21.46%
Collection Status                            : Collections enabled
Heartbeat Status                             : Ok
Last attempted heartbeat to OMS              : 2015-07-02 11:30:49
Last successful heartbeat to OMS             : 2015-07-02 11:30:49
Next scheduled heartbeat to OMS              : 2015-07-02 11:31:49

---------------------------------------------------------------
Agent is Running and Ready

We can find that 'Last successful upload' is '(none)', it is supposed to be a valid date & time. Try to manually upload:
$ /u01/app/oracle/product/12.1.0/agent/core/12.1.0.4.0/bin/emctl upload agent
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully

It does not help. 'Last successful upload' is still '(none)' and agent status is still shown 'Availability Evaluation Error'.
Try to re-synchronize the agent on OMS server:
$ . oraenv
ORACLE_SID = [oracle] ? OMS
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/12.1.0/OMS/oms
The Oracle base has been set to 
$ which emcli
/u01/app/oracle/product/12.1.0/OMS/oms/bin/emcli
$ 
$ emcli  login -username=SYSMAN
Enter password 

Login successful
$ emcli sync
Synchronized successfully
$ emcli resyncAgent -agent=co arp.corp.toronto.ca:3872
Resync job RESYNC_20150702142805361 successfully submitted

Now agent is shown UP on EM 12c console.
Reference
EM 12c: emctl status agent Agent 'unavailable with metric collection error' 'Cleanup of previous target with the same name () is in progress' Reported in MGMT_TARGETS (Doc ID 1950874.1)

Wednesday, June 10, 2015

Failed to retrieve the password file location used by ASM asm

After Oracle Restart (Grid Infrastructure standalone) is upgraded from 11g to 12c, srvctl get errors:
$ srvctl config asm
ASM home: 
PRCA-1057 : Failed to retrieve the password file location used by ASM asm
PRCR-1097 : Resource attribute not found: PWFILE

Check environment and password file:
$ echo $ORACLE_HOME
/u01/app/grid/product/12.1.0/grid

$ ls -l /u01/app/grid/product/12.1.0/grid/dbs
total 28
-rw-rw---- 1 grid oinstall 2783 Jun  9 14:27 ab_+ASM.dat
-rw-rw---- 1 grid oinstall 1544 Jun  9 14:27 hc_+ASM.dat
-rw-r--r-- 1 grid oinstall 2992 Feb  3  2012 init.ora
-rw-r----- 1 grid oinstall 8704 Jun  9 14:10 orapw+ASM
-rw-r----- 1 grid oinstall 1536 Jun  9 14:27 spfile+ASM.ora

The password file was created and ORACLE_HOME is set correctly. Checked with DBA, the upgrade was done successfully. There was no errors/exceptions during upgrade.
Oracle Support explains that:
12c ASM instance has a attribute called PWFILE(password file), but 11g ASM does not. Looks like the upgrade utility does not create the new attribute for an ASM instance which is upgraded from 11g.
Try to manually re-create the ora.asm resource with -pwfile option:
$ crsctl status resource ora.asm
NAME=ora.asm
TYPE=ora.asm.type
TARGET=ONLINE
STATE=ONLINE on host01

$ srvctl stop asm
PRCR-1065 : Failed to stop resource ora.asm
CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.DATA.dg', but the force option was not specified
$ srvctl stop asm -f
$ 
$ srvctl config asm
PRCR-1001 : Resource ora.asm does not exist
$ 
$ srvctl add asm -listener LISTENER -spfile /u01/app/grid/product/12.1.0/grid/dbs/spfile+ASM.ora -pwfile /u01/app/grid/product/12.1.0/grid/dbs/orapw+ASM

Test if it is fixed:
$ srvctl sconfig asm
ASM home: 
Password file: /u01/app/grid/product/12.1.0/grid/dbs/orapw+ASM
ASM listener: LISTENER
Spfile: /u01/app/grid/product/12.1.0/grid/dbs/spfile+ASM.ora
ASM diskgroup discovery string: ++no-value-at-resource-creation--never-updated-through-ASM++

There is no error any more.

Wednesday, April 29, 2015

Insufficient archive log space caused ORA-03113

Oracle 11g database was shut down for hardware maintenance. Unfortunately, the database can not be started after maintenance because of error ORA-03113.

$ srvctl sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Apr 27 14:10:05 2015

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 835104768 bytes
Fixed Size 2226096 bytes
Variable Size 532678736 bytes
Database Buffers 276824064 bytes
Redo Buffers 23375872 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 33947688
Session ID: 749 Serial number: 3


Apparently, something happended while instance status is changed to OPEN from MOUNT. Check alert log file:

ARC3 started with pid=30, OS id=51183782
ARC2: Becoming the 'no FAL' ARCH
ARC2: Becoming the 'no SRL' ARCH
ARC1: Becoming the heartbeat ARCH
Errors in file /u01/app/oracle/diag/rdbms/db01/DB01/trace/DB01_ora_45220056.trc:
ORA-19815: WARNING: db_recovery_file_dest_size of 10737418240 bytes is 100.00% used, and has 0 remaining bytes available.
************************************************************************
You have following choices to free up space from recovery area:
1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard,
then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
system command was used to delete files, then use RMAN CROSSCHECK and
DELETE EXPIRED commands.
************************************************************************
ARCH: Error 19809 Creating archive log file to '+FRA2'
Errors in file /u01/app/oracle/diag/rdbms/db01/DB01/trace/DB01_ora_45220056.trc:
ORA-16038: log 3 sequence# 32464 cannot be archived
ORA-19809: limit exceeded for recovery files
ORA-00312: online log 3 thread 1: '+REDO1/db01/onlinelog/group_3.310.857090421'
ORA-00312: online log 3 thread 1: '+REDO2/db01/onlinelog/group_3.310.857090421'
USER (ospid: 45220056): terminating the instance due to error 16038


Instance is terminated due to error 16038: log 3 sequence# 32464 cannot be archived. Redo log cannot be archived because the recovery area is 100% used.

Backup archive log and release space by running:

$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Mon Apr 27 14:17:52 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database (not started)

RMAN> startup mount

Oracle instance started
database mounted

Total System Global Area 835104768 bytes

Fixed Size 2226096 bytes
Variable Size 532678736 bytes
Database Buffers 276824064 bytes
Redo Buffers 23375872 bytes

RMAN> backup archivelog all delete all input;

... ...


Try to open database:

RMAN> alter database open;

database opened


Database is opened successfully.

Friday, February 13, 2015

Integrating BI Publisher with Enterprise Manager using the configureBIP Script

As we know, Oracle has deprecated Information Publisher (IP) Reports for Enterprise Manager 12c and introduce new report tool BI Publisher (BIP) Enterprise Reports. Here, I am going to configure BIP after OEM 12c (12.1.0.4) has been installed and used for a while.

Configure environment and set ORACLE_HOME to OMS installation path:
$ export ORACLE_HOME=/u01/app/oracle/product/12.1.0/oms12104/oms
$ export PATH=$ORACLE_HOME/bin:$PATH
$ which emctl
/u01/app/oracle/product/12.1.0/oms12104/oms/bin/emctl

Backup OEM using command: emctl exportconfig oms
$ emctl exportconfig oms -dir /u01/app/oracle/OMS_BACKUP -oms_only -keep_host
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation. All rights reserved.
Enter Enterprise Manager Root (SYSMAN) Password :
ExportConfig started...
Backup directory is /u01/app/oracle/OMS_BACKUP
Performing OMS backup...
Exporting emoms properties...
Exporting secure properties...

Export has determined that the OMS is not fronted
by an SLB. You have chosen to export the local
hostname. The exported data may ONLY be imported
on a host with the same hostname. Please see the
EM Advanced Configuration Guide for more details.

Warning: Could not export files for module bip: Unable to read file /u01/app/oracle/product/12.1.0/gc_inst/em/EMGC_OMS1/embip.properties for exporting
Exporting configuration for pluggable modules...
Preparing archive file...
Backup has been written to file: /u01/app/oracle/OMS_BACKUP/opf_OMS_20150210_111433.bka

The export file contains sensitive data.
You must keep it secure.

ExportConfig completed successfully!

Configure BIP using script configureBIP
$ cd $ORACLE_HOME/bin
$
$ ./configureBIP
Configuring BI Publisher Version "11.1.1.7.0" to work with Enterprise Manager
Logging started at /u01/app/oracle/product/12.1.0/oms12104/oms/cfgtoollogs/bip/bipca_20150210111722.log.
Before this command is run, a backup of Enterprise Manager should be performed using the :emctl exportconfig oms: command. Have you made a valid backup of Enterprise Manager (yes/no) [no] ? yes
Enter sysdba user name (sys):sys
Enter sysdba user password:
Enter Administration Server user password:
Configuring BI Publisher in Oracle Home located in /u01/app/oracle/product/12.1.0/oms12104/Oracle_BI1 ...
Processing command line ....
Repository Creation Utility - Checking Prerequisites
Checking Global Prerequisites
Repository Creation Utility - Checking Prerequisites
Checking Component Prerequisites
Repository Creation Utility - Creating Tablespaces
Validating and Creating Tablespaces
Repository Creation Utility - Create
Repository Create in progress.
Percent Complete: 0
Percent Complete: 10
Percent Complete: 30
Percent Complete: 50
Percent Complete: 50
Percent Complete: 100
Repository Creation Utility: Create - Completion Summary
Database details:
Connect Descriptor : (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host01.dbaplus.ca)(PORT=1521)))(LOAD_BALANCE=ON)(CONNECT_DATA=(SERVICE_NAME=OEMREP)))
Connected As : sys
Prefix for (prefixable) Schema Owners : SYSMAN
RCU Logfile : /u01/app/oracle/product/12.1.0/oms12104/oms/cfgtoollogs/bip/emBIPLATFORM.log
Component schemas created:
Component Status Logfile
Business Intelligence Platform Success /u01/app/oracle/product/12.1.0/oms12104/oms/cfgtoollogs/bip/biplatform.log

Repository Creation Utility - Create : Operation Completed
Successfully created SYSMAN_BIPLATFORM schema...
Enter an integer between 9701 and 49152 for the BI Publisher HTTP server port. (9701):
Enter an integer between 9702 and 49152 for the BI Publisher HTTPS server port. (9702):
Extending domain with BI Publisher. This operations can take some time. Do not interrupt this command while it is running...
Locking Enterprise Manager ...
OMS Console is locked. Access the console over HTTPS ports.
Restart OMS.
Restarting Enterprise Manager ...
Stopping Enterprise Manager, this can take some time ...
Failed to stop Enterprise Manager. Diagnostic code 1.
See log at /u01/app/oracle/product/12.1.0/oms12104/oms/cfgtoollogs/bip/bipca_20150210111722.log for details.
Error extending domain
See log at /u01/app/oracle/product/12.1.0/oms12104/oms/cfgtoollogs/bip/bipca_20150210111722.log for details.

OMG, a bad luck! Check log file for what happened,
$ tail -20 /u01/app/oracle/product/12.1.0/oms12104/oms/cfgtoollogs/bip/bipca_20150210111722.log

[2015-02-10T11:30:51.192-05:00] [sysman] [NOTIFICATION] [] [oracle.sysman.bipca] [host: host01.dbaplus.ca] [nwaddr: 10.10.0.34] [tid: 17] [userId: oracle] [ecid: 0000KhoL3KH0rmjrh0r2E41KqYwd000004,0] [SRC_CLASS: oracle.sysman.sdkImpl.core.ip.model.bipca.ProcessOutputReader] [SRC_METHOD: run] Stopping WebTier...[[

]]
[2015-02-10T11:30:55.221-05:00] [sysman] [NOTIFICATION] [] [oracle.sysman.bipca] [host: host01.dbaplus.ca] [nwaddr: 10.10.0.34] [tid: 17] [userId: oracle] [ecid: 0000KhoL3KH0rmjrh0r2E41KqYwd000004,0] [SRC_CLASS: oracle.sysman.sdkImpl.core.ip.model.bipca.ProcessOutputReader] [SRC_METHOD: run] Error Occurred: Cannot run program "/u01/app/oracle/product/12.1.0/gc_inst/WebTierIH1/bin/opmnctl": error=12, Not enough space[[

]]
[2015-02-10T11:30:55.222-05:00] [sysman] [NOTIFICATION] [] [oracle.sysman.bipca] [host: host01.dbaplus.ca] [nwaddr: 10.10.0.34] [tid: 17] [userId: oracle] [ecid: 0000KhoL3KH0rmjrh0r2E41KqYwd000004,0] [SRC_CLASS: oracle.sysman.sdkImpl.core.ip.model.bipca.ProcessOutputReader] [SRC_METHOD: run] Please check /u01/app/oracle/product/12.1.0/gc_inst/em/EMGC_OMS1/sysman/log/emctl.log for error details[[

]]
[2015-02-10T11:30:55.265-05:00] [sysman] [ERROR] [] [oracle.sysman.bipca] [host: host01.dbaplus.ca] [nwaddr: 10.10.0.34] [tid: 10] [userId: oracle] [ecid: 0000KhoI3ci0rmjrh0r2E41KqYwd000000,0] [SRC_CLASS: oracle.sysman.sdkImpl.core.ip.model.bipca.BIPCA] [SRC_METHOD: lockAndBounceEM] Failed to stop Enterprise Manager. Diagnostic code 1.
[2015-02-10T11:30:55.273-05:00] [sysman] [ERROR] [] [oracle.sysman.bipca] [host: host01.dbaplus.ca] [nwaddr: 10.10.0.34] [tid: 10] [userId: oracle] [ecid: 0000KhoI3ci0rmjrh0r2E41KqYwd000000,0] [SRC_CLASS: oracle.sysman.sdkImpl.core.ip.model.bipca.BIPCA] [SRC_METHOD: extendDomainWithBIP] See log at /u01/app/oracle/product/12.1.0/oms12104/oms/cfgtoollogs/bip/bipca_20150210111722.log for details.
[2015-02-10T11:30:55.274-05:00] [sysman] [ERROR] [] [oracle.sysman.bipca] [host: host01.dbaplus.ca] [nwaddr: 10.10.0.34] [tid: 10] [userId: oracle] [ecid: 0000KhoI3ci0rmjrh0r2E41KqYwd000000,0] [SRC_CLASS: oracle.sysman.sdkImpl.core.ip.model.bipca.BIPCA] [SRC_METHOD: handleFatalError] Error extending domain
[2015-02-10T11:30:55.275-05:00] [sysman] [ERROR] [] [oracle.sysman.bipca] [host: host01.dbaplus.ca] [nwaddr: 10.10.0.34] [tid: 10] [userId: oracle] [ecid: 0000KhoI3ci0rmjrh0r2E41KqYwd000000,0] [SRC_CLASS: oracle.sysman.sdkImpl.core.ip.model.bipca.BIPCA] [SRC_METHOD: handleFatalError] Fatal error:[[
java.lang.Exception: See log at /u01/app/oracle/product/12.1.0/oms12104/oms/cfgtoollogs/bip/bipca_20150210111722.log for details.
at oracle.sysman.sdkImpl.core.ip.model.bipca.BIPCA.extendDomainWithBIP(BIPCA.java:2370)
at oracle.sysman.sdkImpl.core.ip.model.bipca.BIPCA.main(BIPCA.java:1531)

At the begining of the error, I found messages: 'opmnctl', 'Not enough space', 'Failed to stop Enterprise Manager'. What a familiar look! Yes, it is familiar. Let's try to fix it following "Got ‘Not enought space’ while ‘emctl stop oms’". Then, restart the process. Of course, I have to clean/rollback the failed configuration first before re-running configureBIP.

Clean/rollback failed configureBIP run

Stop BIP server
$ emctl stop oms -bip_only
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation. All rights reserved.
Stopping BI Publisher Server...
BI Publisher Server Successfully Stopped
BI Publisher Server is Down

Unregister BIP from Enterprise Manager
$ emcli login -username=sysman
Enter password :

Login successful
$ emcli sync
Synchronized successfully

$ emcli unregister_bipublisher -force
Warning: BI Publisher was not registered for use with Enterprise Manager, no action taken.

BIP was not registered with Enterprise Manager yet, but it does not really matter, just go ahead.
Drop schema created by script configureBIP from Enterprise Manager repository database
$ sqlplus sys@OEMREP as sysdba

SQL*Plus: Release 11.1.0.7.0 - Production on Fri Feb 13 08:39:01 2015

Copyright (c) 1982, 2008, Oracle. All rights reserved.

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters and Automatic Storage Management options

SQL> drop user SYSMAN_BIPLATFORM cascade;

User dropped.

SQL> select comp_id,COMP_NAME,owner,version,status from system.schema_version_registry where comp_id = 'BIPLATFORM';

COMP_ID COMP_NAME OWNER VERSION STATUS
--------------- ------------------------------ ------------------------------ ------------------------------ -----------
BIPLATFORM OracleBI and EPM SYSMAN_BIPLATFORM 11.1.1.7.0 VALID

SQL> delete from system.schema_version_registry where comp_id = 'BIPLATFORM';

1 row deleted.

SQL> commit;

Commit complete.

SQL> select comp_id,COMP_NAME,owner,version,status from system.schema_version_registry where comp_id = 'BIPLATFORM';

no rows selected

Re-run script configureBIP to configure BIP with Enterprise Manager
$ ./configureBIP
Configuring BI Publisher Version "11.1.1.7.0" to work with Enterprise Manager
Logging started at /u01/app/oracle/product/12.1.0/oms12104/oms/cfgtoollogs/bip/bipca_20150213084523.log.
Before this command is run, a backup of Enterprise Manager should be performed using the :emctl exportconfig oms: command. Have you made a valid backup of Enterprise Manager (yes/no) [no] ? yes
Enter sysdba user name (sys):
Enter sysdba user password:
Enter Administration Server user password:
Configuring BI Publisher in Oracle Home located in /u01/app/oracle/product/12.1.0/oms12104/Oracle_BI1 ...
Processing command line ....
Repository Creation Utility - Checking Prerequisites
Checking Global Prerequisites
Repository Creation Utility - Checking Prerequisites
Checking Component Prerequisites
Repository Creation Utility - Creating Tablespaces
Validating and Creating Tablespaces
Repository Creation Utility - Create
Repository Create in progress.
Percent Complete: 0
Percent Complete: 10
Percent Complete: 30
Percent Complete: 50
Percent Complete: 50
Percent Complete: 100
Repository Creation Utility: Create - Completion Summary
Database details:
Connect Descriptor : (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host01.dbaplus.ca)(PORT=1521)))(LOAD_BALANCE=ON)(CONNECT_DATA=(SERVICE_NAME=OEMREP)))
Connected As : sys
Prefix for (prefixable) Schema Owners : SYSMAN
RCU Logfile : /u01/app/oracle/product/12.1.0/oms12104/oms/cfgtoollogs/bip/emBIPLATFORM.log
Component schemas created:
Component Status Logfile
Business Intelligence Platform Success /u01/app/oracle/product/12.1.0/oms12104/oms/cfgtoollogs/bip/biplatform.log

Repository Creation Utility - Create : Operation Completed
Successfully created SYSMAN_BIPLATFORM schema...
Enter an integer between 9701 and 49152 for the BI Publisher HTTP server port. (9701):
Enter an integer between 9702 and 49152 for the BI Publisher HTTPS server port. (9702):
Extending domain with BI Publisher. This operations can take some time. Do not interrupt this command while it is running...
Locking Enterprise Manager ...
OMS Console is locked. Access the console over HTTPS ports.
Restart OMS.
Restarting Enterprise Manager ...
Stopping Enterprise Manager, this can take some time ...
Starting Enterprise Manager. This operation can take some time. Do not interrupt this command while it is running.
OMS Started Successfully
BI Publisher server named :BIP: running at https://host01.dbaplus.ca:9702/xmlpserver.
Registering BI Publisher with Enterprise Manager and deploying reports...
Performing automatic backup of Enterprise Manager using the command :emctl exportconfig oms:.
Successfully backed up Enterprise Manager. The backup file is located in the INSTANCE_HOME sysman backup directory.
Successfully setup BI Publisher with Enterprise Manager

Now, we can use BI Publisher to do report instead of Information Publisher.

Monday, February 9, 2015

Apply GI PSU 12.1.0.2.2 while using Software-Only installation of GI12.1.0.2

A software-only installation only copies the Oracle Grid Infrastructure for a standalone server binaries to the specified location. After the installation, Oracle Grid Infrastructure (GI) is not configured and HAS (GI standalone)/ CRS(GI cluster) stack is not up yet. Therefore, "optach auto" introduced the the PSU document can not be used to apply the patch.

1. Start Oracle Universal Installer as the Oracle Restart software owner user (grid)
[grid@host01 grid]$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 415 MB.   Actual 82041 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4095 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-02-05_02-16-33PM. Please wait ...
[grid@host01 grid]$ You can find the log of this install session at: /u01/app/oraInventory/logs/installActions2015-02-05_02-16-33PM.log
... ...

2. In the Select Installation Option screen, select the Install Oracle Grid Infrastructure Software Only option to install Oracle Restart and Oracle ASM software only. Click Next.

3. In the Select Product Languages screen, select one or more languages. Move the languages from the Available Languages list to the Selected Languages list. Click Next.

4. In the Privileged Operating System Groups screen, select the name of the operating system group you created for the OSDBA group, the OSASM group, and the Oracle ASM operator group OSOPER. If you create only the dba group, then you can use that group for all three privileged groups. If you created a separate asmadmin group, then use that value for the OSASM group. Click Next.

5. In the Specify Installation Location screen, enter the following information, and click Next:
Oracle Base: Enter the location for the Oracle base directory. Do not include spaces in the path. Here, I am using: /u01/app/grid
Software Location: Accept the default value or enter the directory path in which you want to install the software.The directory path must not contain
spaces. Here, I am using /u01/app/grid/product/12.1.0/grid12102

6. In the pop-up window, the warning message is for cluster installation, click Yes to continue if the GI is installed as Standalone. Otherwise, Oracle Home location has to be out of ORACLE_BASE.

7. The Create Inventory screen is displayed only if this is the first time you are installing Oracle software on your system. Change the path for the Inventory Directory (e.g. /u01/app/oraInventory), if required. Select oinstall for the oraInventory Group Name, if required. Click Next.

8. The Perform Prerequisite Checks screen checks if the minimum system requirements are met to perform the Oracle Grid Infrastructure installation. If all the system requirements are met, then you are directed to the Summary screen. If an installation fails, you can review the error.

9. Review the contents of the Summary screen, and click Install.

10. The Install Product screen displays the progress of the Oracle Grid Infrastructure installation. Oracle Universal Installer prompts you to run the root.sh script and, if required, the orainstRoot.sh script as the root user to complete the installation. During this process, the Execute Configuration Scripts window appears. Do not click OK until you successfully apply the patch (PSU 12.1.0.2.2).

11. If required, run orainstRoot.sh script as the root user
[root@host01 app]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.

12. Install new version of OPatch
[grid@host01 tmp]$ cd /u01/app/grid/product/12.1.0/grid12102
[grid@host01 grid12102]$ OPatch/opatch version
OPatch Version: 12.1.0.1.3

OPatch succeeded.
[grid@host01 grid12102]$ mv OPatch OPatch.12.1.0.1.3
[grid@host01 grid12102]$ unzip /u01/app/media/p6880880_121010_Linux-x86-64.zip
Archive:  /u01/app/media/p6880880_121010_Linux-x86-64.zip
   creating: OPatch/
  inflating: OPatch/opatchdiag.bat
    ... ...
[grid@host01 grid12102]$ OPatch/opatch version
OPatch Version: 12.1.0.1.6

OPatch succeeded.

13. Extract the GI PSU 12.1.0.2.2 (Patch 19954978) into the empty stage directory as the GI software owner (grid), we will find four patched included in the PSU bundle: 19769473, 19769479, 19769480, 19872484
[grid@host01 grid12102]$ unzip -d /u01/app/media/ /u01/app/media/p19954978_121020_Linux-x86-64.zip
[grid@host01 grid12102]$ ls -l /u01/app/media/19954978
total 104
drwxr-xr-x. 5 grid oinstall  4096 Jan 16 04:30 19769473
drwxr-xr-x. 5 grid oinstall  4096 Jan 16 04:30 19769479
drwxrwxr-x. 4 grid oinstall  4096 Jan 16 04:30 19769480
drwxr-xr-x. 4 grid oinstall  4096 Jan 16 04:30 19872484
drwxr-xr-x. 2 grid oinstall  4096 Jan 16 04:30 automation
-rw-rw-r--. 1 grid oinstall  4987 Jan 16 05:53 bundle.xml
-rw-rw-r--. 1 grid oinstall 77081 Jan 19 12:32 README.html
-rw-r--r--. 1 grid oinstall     0 Jan 16 04:30 README.txt

14.  Apply patch to the newly installed 12.1.0.2 GI home as the GI software owner, since "opatch auto" cannot be used, we have to apply patches in the PSU bundle one by one using opatch apply,
$ORACLE_HOME/OPatch/opatch apply -oh /u01/app/grid/product/12.1.0/grid12102 -local /u01/app/media/19954978/19769479
$ORACLE_HOME/OPatch/opatch apply -oh /u01/app/grid/product/12.1.0/grid12102 -local /u01/app/media/19954978/19769473
$ORACLE_HOME/OPatch/opatch apply -oh /u01/app/grid/product/12.1.0/grid12102 -local /u01/app/media/19954978/19872484
$ORACLE_HOME/OPatch/opatch apply -oh /u01/app/grid/product/12.1.0/grid12102 -local /u01/app/media/19954978/19769480
[grid@host01 ~]$ export ORACLE_HOME=/u01/app/grid/product/12.1.0/grid12102
[grid@host01 ~]$ $ORACLE_HOME/OPatch/opatch apply -oh /u01/app/grid/product/12.1.0/grid12102 -local /u01/app/media/19954978/19769479
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation.  All rights reserved.
   ... ...
Applying interim patch '19769479' to OH '/u01/app/grid/product/12.1.0/grid12102'
Verifying environment and performing prerequisite checks...
   ... ...
Verifying the update...
Patch 19769479 successfully applied
Log file location: /u01/app/grid/product/12.1.0/grid12102/cfgtoollogs/opatch/opatch2015-02-09_14-33-35PM_1.log

OPatch succeeded.

[grid@host01 ~]$ $ORACLE_HOME/OPatch/opatch apply -oh /u01/app/grid/product/12.1.0/grid12102 -local /u01/app/media/19954978/19769473
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation.  All rights reserved.
   ... ...
Applying interim patch '19769473' to OH '/u01/app/grid/product/12.1.0/grid12102'
Verifying environment and performing prerequisite checks...
   ... ...
Patching component oracle.usm, 12.1.0.2.0...

Verifying the update...
Patch 19769473 successfully applied
Log file location: /u01/app/grid/product/12.1.0/grid12102/cfgtoollogs/opatch/opatch2015-02-09_14-41-04PM_1.log

OPatch succeeded.
[grid@host01 ~]$
[grid@host01 ~]$ $ORACLE_HOME/OPatch/opatch apply -oh /u01/app/grid/product/12.1.0/grid12102 -local /u01/app/media/19954978/19872484
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation.  All rights reserved.
   ... ...
Applying interim patch '19872484' to OH '/u01/app/grid/product/12.1.0/grid12102'
   ... ...
Patching component oracle.wlm.dbwlm, 12.1.0.2.0...

Verifying the update...
Patch 19872484 successfully applied
Log file location: /u01/app/grid/product/12.1.0/grid12102/cfgtoollogs/opatch/opatch2015-02-09_14-45-29PM_1.log

OPatch succeeded.
[grid@host01 ~]$ $ORACLE_HOME/OPatch/opatch apply -oh /u01/app/grid/product/12.1.0/grid12102 -local /u01/app/media/19954978/19769480
Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation.  All rights reserved.
   ... ...
Applying interim patch '19769480' to OH '/u01/app/grid/product/12.1.0/grid12102'
Verifying environment and performing prerequisite checks...
Patch 19769480: Optional component(s) missing : [ oracle.xdk, 12.1.0.2.0 ] , [ oracle.oraolap, 12.1.0.2.0 ]
   ... ...
OPatch succeeded.

15. Run root.sh as user root


[root@host01 bin]# /u01/app/grid/product/12.1.0/grid12102/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/grid/product/12.1.0/grid12102

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...


Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/grid/product/12.1.0/grid12102/perl/bin/perl -I/u01/app/grid/product/12.1.0/grid12102/perl/lib -I/u01/app/grid/product/12.1.0/grid12102    /crs/install /u01/app/grid/product/12.1.0/grid12102/crs/install/roothas.pl


To configure Grid Infrastructure for a Cluster execute the following command as grid user:
/u01/app/grid/product/12.1.0/grid12102/crs/config/config.sh
This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed     through the response file that is available in the installation media.



16. Back to Oracle Universal Installer. In Execute Configuration Scripts screen, click Ok.
17. The Finish screen displays the installation status. Click Close to end the installation and exit Oracle Universal Installer.

References:
Supplemental Readme - Patch Installation and Deinstallation For 12.1.0.x.x GI PSU (Doc ID 1591616.1)
How to Apply a Grid Infrastructure Patch Before root script (root.sh or rootupgrade.sh) is Executed? (Doc ID 1410202.1)

Thursday, January 29, 2015

Database link cannot be dropped because of ORA-02024

When dropping database link got following error:
ORA-02024: database link not found.
SQL> select * from user_db_links;

DB_LINK USERNAME PASSWORD HOST CREATED
----------------- ------------- ---------- ----------- ---------
REFRESH_DBLINK SYSTEM DBPROD 15-OCT-13

SQL> drop database link REFRESH_DBLINK;
drop database link REFRESH_DBLINK
*
ERROR at line 1:
ORA-02024: database link not found

Can not find an existing database link? What if create a new link with same name?
SQL> create database link REFRESH_DBLINK
2 connect to system identified by Ax356 using 'DBPROD';

Database link created.

SQL> select * from user_db_links;

DB_LINK USERNAME PASSWORD HOST CREATED
------------------------ ------------- ---------- ----------- ---------
REFRESH_DBLINK SYSTEM DBPROD 15-OCT-13
REFRESH_DBLINK.WORLD SYSTEM DBPROD 29-JAN-15

The name of new database link is appended with '.WORLD'. Did more test and found that all new created database link will be added suffix '.WORLD' in the name. Try DROP DATABASE LINK to see what is going to happen:
SQL> drop database link REFRESH_DBLINK;

Database link dropped.

SQL> select * from user_db_links;

DB_LINK USERNAME PASSWORD HOST CREATED
------------------------ ------------- ---------- ----------- ---------
REFRESH_DBLINK SYSTEM DBPROD 15-OCT-13

See, I was dropping REFRESH_DBLINK, but REFRESH_DBLINK.WORLD was dropped. I always get REFRESH_DBLINK.WORLD dropped no matter whether I include '.WORLD' in the DROP DATABASE LINK command. Why did we get the weird term '.WORLD'? It was popular long time ago as default database domain and often found in global_name & db_domain of the database:
SQL> show parameter db_name

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string DBPROD

SQL> show parameter db_domain

NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_domain string

SQL> select * from global_name;

GLOBAL_NAME
--------------------------------
DBPROD.WORLD

It does be a part of database global_name. Does domain part in global_name affect database link name space? Unfortunately, it does. Delete the domain part from global_name:

 
SQL> alter database rename global_name to DBPROD;

Database altered.

SQL> select * from global_name;

GLOBAL_NAME
------------------------------------------------
DBPROD.WORLD

Interesting, the ALTER DATABASE command does not help. Let us manually change global_name bypass ALTER DATABASE command,
Note: Take a complete consistent backup of the database before you continue:
SQL> conn / as sysdba
Connected.

SQL> select name,value$ from props$ where GLOBAL_name='GLOBAL_DB_NAME';

NAME VALUE$
------------------------------ --------------------------------------------------
GLOBAL_DB_NAME DBPROD.WORLD

SQL> update props$ set value$='DBPROD' where name='GLOBAL_DB_NAME';

1 row updated.

SQL> commit;

Commit complete.

SQL> select * from global_name;

GLOBAL_NAME
---------------------
DBPROD

Oracle never suggests direct update on props$. We are not supposed to do that. Hmmm, today is special :)

Drop the database link:
SQL> connect system

SQL> drop datbaetabase link REFRESH_DBLINK;

Database link dropped.

SQL> select * from user_db_links;

no rows selected

Finally, database link is really dropped.

Monday, January 26, 2015

TNSPING of 11g RAC database got very slow response

Business users complain it took several minutes to log into database. It used to take several seconds.

Confirmed informations as following:

Server: Solaris 10 SPARC + Oracle Database Server 11.2.0.3 RAC
Client: windows 7 + Oracle Client 11.2.0.3

Testing connectivity from workstation:
C:\>tnsping RACPD

TNS Ping Utility for 32-bit Windows: Version 11.2.0.3.0 - Production on 26-JAN-2015 10:49:15

Copyright (c) 1997, 2011, Oracle. All rights reserved.

Used parameter files:
c:\app\oracle\product\11.2.0\client11203\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host-scan.dbaplus.ca)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=RACPD)))
OK (120000 msec)

Feel like the SCAN listener(s) is/are alive and there is network issue. If it is network problem, the issue should be reproduced on all three IP addresses bound with SCAN name (host-scan.dbaplus.ca). Let's find IPs first:
C:\>nslookup host-scan.dbaplus.ca
Server: ns01.dbaplus.ca
Address: 10.10.2.253

Name: host-scan.dbaplus.ca
Addresses: 10.10.2.30
10.10.2.31
10.10.2.29

Checking the IP availability:
C:\>ping 10.10.2.30

Pinging 10.10.2.30 with 32 bytes of data:
Reply from 10.10.2.30: bytes=32 time=5ms TTL=252
Reply from 10.10.2.30: bytes=32 time<1ms TTL=252
Reply from 10.10.2.30: bytes=32 time<1ms TTL=252
Reply from 10.10.2.30: bytes=32 time<1ms TTL=252

Ping statistics for 10.10.2.30:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 5ms, Average = 1ms

C:\>ping 10.10.2.31

Pinging 10.10.2.31 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 10.10.2.31:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

C:\>ping 10.10.2.29

Pinging 10.10.2.29 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 10.10.2.29:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

Two of three SCAN virtual IPs are timed out, the other one (10.10.2.30) is working. It is not network problem. Log onto database servers:
$ . oraenv
ORACLE_SID = [grid] ? +ASM1
The Oracle base has been set to /u01/app/oracle
$
$ crsctl status res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE host01
ONLINE ONLINE host02
ora.FRA.dg
ONLINE ONLINE host01
ONLINE ONLINE host02
ora.LISTENER.lsnr
ONLINE ONLINE host01
ONLINE OFFLINE host02
ora.asm
ONLINE ONLINE host01 Started
ONLINE ONLINE host02 Started
ora.gsd
OFFLINE OFFLINE host01
OFFLINE OFFLINE host02
ora.net1.network
ONLINE ONLINE host01
ONLINE ONLINE host02
ora.ons
ONLINE ONLINE host01
ONLINE ONLINE host02
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE host02
ora.LISTENER_SCAN2.lsnr
1 ONLINE OFFLINE
ora.LISTENER_SCAN3.lsnr
1 ONLINE OFFLINE
ora.racdb.db
1 ONLINE ONLINE host01 Open
2 ONLINE ONLINE host02 Open
ora.host01.vip
1 ONLINE ONLINE host01
ora.host02.vip
1 ONLINE UNKNOWN host01
ora.racdb.db
1 ONLINE ONLINE host01 Open
2 ONLINE ONLINE host02 Open
ora.scan1.vip
1 ONLINE ONLINE host02
ora.scan2.vip
1 ONLINE UNKNOWN host01
ora.scan3.vip
1 ONLINE UNKNOWN host01

SCAN VIP scan2 & scan3 are in UNKNOWN status, corresponding SCAN listeners LISTENER_SCAN2 & LISTENER_SCAN3 are OFFLINE.

When I connect to database from workstation, Oracle client will work as following:
1. Ask DNS server for IPs for the SCAN name host-scan.dbaplus.ca, and get three IPs
2. Choose one of them to connect. If I am lucky, the one should be SCAN1 and I will not find any issues. Actually, I was not. scan2 (or scan3) was chosen and the request waited for response from server until time out because the SCAN VIP is not ONLINE, then failed over to another SCAN VIP scan3 (or scan2) or scan1. The worst thing is failover to scan3, it will get timeout again and have to fail over finally to scan1.
3. No matter where it starts, SCAN VIP scan1 will be the final and only choice for the connection. How fast the connection can be established depends on how fast the ONLINE SCAN VIP scan1 is chosen.

To fix the issue, try to start them:
$ srvctl start scan_listener -i 2
$ srvctl start scan_listener -i 3
$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node host02
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node host01
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node host01

$ crsctl status res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE host01
ONLINE ONLINE host02
ora.FRA.dg
ONLINE ONLINE host01
ONLINE ONLINE host02
ora.LISTENER.lsnr
ONLINE ONLINE host01
ONLINE OFFLINE host02
ora.asm
ONLINE ONLINE host01 Started
ONLINE ONLINE host02 Started
ora.gsd
OFFLINE OFFLINE host01
OFFLINE OFFLINE host02
ora.net1.network
ONLINE ONLINE host01
ONLINE ONLINE host02
ora.ons
ONLINE ONLINE host01
ONLINE ONLINE host02
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE host02
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE host01
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE host01
ora.racdb.db
1 ONLINE ONLINE host01 Open
2 ONLINE ONLINE host02 Open
ora.host01.vip
1 ONLINE ONLINE host01
ora.host02.vip
1 ONLINE UNKNOWN host01
ora.racdb.db
1 ONLINE ONLINE host01 Open
2 ONLINE ONLINE host02 Open
ora.scan1.vip
1 ONLINE ONLINE host02
ora.scan2.vip
1 ONLINE ONLINE host01
ora.scan3.vip
1 ONLINE ONLINE host01

All SCAN VIP and SCAN listeners are ONLINE. Back to workstation and test the connection:
C:\>tnsping RACPD

TNS Ping Utility for 32-bit Windows: Version 11.2.0.3.0 - Production on 26-JAN-2015 10:49:15

Copyright (c) 1997, 2011, Oracle. All rights reserved.

Used parameter files:
c:\app\oracle\product\11.2.0\client11203\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=host-scan.dbaplus.ca)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=RACPD)))
OK (10 msec)

'10 msec' response time is not bad. The issue got fixed.

Tuesday, January 20, 2015

impdp got 'ORA-01843: not a valid month'

When running impdp to load data, got errors:
ORA-39083: Object type TABLE:"DEVUSER"."TAB01" failed to create with error:
ORA-01843: not a valid month
Failing sql is:
CREATE TABLE "DEVUSER"."TAB01" ("ID" NUMBER NOT NULL ENABLE, "CREATED_TIME" TIMESTAMP (6) DEFAULT '1970-01-01 00:00:00.000000')

Try to run the script manually in SQLPLUS:
devuser@ORADB> CREATE TABLE "DEVUSER"."TAB01" ("ID" NUMBER NOT NULL ENABLE, "CREATED_TIME" TIMESTAMP (6) DEFAULT '1970-01-01 00:00:00.000000');
CREATE TABLE "DEVUSER"."TAB01" ("ID" NUMBER NOT NULL ENABLE, "CREATED_TIME" TIMESTAMP (6) DEFAULT '1970-01-01 00:00:00.000000')
*
ERROR at line 1:
ORA-01843: not a valid month

Got same error. Obviously, the CREATE TABLE is using string constant as default value for data type TIMESTAMP. We know it will work only if the session TIMESTAMP format is same as the given string. Let's see what is the session TIMESTAMP format:
devuser@ORADB> variable partype number;
devuser@ORADB> variable intval number;
devuser@ORADB> variable strval varchar2(255);
devuser@ORADB> exec :partype:=dbms_utility.get_parameter_value('NLS_TIMESTAMP_FORMAT',:intval,:strval);

PL/SQL procedure successfully completed.

devuser@ORADB> col STRVAL for a50
devuser@ORADB> print strval

STRVAL
--------------------------------------------------
DD-MON-RR HH.MI.SSXFF AM

The value of session parameter NLS_TIMESTAMP_FORMAT is  'DD-MON-RR HH.MI.SSXFF AM', which is different from the string constant. Change the session parameter as following:
devuser@ORADB> alter session set NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS.FF6';

Session altered.

devuser@ORADB> exec :partype:=dbms_utility.get_parameter_value('NLS_TIMESTAMP_FORMAT',:intval,:strval);

PL/SQL procedure successfully completed.

devuser@ORADB> print strval

STRVAL
--------------------------------------------------
YYYY-MM-DD HH24:MI:SS.FF6

Retry the CREATE TABLE statement:
devuser@ORADB> CREATE TABLE "DEVUSER"."TAB01" ("ID" NUMBER NOT NULL ENABLE, "CREATED_TIME" TIMESTAMP (6) DEFAULT '1970-01-01 00:00:00.000000');

Table created.

The issue is fixed. Therefore, the CREATE TABLE can be run properly by setting session parameter NLS_TIMESTAMP_FORMAT. The question is how the impdp utility sets this parameter in its own session? LOGON trigger would be a tentative answer:
devuser@ORADB> create or replace trigger temp after logon on database
2 begin
3 execute immediate 'alter session set nls_timestamp_format=''YYYY-MM-DD HH24:MI:SS.FF6''';
4 end;
5 /

Trigger created.

Try impdp again, it works. However, it may not be a best solution. If possible I would like modify the CREATE TABLE (in source database) as following before runnig expdp to create dumpfile:
CREATE TABLE "DEVUSER"."TAB01"
("ID" NUMBER NOT NULL ENABLE,
"CREATED_TIME" TIMESTAMP (6) DEFAULT TO_TIMESTAMP('1970-01-01 00:00:00.000000','YYYY-MM-DD HH24:MI:SS.FF6'));

It is independent on the session timestamp format.

Monday, January 19, 2015

Setting CURRENT_SCHEMA caused error 'ORA-01031: insufficient privileges'

Question: Why did I get 'ORA-01031: insufficient privileges' when running 'create table' command to create table ? I do have 'CREATE TABLE' privilege granted.

Answer: the CURRENT_SCHEMA of your session is not expected account of yours.

The database user devuser is granted 'CREATE TABLE' privilege:
evuser@ORADB> select * from user_sys_privs;

USERNAME PRIVILEGE ADM
-------------------- ---------------------------------------- ---
DEVUSER CREATE TABLE NO
DEVUSER CREATE SESSION NO

But he got ORA-01031 when running 'create table'
devuser@ORADB> create table tb01(sno number);
create table tb01(sno number)
*
ERROR at line 1:
ORA-01031: insufficient privileges

And did not get error when creating table with schema specified in the statement:
devuser@ORADB> create table devuser.tb01(sno number);

Table created.

Looks like the 'create table' without schema specified is trying to create table in another user's schema. Find out who the another user is:
devuser@ORADB> select sys_context('userenv','current_schema') as current_schema from dual;

CURRENT_SCHEMA
------------------------------
DEVOWNER

It is not expected user name 'devuser'. Try to change back:
devuser@ORADB> alter session set current_schema=devuser;

Session altered.

devuser@ORADB> select sys_context('userenv','current_schema') as current_schema from dual;

CURRENT_SCHEMA
------------------------------
DEVUSER

Test if 'create table' works:
devuser@ORADB> create table tb02(sno number);

Table created.

See, current_schema accounts for it!

 

 

 

 

 

Wednesday, January 14, 2015

Automate Startup/Shutdown of OSWatcher with Oracle HAS (GridInfrastructure Standalone)

Grid Infrastructure Standalone 11.2.0.3
Operation system AIX 6.1

Download Oracle OSWatcher (oswbb732.tar, current version 7.3.2) from My Oracle Support. Install OSWatcher:
$ mkdir /u01/app/grid/product/7.3.2
$ cd /u01/app/grid/product/7.3.2
$ tar xvf /tmp/oswbb732.tar
  ... ...
$ ls -l oswbb/*OSWbb*
-rwxr-xr-x    1 grid  oinstall         2385 Oct 07 2013  oswbb/startOSWbb.sh
-rwxr-xr-x    1 grid  oinstall          558 Apr 17 2014  oswbb/stopOSWbb.sh

Create an Oracle HAS(Grid Infrastructure Standalone) Action Script file startOSWbb.sh:
#!/bin/sh
#
# ACTION_SCRIPT for Oracle HAS to manage OSWatcher
#
OSWBB_HOME=/u01/app/grid/product/7.3.2/oswbb
OSWBB_LOG=/u01/app/grid/local/logs/oswbb/alert_OSWbb.log
OSWBB_ARCHIVE_DEST=/u01/app/grid/local/logs/oswbb/archive
SNAPSHOT_INTERVAL=30   # in seconds
RETENTION_POLICY=720   # in hours
COMPRESS_COMMAND=NONE  # compress utility command such as zip, gzip, etc
#
case "$1" in
  'start')
     cd $OSWBB_HOME
     echo " " >> $OSWBB_LOG
     TMP=`ps -ef | grep OSWatcher  | grep -v grep |wc -l`
     if [ $TMP -eq 1 ]; then  # Only one process (OSWatcher or OSWatcherFM) running is not enough
        ./stopOSWbb.sh        # Stop orphan process
     fi
     echo "******************************************************" >> $OSWBB_LOG
     echo "...Starting OSWbb at `date` " >> $OSWBB_LOG
     ./startOSWbb.sh $SNAPSHOT_INTERVAL $RETENTION_POLICY $COMPRESS_COMMAND $OSWBB_ARCHIVE_DEST >> $OSWBB_LOG &
     if [ $? -eq 0 ]; then
        sleep 60    # Wait for all processes to be started
        exit 0
     else
        exit 1
     fi
     ;;
  'stop')
     cd $OSWBB_HOME
     echo "...Stopping OSWbb  at `date` " >> $OSWBB_LOG
     ./stopOSWbb.sh
     exit $?
     ;;
  'check')
    TMP=`ps -ef | grep OSWatcher  | grep -v grep |wc -l`
    if [ $TMP -eq 2 ]; then  # Both OSWatcher and OSWatcherFM (2 processes) running
       exit 0
    else
       exit 1
    fi
    ;;
  'clean')
     cd $OSWBB_HOME
     echo "...Cleaning/Stopping OSWbb  at `date` " >> $OSWBB_LOG
     ./stopOSWbb.sh
     exit $?
     ;;
esac

Note:
1. startOSWbb.sh has to be started in background by appending sign '&' at the end of the command line.
2. the output of startOSWbb.sh needs to be redirected to a file

Add a resource to HAS
crsctl add resource ora.OSWbb -type local_resource -attr "ACTION_SCRIPT=/u01/app/grid/local/bin/startOSWbb.sh,CHECK_INTERVAL=60,RESTART_ATTEMPTS=2"

Start resource ora.OSWbb
$ crsctl start resource ora.OSWbb
CRS-2672: Attempting to start 'ora.OSWbb' on 'host02'
CRS-2674: Start of 'ora.OSWbb' on 'host02' failed
CRS-4000: Command Start failed, or completed with errors.

Check OHASD agent log for errors:
$ tail /u01/app/grid/product/11.2.0/gi11204/log/host02/agent/ohasd/scriptagent_grid/scriptagent_grid.log
2015-01-14 10:00:49.240: [    AGFW][2057]{0:0:14962} Agent received the message: RESOURCE_START[ora.OSWbb host02 1] ID 4098:444107
2015-01-14 10:00:49.240: [    AGFW][2057]{0:0:14962} Preparing START command for: ora.OSWbb host02 1
2015-01-14 10:00:49.240: [    AGFW][2057]{0:0:14962} ora.OSWbb host02 1 state changed from: UNKNOWN to: STARTING
2015-01-14 10:00:49.242: [    AGFW][1543]{0:0:14962} Entering script entry point...
2015-01-14 10:00:49.242: [ora.OSWbb][1543]{0:0:14962} [start] Executing action script: /u01/app/grid/local/bin/startOSWbb.sh[start]
2015-01-14 10:00:49.304: [    AGFW][1543]{0:0:14962} Command: start for resource: ora.OSWbb host02 1 completed with status: SUCCESS
2015-01-14 10:00:49.305: [CLSFRAME][1] TM [MultiThread] is changing desired thread # to 3. Current # is 2
2015-01-14 10:00:49.306: [    AGFW][1543]{0:0:14962} Entering script entry point...
2015-01-14 10:00:49.306: [ora.OSWbb][1543]{0:0:14962} [check] Executing action script: /u01/app/grid/local/bin/startOSWbb.sh[check]
2015-01-14 10:00:49.307: [    AGFW][2057]{0:0:14962} Agent sending reply for: RESOURCE_START[ora.OSWbb host02 1] ID 4098:444107
2015-01-14 10:00:49.365: [    AGFW][2057]{0:0:14962} ora.OSWbb host02 1 state changed from: STARTING to: OFFLINE
2015-01-14 10:00:49.365: [    AGFW][2057]{0:0:14962} Agent sending last reply for: RESOURCE_START[ora.OSWbb host02 1] ID 4098:444107
2015-01-14 10:00:49.365: [    AGFW][2057]{0:0:14962} Agent has no resources to be monitored, Shutting down ..
2015-01-14 10:00:49.365: [    AGFW][2057]{0:0:14962} Agent sending message to PE: AGENT_SHUTDOWN_REQUEST[Proxy] ID 20486:25
2015-01-14 10:00:49.370: [    AGFW][2057]{0:0:14962} Agent is shutting down.
2015-01-14 10:00:49.370: [ USRTHRD][2057]{0:0:14962} Script agent is exiting..

Did not find helpful message, check OSWatcher log:
$ cat  /u01/app/grid/local/logs/oswbb/alert_OSWbb.log

******************************************************
The archive directory you specified for parameter 4 in startOSWbb.sh:/u01/app/grid/local/logs/oswbb/archive does not exist. Please create this directory and rerun ./startOSWbb.sh

******************************************************
...Starting OSWbb at Wed Jan 14 10:00:49 EST 2015
The archive directory you specified for parameter 4 in startOSWbb.sh:/u01/app/grid/local/logs/oswbb/archive does not exist. Please create this directory and rerun ./startOSWbb.sh

OSWatcher archive directory does not exist, manually create it:
$ mkdir /u01/app/grid/local/logs/oswbb/archive

Re-start resource ora.OSWbb
$ crsctl start resource ora.OSWbb
CRS-2672: Attempting to start 'ora.OSWbb' on 'host02'
CRS-2676: Start of 'ora.OSWbb' on 'host02' succeeded

Resource ora.OSWbb started successfully, make sure OSWatcher is running:
$ ps -ef | grep OSWatcher
 grid  7405596  5046352   0 10:13:16  pts/6  0:00 grep OSWatcher
 grid  7078198 11469280   0 10:11:23      -  0:00 /bin/sh ./OSWatcherFM.sh 720 /u01/app/grid/local/logs/oswbb/archive
 grid 11469280        1   0 10:10:54      -  0:00 /bin/sh ./OSWatcher.sh 30 720 NONE /u01/app/grid/local/logs/oswbb/archive

Note: Keyword 'OSWatcher' is reserved by OSWatcher stopping script to determine if the utility is running. DO NOT using string 'OSWatcher' anywhere (directory name, file name, command name, etc).

Test resource ora.OSWbb  stop function:
$ crsctl stop resource ora.OSWbb
CRS-2673: Attempting to stop 'ora.OSWbb' on 'host02'
CRS-2677: Stop of 'ora.OSWbb' on 'host02' succeeded
$ ps -ef | grep OSWatcher
 oragrid 12058682  5046352   0 15:15:50  pts/6  0:00 grep OSWatcher

Test resource ora.OSWbb  restart function (check & start functions):
$ ps -ef | grep OSWatcher
 oragrid 11010394  5046352   0 15:18:33  pts/6  0:00 grep OSWatcher
$ crsctl start resource ora.OSWbb
CRS-2672: Attempting to start 'ora.OSWbb' on 'host02'
CRS-2676: Start of 'ora.OSWbb' on 'host02' succeeded
$  ps -ef | grep OSWatcher
 oragrid  7864326        1   0 15:18:42      -  0:00 /bin/sh ./OSWatcher.sh 30 720 NONE /u01/app/grid/local/logs/oswbb/archive
 oragrid  8388952  7864326   0 15:19:10      -  0:00 /bin/sh ./OSWatcherFM.sh 720 /u01/app/grid/local/logs/oswbb/archive
 oragrid 11665602  5046352   0 15:19:53  pts/6  0:00 grep OSWatcher

OSWatcher is running, kill one of two running processes:
$ kill 8388952
$
$ ps -ef | grep OSWatcher
 oragrid  7405662  5046352   0 15:20:26  pts/6  0:00 grep OSWatcher
 oragrid  7864326        1   0 15:18:42      -  0:00 /bin/sh ./OSWatcher.sh 30 720 NONE /u01/app/grid/local/logs/oswbb/archive

Process OSWatcherFM.sh is killed. Now wait for 1 minute and see what happens:
$ ps -ef | grep OSWatcher
 oragrid 14614732  6816014   0 15:21:11      -  0:00 /bin/sh ./OSWatcherFM.sh 720 /u01/app/grid/local/logs/oswbb/archive
 oragrid  6816014        1   0 15:20:42      -  0:00 /bin/sh ./OSWatcher.sh 30 720 NONE /u01/app/grid/local/logs/oswbb/archive
 oragrid 10355082  5046352   0 15:22:23  pts/6  0:00 grep OSWatcher
$

Wow! The processes are restarted.

Friday, January 9, 2015

Relink Oracle Grid Infrastructure Standalone (Oracle Restart) home and Database home after OS is upgraded from AIX 6.1 to 7.0

Oracle Database 11.2.0.3
Operating System AIX 7.0
The server system is upgraded from AIX 6.1 to 7.0, generally IBM guarantees operating system binary compatibility, therefore, no relink of the Oracle
software is required after the upgrade. However, Oracle recommends performing manual relinking of Oracle Home binaries after OS upgrade.

1.Stop Oracle databases (as owner of Oracle Database Home):
$ id  oracle
uid=207(oracle) gid=110(oinstall) groups=60005(dba),60015(asmdba)
$ . oraenv
ORACLE_SID = [oracle] ? ORADB
The Oracle base has been set to /u01/app/oracle
$ srvctl stop home -o /u01/app/oracle/product/11.2.0/db11203 -s stophome.txt -t immediate

2.Stop the OHAS stack (as owner of Oracle Restart Home):
$ id 
uid=208(grid) gid=110(oinstall) groups=60005(dba),60014(asmadmin),60015(asmdba)
$ . oraenv
ORACLE_SID = [grid] ? +ASM
The Oracle base has been set to /u01/app/grid
$ crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'host01'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'host01'
CRS-2673: Attempting to stop 'ora.FLASH.dg' on 'host01'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'host01'
CRS-2677: Stop of 'ora.DATA.dg' on 'host01' succeeded
CRS-2677: Stop of 'ora.FLASH.dg' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'host01'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'host01' succeeded
CRS-2677: Stop of 'ora.asm' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'host01'
CRS-2677: Stop of 'ora.cssd' on 'host01' succeeded
CRS-2673: Attempting to stop 'ora.evmd' on 'host01'
CRS-2677: Stop of 'ora.evmd' on 'host01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'host01' has completed
CRS-4133: Oracle High Availability Services has been stopped.

3. Remove audit files from Oracle Restart Home if applicable
SQL> show parameter  audit_file_dest

NAME TYPE VALUE
------------------------------------ ----------- ----------------------------------------------
audit_file_dest string /u01/app/grid/product/11.2.0/gi11203/rdbms/audit

Audit files are saved in Oracle Restart Home, we have to move (backup) audit files out of the home. Otherwise, the following 'unlock' step will take long time.
$ mv /u01/app/grid/product/11.2.0/gi11203/rdbms/audit/*.aud /u01/app/grid/backup

4. Connect as root user and unlock the Oracle Restart installation as follows:
# . oraenv
ORACLE_SID = [root] ? +ASM
The Oracle base has been set to /u01/app/grid
#
# echo $ORACLE_HOME
/u01/app/grid/product/11.2.0/gi11203
#
# $ORACLE_HOME/crs/install/roothas.pl -unlock
Using configuration parameter file: /u01/app/grid/product/11.2.0/gi11203/crs/install/crsconfig_params
Successfully unlock /u01/app/grid/product/11.2.0/gi11203

5. Relink the Oracle Restart installation (as owner of Oracle Restart Home):
$ . oraenv
ORACLE_SID = [grid] ? +ASM
The Oracle base remains unchanged with value /u01/app/grid
$
$ ls -l $ORACLE_HOME/rdbms/lib/config.o
-rw-r--r-- 1 grid oinstall 764 Oct 18 2013 /u01/app/grid/product/11.2.0/gi11203/rdbms/lib/config.o
$
$ mv $ORACLE_HOME/rdbms/lib/config.o $ORACLE_HOME/rdbms/lib/config.o.bak
$
$ ls -l $ORACLE_HOME/rdbms/lib/config.o*
-rw-r--r-- 1 grid oinstall 764 Oct 18 2013 /u01/app/grid/product/11.2.0/gi11203/rdbms/lib/config.o.bak
$
$ $ORACLE_HOME/bin/relink all
writing relink log to: /u01/app/grid/product/11.2.0/gi11203/install/relink.log
$

6. Check the relink log:
$ cat /u01/app/grid/product/11.2.0/gi11203/install/relink.log
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB. Actual 12800 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-01-08_02-01-58PM. Please wait ...Please find the log file at /u01/app/grid/product/11.2.0/gi11203/install/relinkActions2015-01-08_02-02-06-PM.log
... ...
ld: 0711-224 WARNING: Duplicate symbol: .aio_nwait_timeout64
... ...
ld: 0711-773 WARNING: Object /u01/app/grid/product/11.2.0/gi11203/lib/libxml11.a[lgx.o], imported symbol id__Q2_3std8numpunctXTc_
Symbol was expected to be local. Extra instructions
are being generated to reference the symbol.
... ...
ld: 0711-783 WARNING: TOC overflow. TOC size: 185792 Maximum size: 65536
... ...

Oops. Thousands of 'ld: 0711-773' and 'ld: 0711-783' warning messages! Don'g worry, that's expected while Oracle home is relinked on AIX, they can be safely ignored.
We can find new binary file created:
$ ls -l  /u01/app/grid/product/11.2.0/gi11203/bin/oracle*
-rwsr-s--x 1 grid oinstall 265201550 Jan 8 14:04 /u01/app/grid/product/11.2.0/gi11203/bin/oracle
-rwsr-s--x 1 grid oinstall 265345822 Jun 27 2014 /u01/app/grid/product/11.2.0/gi11203/bin/oracleO

7. Connect as root user and lock back the Oracle Restart installation
# $ORACLE_HOME/crs/install/roothas.pl -patch
Using configuration parameter file: /u01/app/grid/product/11.2.0/gi11203/crs/install/crsconfig_params
CRS-4123: Oracle High Availability Services has been started.

8. Verify OHAS services (As owner of Oracle Restart Home):
$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ONLINE ONLINE host01
ora.FLASH.dg
ONLINE ONLINE host01
ora.LISTENER.lsnr
ONLINE ONLINE host01
ora.asm
ONLINE ONLINE host01 Started
ora.ons
OFFLINE OFFLINE host01
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
1 ONLINE ONLINE host01
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 ONLINE ONLINE host01
ora.oradb.db
1 OFFLINE OFFLINE Instance Shutdown

9. Relink Database home  (as owner of Database home)
$ . oraenv
ORACLE_SID = [oracle] ? ORADB
The Oracle base remains unchanged with value /u01/app/oracle
$
$ ls -l $ORACLE_HOME/bin/oracle
-rwsr-s--x 1 oracle asmadmin 287983743 Jun 27 2014 /u01/app/oracle/product/11.2.0/db11203/bin/oracle
$
$ $ORACLE_HOME/bin/relink all
writing relink log to: /u01/app/oracle/product/11.2.0/db11203/install/relink.log
$
$ ls -l $ORACLE_HOME/bin/oracle*
-rwsr-s--x 1 oracle oinstall 287912357 Jan 8 15:17 /u01/app/oracle/product/11.2.0/db11203/bin/oracle
-rwsr-s--x 1 oracle asmadmin 287983743 Jun 27 2014 /u01/app/oracle/product/11.2.0/db11203/bin/oracleO

10. Start databases:
$ srvctl start home -o /u01/app/oracle/product/11.2.0/db11203 -s stophome.txt

 References:
"Relink All" On AIX Raises Many Warnings And "ld: 0706-032 Linking mode is not specified" for Liborasdk (Doc ID 809153.1)

Tuesday, January 6, 2015

OEM Cloud Control 12c: OMS 12.1.0.4.1 PSU installation

OEM: Cloud Control 12.1.0.4
OS: Solaris 10 Sparc 64bit

Download PSU p19218456_121040_Generic.zip and OPatch p6880880_111000_SOLARIS64.zip from my oracle support.

1. Upgrade OPatch
$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.1.0.11.0

OPatch succeeded.
$ cd $ORACLE_HOME
$ pwd
/u01/app/oracle/product/12.1.0/em12104/oms

$ mv OPatch Opatch.11.1.0.11.0

$ unzip /u01/app/media/p6880880_111000_SOLARIS64.zip
... ...

$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.1.0.12.3

OPatch succeeded.

2. Inventory of Oracle Home before patching
$ $ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.1.0.12.3
Copyright (c) 2015, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/12.1.0/em12104/oms
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/em12104/oms/oraInst.loc
OPatch version : 11.1.0.12.3
OUI version : 11.1.0.12.0
Log file location : /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatch/opatch2015-01-02_13-28-19PM_1.log

OPatch detects the Middleware Home as "/u01/app/oracle/product/12.1.0/em12104"

Lsinventory Output file location : /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatch/lsinv/lsinventory2015-01-02_13-28-19PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):

EM Platform (OMS) 12.1.0.4.0
There are 1 products installed in this Oracle Home.

Interim patches (1) :

Patch 19136663 : applied on Fri Oct 03 11:00:22 EDT 2014
Unique Patch ID: 18088442
Created on 25 Sep 2014, 04:29:53 hrs PST8PDT
Bugs fixed:
19136663
--------------------------------------------------------------------------------
OPatch succeeded.

3. Ensure that we do not have any issues with configuration and binary prerequisite checks
$ unzip -d /u01/app/setup /u01/app/media/p19218456_121040_Generic.zip
... ...
$ cd /u01/app/setup/19218456
$ $ORACLE_HOME/OPatch/opatchauto apply -analyze
OPatch Automation Tool
Copyright (c) 2014, Oracle Corporation. All rights reserved.

OPatchauto version : 11.1.0.12.3
OUI version : 11.1.0.12.0
Running from : /u01/app/oracle/product/12.1.0/em12104/oms
Log file location : /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatch/opatch2015-01-02_13-29-10PM_1.log

OPatchauto log file: /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatchauto/19218456/opatch_oms_2015-01-02_13-29-11PM_analyze.log

Please enter OMS weblogic admin server URL(t3s://host01.dbaplus.ca:7101):>
Please enter OMS weblogic admin server username:> weblogic
Please enter OMS weblogic admin server password:>

Configuration Validation: Success

Running apply prerequisite checks for sub-patch(es) "19218456" and Oracle Home "/u01/app/oracle/product/12.1.0/em12104/oms"...
Please monitor OPatch log file: /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatch/19218456_Jan_02_2015_13_29_10/ApplyPrereq2015-01-02_13-29-37PM_2.log
Sub-patch(es) "19218456" are successfully analyzed for Oracle Home "/u01/app/oracle/product/12.1.0/em12104/oms"

Complete Summary
================

All log file names referenced below can be accessed from the directory "/u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatch/2015-01-02_13-29-10PM_SystemPatch_19218456_1"

Prerequisites analysis summary:
-------------------------------

The following sub-patch(es) are applicable:

Oracle Home Name Sub-patches Log file
---------------- ----------- --------
oms12c1 19218456 19218456_ApplyPrereq2015-01-02_13-29-37PM_2.log

Log file location: /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatchauto/19218456/opatch_oms_2015-01-02_13-29-11PM_analyze.log
OPatchauto succeeded.

4. Stop OMS
$ which emctl
/u01/app/oracle/product/12.1.0/em12104/oms/bin/emctl
$ emctl stop oms
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation. All rights reserved.
Stopping WebTier...
Error Occurred: Cannot run program "/u01/app/oracle/product/12.1.0/gc_inst/WebTierIH1/bin/opmnctl": error=12, Not enough space
Please check /u01/app/oracle/product/12.1.0/gc_inst/em/EMGC_OMS1/sysman/log/emctl.log for error details

There is not enough SWAP free space. Check article "Got ‘Not enought space’ while ‘emctl stop oms’" for details.
Step ahead after reclaiming SWAP space:
$ emctl stop oms
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation. All rights reserved.
Stopping WebTier...
WebTier Successfully Stopped
Stopping Oracle Management Server...
Oracle Management Server Successfully Stopped
Oracle Management Server is Down

5. Install PSU
$ cd /u01/app/setup/19218456
$ $ORACLE_HOME/OPatch/opatchauto apply
OPatch Automation Tool
Copyright (c) 2014, Oracle Corporation. All rights reserved.

OPatchauto version : 11.1.0.12.3
OUI version : 11.1.0.12.0
Running from : /u01/app/oracle/product/12.1.0/em12104/oms
Log file location : /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatch/opatch2015-01-02_14-24-17PM_1.log

OPatchauto log file: /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatchauto/19218456/opatch_oms_2015-01-02_14-24-18PM_deploy.log

Please enter OMS weblogic admin server URL(t3s://host01.dbaplus.ca:7101):>
Please enter OMS weblogic admin server username:> weblogic
Please enter OMS weblogic admin server password:>

Configuration Validation: Success

Running apply prerequisite checks for sub-patch(es) "19218456" and Oracle Home "/u01/app/oracle/product/12.1.0/em12104/oms"...
Please monitor OPatch log file: /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatch/19218456_Jan_02_2015_14_24_17/ApplyPrereq2015-01-02_14-24-41PM_2.log
Sub-patch(es) "19218456" are successfully analyzed for Oracle Home "/u01/app/oracle/product/12.1.0/em12104/oms"

To continue, OPatchauto will do the following:
[Patch and deploy artifacts] : Apply sub-patch(es) [ 19218456 ] to Oracle Home "/u01/app/oracle/product/12.1.0/em12104/oms";
Apply RCU artifact with patch "/u01/app/oracle/product/12.1.0/em12104/oms/.patch_storage/19218456_Oct_14_2014_03_22_39/original_patch"

Do you want to proceed? [y|n]
y
User Responded with: Y

Applying sub-patch "19218456" to Oracle Home "/u01/app/oracle/product/12.1.0/em12104/oms"...
Please monitor OPatch log file: /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatch/19218456_Jan_02_2015_14_24_17/apply2015-01-02_14-25-16PM_4.log

Updating repository with RCU reference file "/u01/app/oracle/product/12.1.0/em12104/oms/.patch_storage/19218456_Oct_14_2014_03_22_39/original_patch"

Complete Summary
================

All log file names referenced below can be accessed from the directory "/u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatch/2015-01-02_14-24-17PM_SystemPatch_19218456_1"

Patching summary:
-----------------

Binaries of the following sub-patch(es) have been applied successfully:

Oracle Home Name Sub-patches Log file
---------------- ----------- --------
oms12c1 19218456 19218456_apply2015-01-02_14-25-16PM_4.log

Deployment summary:
-------------------

The following artifact(s) have been successfully deployed:

Artifacts Log file
--------- --------
SQL rcu_applypatch_original_patch_2015-01-02_14-27-25PM.log


Log file location: /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatchauto/19218456/opatch_oms_2015-01-02_14-24-18PM_deploy.log

OPatchauto succeeded.

6 Start OMS
$ emctl start oms
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation. All rights reserved.
Starting Oracle Management Server...

Starting WebTier...
WebTier Successfully Started
Oracle Management Server Successfully Started
Oracle Management Server is Up

7 Validate ORACLE_HOME
$ $ORACLE_HOME/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 11.1.0.12.3
Copyright (c) 2015, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/12.1.0/em12104/oms
Central Inventory : /u01/app/oraInventory
from : /u01/app/oracle/product/12.1.0/em12104/oms/oraInst.loc
OPatch version : 11.1.0.12.3
OUI version : 11.1.0.12.0
Log file location : /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatch/opatch2015-01-02_14-33-53PM_1.log

OPatch detects the Middleware Home as "/u01/app/oracle/product/12.1.0/em12104"

Lsinventory Output file location : /u01/app/oracle/product/12.1.0/em12104/oms/cfgtoollogs/opatch/lsinv/lsinventory2015-01-02_14-33-53PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

EM Platform (OMS) 12.1.0.4.0
There are 1 products installed in this Oracle Home.

Interim patches (2) :

Patch 19218456 : applied on Fri Jan 02 14:27:10 EST 2015
Unique Patch ID: 17982946
Patch description: "ENTERPRISE MANAGER BASE PLATFORM - OMS 12.1.0.4.1 PSU (GENERIC)"
Created on 14 Oct 2014, 03:22:39 hrs PST8PDT
Bugs fixed:
18599481, 17407918, 18932882, 18805935, 19258481, 19376082, 19323634
18938561, 17812648, 18725891, 18945007, 18721562, 18359621, 18490432
19218456, 18490468, 19137411, 17843191, 18710124, 18516298, 18490455
18256983, 18999400, 19329809, 19300103, 18351725, 18521731, 18485889
19458672, 18490444, 18446798, 18765545, 18389542, 18509136

Patch 19136663 : applied on Fri Oct 03 11:00:22 EDT 2014
Unique Patch ID: 18088442
Created on 25 Sep 2014, 04:29:53 hrs PST8PDT
Bugs fixed:
19136663

--------------------------------------------------------------------------------

OPatch succeeded.

8 References:

Readme - Oracle Enterprise Manager 12c Release 4 Patch Set Update 1 (12.1.0.4.1) for Oracle Management Service