Amazon books

Tuesday, July 30, 2013

DBCA Silent Mode Example

Create a database using dbca in silent mode with this simple command below:

dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName MYDB.brazil -sid MYDB -sysPassword mypass -systemPassword mypass -datafileDestination +DG_DATA -storageType ASM -asmSysPassword myasmpass


Best Regards,
Paulo Portugal

Monday, July 29, 2013

Creating Database Using DBCA got ORA-01034: ORACLE not available

My oracle file permission was wrong.

--Before
[oracle@bwdhdbpr060 bin]$ ls -la oracle
-rwxr-x--x  1 orashp oinstall 232399041 Jul 27 15:05 oracle

--After

[oracle@bwdhdbpr060 bin]$ chmod 6751 oracle
[oracle@bwdhdbpr060 bin]$ ls -la oracle
-rwsr-s--x 1 oracle oinstall 203972171 Jul 25 19:24 oracle


Also, unset ORA_CRS_HOME from your database OS user before starting dbca.

This fix my problem.


Best Regards,
Paulo Portugal

Thursday, July 18, 2013

netca got error ServiceAliasException: Could not initialize Service Alias: TNS-04404: no error caused by: oracle.net.config.ConfigException: TNS-04414: File error caused by: TNS-04612: Null RHS for "BWWLPR"

O got this error below while trying to create a listener using netca in a RAC 10g.

############################################################################

ServiceAliasException: Could not initialize Service Alias: TNS-04404: no error
  caused by: oracle.net.config.ConfigException: TNS-04414: File error
  caused by: TNS-04612: Null RHS for "BWWLPR"
############################################################################

The problem was that netca is not recognising my service name BWWLPR as below:

############################################################################

BWWLPR =
(DESCRIPTION =
  (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxx1.b2w)(PORT = 1525))
    (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxx2.b2w)(PORT = 1525))
    (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxx3.b2w)(PORT = 1525))

    (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxx4.b2w)(PORT = 1525))
  )
  (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = BWWLPR)
    (FAILOVER_MODE =

 (TYPE = SELECT)
      (METHOD = BASIC)
      (RETRIES = 180)
      (DELAY = 5)
    )
  )



############################################################################


To fix this issue I added the line "(DESCRIPTION = " to the first line like below:

"BWWLPR = (DESCRIPTION ="

It works for me.

Best Regards,
Paulo Portugal

Wednesday, July 17, 2013

Installing Clusterware 10g Linux x86_64bit . root.sh "Failed to upgrade Oracle Cluster Registry configuration"

When installing Clusterware 10g on linux you run root.sh and got this error below:

###############################################

/opt/oracle/products/asm_home/root.sh
WARNING: directory '/opt/oracle/products' is not owned by root
WARNING: directory '/opt/oracle' is not owned by root

Checking to see if Oracle CRS stack is already configured

Setting the permissions on OCR backup directory
Setting up NS directories
Failed to upgrade Oracle Cluster Registry configuration

###############################################

Checking logs in $CRS_HOME/log/hostname you find something like this:
###############################################

2013-07-17 15:39:51.555: [  OCRRAW][370326256]propriogid:1: INVALID FORMAT
2013-07-17 15:39:51.570: [  OCRRAW][370326256]propriowv: Vote information on disk 0 [/dev/raw/raw1] is adjusted from [0/0] to [2/2]
2013-07-17 15:39:51.599: [  OCRRAW][370326256]propriniconfig:No 92 configuration
2013-07-17 15:39:51.599: [  OCRAPI][370326256]a_init:6a: Backend init successful
2013-07-17 15:39:51.665: [ OCRCONF][370326256]Initialized DATABASE keys in OCR
2013-07-17 15:39:51.732: [ OCRCONF][370326256]csetskgfrblock0: clsfmt returned with error [4].
2013-07-17 15:39:51.732: [ OCRCONF][370326256]Failure in setting block0 [-1]
2013-07-17 15:39:51.732: [ OCRCONF][370326256]OCR block 0 is not set !
2013-07-17 15:39:51.732: [ OCRCONF][370326256]Exiting [status=failed]...

###############################################


Action Plan is to use DD to initialise devices. :

--OCR
dd if=/dev/zero of=/dev/mapper/oravtocr1 bs=125829120 count=1

--VOTE
dd if=/dev/zero of=/dev/mapper/oravtocr2 bs=20971520 count=1

and run root.sh again


Best Regards,
Paulo Portugal

Tuesday, July 16, 2013

Error "./runInstaller: line 90: 4310 Segmentation fault $CMDDIR/install/.oui $* -formCluster"


Error "./runInstaller: line 90:  4310 Segmentation fault      $CMDDIR/install/.oui $* -formCluster"

If you are trying to install oracle CLusterware and got this error below:

####################################################################################################
[oracle@bwdhdbpr055 clusterware]$ ./runInstaller
********************************************************************************

Please run the script rootpre.sh as root on all machines/nodes. The script can be found at the toplevel of the CD or stage-area. Once you have run the script, please type Y to proceed

Answer 'y' if root has run 'rootpre.sh' so you can proceed with Oracle Clusterware installation.
Answer 'n' to abort installation and then ask root to run 'rootpre.sh'.

********************************************************************************

Has 'rootpre.sh' been run by root? [y/n] (n)
y

Starting Oracle Universal Installer...

Checking installer requirements...

./runInstaller: line 90:  4310 Segmentation fault      $CMDDIR/install/.oui $* -formCluster
####################################################################################################

--Tracing runinstaller. At the end of trace you find this error below:

####################################################################################################
access("/etc/redhat-release", F_OK)     = 0
stat64("/etc/redhat-release", {st_mode=S_IFREG|0660, st_size=52, ...}) = 0
open("/etc/redhat-release", O_RDONLY)   = -1 EACCES (Permission denied)
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
####################################################################################################

--Change permission of /etc/redhat-release file to 777 and restart runInstaller

Best Regards,
Paulo Portugal

Getting DDL of a view quickly



SELECT view_definition FROM v$fixed_view_definition
       WHERE view_name='GV$TRANSACTION';

VIEW_DEFINITION
--------------------------------------------------------------------------------
select inst_id,ktcxbxba,kxidusn,kxidslt,kxidsqn,ktcxbkfn,kubablk, kubaseq,kubare
c, decode(ktcxbsta,0,'IDLE',1,'COLLECTING',2,'PREPARED',3,'COMMITTED',
       4,'HEURISTIC ABORT',5,'HEURISTIC COMMIT', 6,'HEURISTIC DA
MAGE',7,'TIMEOUT',9,'INACTIVE', 10,'ACTIVE',11,'PTX PREPARED',12
,'PTX COMMITTED',  'UNKNOWN'), ktcxbstm,ktcxbssb,ktcxbssw, ktcxbs
en,ktcxbsfl,ktcxbsbk,ktcxbssq,ktcxbsrc, ktcxbses,ktcxbflg, decode(bitand(ktcxbfl
g,16),0,'NO','YES'), decode(bitand(ktcxbflg,32),0,'NO','YES'), decode(bitand(ktc
xbflg,64),0,'NO','YES'), decode(bitand(ktcxbflg,8388608),0,'NO','YES'), ktcxbnam
, ktcxbpus,ktcxbpsl,ktcxbpsq, ktcxbpxu,ktcxbpxs,ktcxbpxq, ktcxbdsb, ktcxbdsw, kt
cxbubk,ktcxburc,ktcxblio,ktcxbpio,ktcxbcrg,ktcxbcrc, to_date(ktcxbstm,'MM/DD/RR
HH24:MI:SS','NLS_CALENDAR=Gregorian'), ktcxbdsb, ktcxbdsw,  ktcxbssc, ktcxbdsc,
ktcxbxid, ktcxbpid, ktcxbpxi  from x$ktcxb where bitand(ksspaflg,1)!=0 and bitan
d(ktcxbflg,2)!=0


1 row selected.


Best Regards,
Paulo Portugal

Sunday, July 14, 2013

Clone RAC 11g Binaries to Single Instance


1.      Copy OH from source to target:

cd /dbotm/oracle/products
find 11.2 -print | cpio -ov > /media/binario_OTM/OH_otm.cpio           
scp /media/binario_OTM/OH_otm.cpio orabpel7@10.3.0.31:/midias/binario_OTM            

2.     Create OH on new target:


mkdir -p /dbbpel7/oracle/products/11.2

3.     Uncompress:

cd /dbbpel7/oracle/products/              
cpio -idmv < /midias/binario_OTM/OH_otm.cpio

4.     Run clone.pl to clone binaries:

export ORACLE_HOME=/dbbpel7/oracle/products/11.2         
cd $ORACLE_HOME/clone/bin
perl clone.pl ORACLE_HOME="/dbbpel7/oracle/products/11.2" ORACLE_HOME_NAME="OH_BPEL7" ORACLE_BASE="/dbbpel7" OSDBA_GROUP=oinstall OSOPER_GROUP=dba


5.     Don't forget to run as root:

cd $ORACLE_HOME
./root.sh    

6.     Fix inventory(if necessary):
cd $ORACLE_HOME/oui/bin
./runInstaller -clone -silent -ignorePreReq ORACLE_HOME="/dbbpel7/oracle/products/11.2" ORACLE_HOME_NAME="OH_BPEL7" ORACLE_BASE="/dbbpel7" oracle_install_OSDBA=oinstall oracle_install_OSOPER=dba

7.     Finally, change RAC to OFF:

cd $ORACLE_HOME/rdbms/lib
/usr/ccs/bin/make -f ins_rdbms.mk rac_off
make -f ins_rdbms.mk ioracle


Best Regards,

Paulo Portugal 

Tuesday, July 9, 2013

Debug Oracle RMAN backups

If you need to investigate errors with your RMAN backups, use this debug option as below:

rman target  debug trace=/tmp/rmanDebug.trc log=/tmp/rmanLog.txt



Best Regards,Paulo Portugal