Wednesday, February 6, 2013

SID_XDB service and SID_XPT Service 

In oracle 10g, when you check the listener service, you may notice two particular services registered:
[ccbqa] /orasw/app/oracle/admin/ >lsnrctl status|grep ccbqa
Service "ccbqa" has 1 instance(s).
  Instance "ccbqa", status READY, has 1 handler(s) for this service...
Service "ccbqaXDB" has 1 instance(s).
  Instance "ccbqa", status READY, has 1 handler(s) for this service...
Service "ccbqa_XPT" has 1 instance(s).
  Instance "ccbqa", status READY, has 1 handler(s) for this service...


Thursday, January 31, 2013

ORA-01200


Sometimes when you try to start a database, you may get ORA-01200 error like:

ORA-01122: database file 8 failed verification check
ORA-01110: data file 8: '/bitest/oradata/bitest/cists02.dbf'

ORA-01200: actual file size of 64000 is smaller than correct size of 416256 blocks



The best solution is restore if you have a backup.
However if you don't have a backup, you can try to make the datafile have same block sizes registered in the control file to cheat oracle, but you may face data loses.

Steps as below (Caution: use at your own risk!!)

Monday, December 17, 2012

AIX - a sample script to start/stop OBIEE

#!/bin/ksh
# Check passed parameters
if [ $# -ne 2 ]
then
  echo "Please provide parameters"
  echo "Parameter 1 - Domain"
  echo "Parameter 2 - start or stop"
  exit
fi

Wednesday, July 11, 2012


Upgrade - Oracle Database 10.2.0.4 to 11.2.0.3

Oracle Database software uses 2 files (1 and 2) of the 11.2.0.3 patchset.
SQL> select name from v$database;
NAME
---------

TEST11G
SQL> select * from v$version;
BANNER

----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 – Production
CORE    10.2.0.4.0    Production
TNS for Linux: Version 10.2.0.4.0 – Production
NLSRTL Version 10.2.0.4.0 – Production


Wednesday, July 4, 2012

11gR2 Rac install on Centos 6.2 without Oracle ASMLib


Oracle ASMlib is available for linux prior to OL6 or RedHat 6. However, starting from 6, you can only use asmlib for UEK kernel.
On Linux, the built in udev is definitely a better solution to handle persistent device naming and permissions.

Without ASMLib, you don't need to worry about the raw disks everytime when there's a kernel update.

Tuesday, June 19, 2012

What are cvutrace.log.* files

 I was looking to clear some space recently and ran across a 21G directory (<grid_infrastructure_home>/cv/log). Inside there were a lot of files like “cvutrace.log.0_20100720015347″. These files are log files related to a RAC installation. They can safely be deleted.

To stop the files from being generated is add the following at the top of the cluvfy script in the <grid_infrastructure_home>/bin directory.



Windows:
set SRVM_TRACE=false

AIX:
export  SRVM_TRACE=false

Monday, June 18, 2012

An example of logon trigger

By user and by Module:
CREATE OR REPLACE TRIGGER SET_OPTIMIZER_ONLOGIN AFTER LOGON ON DATABASE
DECLARE
uname VARCHAR2(30);
app VARCHAR2(30);
cmmd VARCHAR2(64);
BEGIN
cmmd:='ALTER SESSION SET optimizer_index_cost_adj=20';
uname:=SYS_CONTEXT('USERENV','SESSION_USER');
app := upper(SYS_CONTEXT('USERENV','MODULE'));
IF uname = '*****' and app like 'SQLPLUS.EXE' then
   EXECUTE IMMEDIATE cmmd;
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
/

By module only:
CREATE OR REPLACE TRIGGER SET_OPTIMIZER_ONLOGIN AFTER LOGON ON DATABASE
DECLARE
app VARCHAR2(30);
cmmd VARCHAR2(64);
BEGIN
cmmd:='ALTER SESSION SET optimizer_index_cost_adj=20';
app := upper(SYS_CONTEXT('USERENV','MODULE'));
IF app like 'RUNBATCH.EXE' then
   EXECUTE IMMEDIATE cmmd;
END IF;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
/