Amit Bansal

Silent Install :OUI-10133:Invalid staging area Error

While using silent install for database software installation , you could encounter following errors

SEVERE:OUI-10133:Invalid staging area. There are no top level components for IBM SP AIX available for installation in this staging area.

This error is reported when OUI is unable to find products.xml file. Check response file for FROM_LOCATION parameter and see if it is correct and Oracle software owner has read permission on this file. In my case it was set to /oracle/dump/Disk1/database/stage/products.xml but the actual file was present at /oracle/ora10g/Disk1/database/stage/products.xml

ls -l "/oracle/ora10g/Disk1/database/stage/products.xml"
-rwxr-xr-x    1 ora10g   oinstall     804962 Aug 20 2005  /oracle/ora10g/Disk1/database/stage/products.xml

Modify the FROM_LOCATION to correct value and re-run the installation. It should go fine.

This parameter can have incorrect settings when you have copied the response file from $media/response/*rsp to a local directory due to which relative file naming convention makes file unavailable. By default value for FROM_LOCATION is set to “../stage/products.xml”. Edit the response file and enter the absolute path giving correct location for the file.

It can also be the case that you have created a custom response file using runInstaller GUI mode and the software media directory has now changed on the new server on which this response file is being used. e.g In my case response file was created when the Oracle software was staged in /oracle/dump/Disk1 directory but on the new server it has been moved to /oracle/ora10g/Disk1 . Due to this , OUI was not able to locate products.xml file and we were required to change value for FROM_LOCATION variable.

In case you are wondering how to create a custom response file, then it is pretty simple.To create response file for custom Installation

./runInstaller -record -destinationFile /oracle/ora10g/work/custom10g.rsp

Select the custom installation and choose the components which you wish to install.
When Oracle Universal Installer displays the Summary screen, perform one of the following actions:

 -Click Install to create the response file, then continue with the installation OR
    -Click Cancel and then Yes to create the response file but exit from Oracle Universal Installer without installing the software.

The response file is saved in the location that you specified using the -destinationFile option.

You Don’t need SysDBA privilege to run Awrrpt..

Well I tried to Sensationalize this post by using such a heading 🙂 Though I just wanted to point out that Awrrpt script can be run without sysdba privilege too. Actually if you open awrrpti.sql script , it contains following line

Rem    NOTES
Rem      Run as SYSDBA.  Generally this script should be invoked by awrrpt,
Rem      unless you want to pick a database other than the default.

In actual you need only two privileges to run the script. One is SELECT_CATALOG_ROLE and other is execute permission on dbms_workload_repository procedure. If you don’t give privilege explicitly on this package you get following errors

select output from table(dbms_workload_repository.awr_report_text( :dbid,
                         *
ERROR at line 1:
ORA-00904: : invalid identifier

Therefore following command’s does the trick.

grant select_catalog_role to amit;
grant execute on dbms_workload_repository to amit;

ORA-1078 ORA-1565 Errors while starting database with SPFILE on ASM

I was getting following error’s while starting a database using spfile on ASM. Actually this was a cloned RAC environment.

SQL> create SPFILE='+ASM_GROUP/PORTALDB/spfileportaldb.ora' from pfile;
File created.
SQL> shut immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> exit
SQL> startup mount
ORA-01078: failure in processing system parameters
ORA-01565: error in identifying file '+ASM_GROUP/PORTALDB/spfileportaldb.ora'
ORA-17503: ksfdopn:2 Failed to open file +ASM_GROUP/PORTALDB/spfileportaldb.ora
ORA-01000: maximum open cursors exceeded

Error first states that it has failed to process the parameter. Second states that it has failed to identify the spfile and is unable to open. But I was able to open the database normally with pfile. Also the spfile was present in ASM diskgroup which I confirmed by listing DG contets on asmcmd prompt.

Problem here was that I had started the database with pfile from non-default location and pfile located in $ORACLE_HOME/dbs had following entries

SPFILE='+ASM_GROUP/PORTALDB/spfileportaldb.ora'

In this case spfile too was created with same contents. Correct method is to specify the non-default pfile location in ‘create spfile’ syntax.

SQL> CREATE SPFILE='+ASM_GROUP/PORTALDB/spfileportaldb.ora' from pfile=\'/home/oracle/portaldb.ora\';

File created.

SQL> shut immediate;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
SQL> exit
SQL> sqlplus \"/ as sysdba\"
Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 3674210304 bytes
Fixed Size                  2088384 bytes
Variable Size            2197815872 bytes
Database Buffers         1459617792 bytes
Redo Buffers               14688256 bytes
Database mounted.
SQL> alter database open;

Cheers
Amit

OUI-67124 – Copy failed from ‘location 1’ to ‘location 2’

Just a short note to discuss a problem faced by me while applying CPU Jan patch to clusterware on AIX 5L. I was getting following errors

UtilSession failed: ApplySession failed in system modification phase... 'ApplySession::apply failed: Copy failed from '/archive/oracle/soft/Patch/6980307/6756433/files/lib/libhasgen10.so' to '/oracle/crs_base/app/product/crs10gR2/lib/libhasgen10.so'...
Copy failed from '/archive/oracle/soft/Patch/6980307/6756433/files/lib/libocr10.so' to '/oracle/crs_base/app/product/crs10gR2/lib/libocr10.so'...
Copy failed from '/archive/oracle/soft/Patch/6980307/6756433/files/lib/libocrb10.so' to '/oracle/crs_base/app/product/crs10gR2/lib/libocrb10.so'...
Copy failed from '/archive/oracle/soft/Patch/6980307/6756433/files/lib/libocrutl10.so' to '/oracle/crs_base/app/product/crs10gR2/lib/libocrutl10.so'..

I had followed all the  pre-requsites for this patch installation i.e

1)Stopped the database instance and ASM instance on the node

2)Stopped the nodeapps services

3)Stopped the clusterware

4) Executed /usr/sbin/slibclean as root

I searched over metalink and found a note recommending renaming the files and  retrying the patching process. One more suggestion was to copy the files manually. I thought of debugging this issue (also wanted to have clean installation), so I checked for processes being run by ‘oracle’ user. I found that listener was running

oracle 1982506       1   0 00:30:13      -  0:00 /oracle/ora_base/app/product/db10gR2/bin/tnslsnr LISTENER_TAF_PRODDB1 -inherit

This was a listener which was created manually (not using netca) and not registered in the OCR. As a result, it did not stop when we stopped the nodeapps services. I then stopped the listener and executed /usr/sbin/slibclean (as root) and re-initiated the patching process. This time it went fine.

One more easier way would have been to use ‘fuser’ command to identify the pid’s for the processes accessing the file.

In the end I realized that before proceeding to apply patch ,it is better to check for if any Instance or listener or any other process (RMAN, sqlplus or sqlloader utilities too) is running from Oracle Home being patched even though you have followed all the steps mentioned in Patch readme.

Cheers

Amit

Upgrade to WordPress 2.7.1

WordPress 2.7.1 is out..While using upgrade button, it will be stuck at downloading files and will not proceed further. This issue will be faced by people using “Automatic Upgrade” plugin available in prior release. You need to disable the plugin and then re-try the operation. Also note that you have to take a “Backup ” of database as the plugin does not take automatic backup.

WordPress Automatic Upgrade plugin did not work for me , as this gave message for my 2.7 installation

“Congratulations!!! Your WordPress version is already up to date”

So you can easily go ahead and disable this plugin and use the Upgrade option available with WordPress 2.7

Cheers
Amit

Scheduling Job through Cron??

In case you came across this link searching for Cron syntax, then you can refer to following link

http://www.adminschoice.com/docs/crontab.htm

Other’s can continue reading the article …. 😉

This was a problem which I faced yesterday. We had a mview refresh which was lagging on one of the server. On checking master site, I found that there were many pending requests coming from the second materialized view site . Checking second site revealed that there were multiple sessions running in database which were waiting on ‘enq :JI Contention’ wait event.

These mviews were being refreshed by job scheduled through a cron. Doing a grep for the refresh script gave following result

 $ps -ef|grep scott|grep -v grep
    oracle 11725 11714  0 13:00:00 ?         0:00 /usr/bin/sh /home/oracle/cron/Refresh_scott.sh
  oracle 19981 19970  0  Feb  7  ?         0:00 /usr/bin/sh /home/oracle/cron/Refresh_scott.sh
  oracle 24794 24781  0 06:30:00 ?         0:00 /usr/bin/sh /home/oracle/cron/Refresh_scott.sh
    oracle 10538 10527  0  Feb  6  ?         0:00 /usr/bin/sh /home/oracle/cron/Refresh_scott.sh
    oracle 13972 13935  0  Feb  6  ?         0:00 /usr/bin/sh /home/oracle/cron/Refresh_scott.sh
  oracle  2601  2592  0 19:00:00 ?         0:00 /usr/bin/sh /home/oracle/cron/Refresh_scott.sh
  oracle 17274 17246  0  Feb  6  ?         0:00 /usr/bin/sh /home/oracle/cron/Refresh_scott.sh
  oracle  8308  8294  0 13:30:00 ?         0:00 /usr/bin/sh /home/oracle/cron/Refresh_scott.sh

This was definitely wrong. I killed the database sessions and also killed the OS processes

$ ps -ef|grep Refresh_scott.sh|grep -v grep|awk ‘{print $2}’|xargs kill -9

This issue had occurred as one more site was added for mview refresh and due to locking issues (while deleting records from Mlog$), job could not complete before next refresh schedule. While scheduling scripts through cron, care should be taken to put a check if script is already running or not. This is required as Cron will spawn the new job (as per job schedule) irrespective of fact that whether earlier execution has completed or not. I used following logic to implement the same check

cnt=`ps -ef|grep Refresh_scott.sh|grep -v grep |wc -l`
if [ $cnt -eq 1 ]
then
echo "Running Fast Refresh now " > $DIR/Check_refresh_scott.log
sqlplus /nolog <<EOF > $DIR/Refresh_scott.log
conn scott/tiger
exec dbms_mview.refresh ...
...
exit
EOF
else
echo "Fast refresh already running " > $DIR/Check_refresh_scott.log
date >> $DIR/Check_refresh_scott.log
exit
fi

There could be other logics too which can be used to implement the same. e.g Other could be

filename=$DIR/Check_refresh_scott.log
if [ -e $filename  ]
then
echo "Fast Refresh already running " > refresh_runnning.log
exit
else
sqlplus /nolog <<EOF > $DIR/Refresh_scott.log
conn scott/tiger
exec dbms_mview.refresh ...
...
exit
EOF
rm $filename
fi

Other way could be to use DBMS_JOB and DBMS_SCHEDULER to schedule the database job.