Amazon books

Saturday, November 30, 2013

exec dbms_scheduler.RUN_JOB is not running the JOB. Session just HANG!!

I just got this problem,


exec dbms_scheduler.RUN_JOB('SYSTEM.B2W_GATHER_STATS_RISCO_DS');

Even using the owner of the job, the session hang and did not execute the job.

I had to use this option below:

exec DBMS_SCHEDULER.run_job (job_name => 'B2W_GATHER_STATS_RISCO_DS');

Now it works.

Best Regards,
Paulo Portugal


Monday, October 28, 2013

Using log dump to find operations in a table between interval time - GoldenGate

1-Open the trace file

Logdump 2 >open eb000025
Current LogTrail is /ggshop/bwdhdbpr025/gghome/dirdat/eb000025

2-Set time interval
Logdump 4 >filter starttime 2013-10-28 11:30
Logdump 5 >filter endtime 2013-10-28 11:59

3-Match all tables and show
Logdump 6 >filter match all
Logdump 7 >filter show
Logdump 8 >count

4-Or check for only one table
Logdump 11 >filter filename TABLE_NAME

####################################################
###### Output example ######
####################################################
SCHEMA.TABLE1                       Partition 4
Total Data Bytes             70524
  Avg Bytes/Record            1410
Insert                          16
LargeObject                     34
After Images                    50
####################################################



Best Regards,
Paulo Portugal

Friday, October 25, 2013

Enable all DDL Commands to be Logged in Alert.log file - Oracle Database 12c

With this simple command below you can enable all DDL commands to be logged in alert.log

ALTER SYSTEM SET enable_ddl_logging = TRUE ;


Best Regards,
Paulo Portugal

Thursday, October 24, 2013

Veridata Agent problem. Job Hang in one table.

If your veridata job is running forever , check if you are in 11.2.0.0 version.

I got this error on my veridata agent log:

ERROR:2013-10-24 16:03:50,524 (Session: 1098) - An unexpected exception has occurred: null [RowHashQuery:getCompletion, line 315]
java.lang.ArrayIndexOutOfBoundsException
        at com.goldengate.veridata.db.OracleDatabase$OracleRawTimestampColumnMapper.getBytes(OracleDatabase.java:841)
        at com.goldengate.veridata.db.BaseQuery.packRow(BaseQuery.java:134)
        at com.goldengate.veridata.db.RowHashQuery.call(RowHashQuery.java:112)
        at com.goldengate.veridata.db.RowHashQuery.call(RowHashQuery.java:34)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
        at java.util.concurrent.FutureTask.run(FutureTask.java:149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
        at java.lang.Thread.run(Thread.java:738)


--Solution
Apply patch 11.2.0.1  on all your veridata agents.


Best Regards,
Paulo Portugal

Wednesday, October 23, 2013

GoldenGate JAgent not starting - FIXED!

Trying to start jagent got this error below:

[hostname]/ggshop/bwdhdbpr052/gghome>  java -jar -Xms64m -Xmx512m dirjar/jagent.jar
0    [main] INFO  com.goldengate.monitor.jagent.JAgentWSMain  - About to call initialize on the WebService
997  [main] INFO  com.goldengate.monitor.jagent.config.impl.AgentInfoImpl  - Using IP address 10.3.0.33 to connect to the Manager Web Service
1002 [main] ERROR com.goldengate.monitor.jagent.JAgentWSMain  - Error Initializing JAgent. JAgent will not be initialized and about to return. Exception: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'agentBootstrapper': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'agentInfo': Invocation of init method failed; nested exception is java.lang.NumberFormatException: For input string: "number"
1002 [main] INFO  com.goldengate.monitor.jagent.JAgentWSMain  - JAgentWSMain is about to terminate its operation
1003 [Shutdown Thread.] INFO  com.goldengate.monitor.jagent.JAgentWSMain  - JAgent is about to shutdown.
1004 [Shutdown Thread.] INFO  com.goldengate.monitor.jagent.JAgentWSMain  - JAgent shutdown process is completed successfully.

--Solution
1-Edit mgr.prm file and remove all comments before the line that specify the Manager port:
--Port of Manager -------REMOVE THIS LINE
"port 7809"


Best Regards,
Paulo Portugal

Tuesday, August 27, 2013

Using kfod to check ASM disks

Checking disks in OS:

[XXXXHOST]/dev> kfod a='/dev/rhdisk*' d=all
--------------------------------------------------------------------------------
 Disk          Size Path
================================================================================
   1:     102750 Mb /dev/rhdisk124
   2:     102750 Mb /dev/rhdisk125
   3:     102750 Mb /dev/rhdisk126
   4:     102750 Mb /dev/rhdisk127
   5:     102750 Mb /dev/rhdisk128
   6:     102750 Mb /dev/rhdisk129
   7:     102750 Mb /dev/rhdisk130
   8:     102750 Mb /dev/rhdisk131
   9:     102750 Mb /dev/rhdisk132
  10:     102750 Mb /dev/rhdisk133
  11:     102750 Mb /dev/rhdisk134
  12:     102750 Mb /dev/rhdisk135
  13:     102750 Mb /dev/rhdisk136
  14:     102750 Mb /dev/rhdisk137
  15:     102750 Mb /dev/rhdisk138
  16:     102750 Mb /dev/rhdisk139
  17:     102750 Mb /dev/rhdisk140
  18:     102750 Mb /dev/rhdisk141
  19:     102750 Mb /dev/rhdisk142
  20:     102750 Mb /dev/rhdisk143
  21:     102750 Mb /dev/rhdisk144
  22:     102750 Mb /dev/rhdisk145
  23:     102750 Mb /dev/rhdisk146
  24:     102750 Mb /dev/rhdisk147
  25:     102750 Mb /dev/rhdisk148
  26:     102750 Mb /dev/rhdisk149
  27:     102750 Mb /dev/rhdisk150
  28:     102750 Mb /dev/rhdisk151
  29:     102750 Mb /dev/rhdisk152
  30:     102750 Mb /dev/rhdisk153
  31:     102750 Mb /dev/rhdisk154
  32:     102750 Mb /dev/rhdisk155
  33:     102750 Mb /dev/rhdisk156
  34:     102750 Mb /dev/rhdisk157
  35:     102750 Mb /dev/rhdisk158
  36:     102750 Mb /dev/rhdisk159
  37:     102750 Mb /dev/rhdisk160
  38:     102750 Mb /dev/rhdisk161
  39:     102750 Mb /dev/rhdisk162
  40:     102750 Mb /dev/rhdisk163
  41:     102750 Mb /dev/rhdisk164
  42:     102750 Mb /dev/rhdisk165
  43:     102750 Mb /dev/rhdisk166
  44:     102750 Mb /dev/rhdisk167
  45:     102750 Mb /dev/rhdisk168
  46:     102750 Mb /dev/rhdisk169
  47:     102750 Mb /dev/rhdisk170
  48:     102750 Mb /dev/rhdisk171
  49:     102750 Mb /dev/rhdisk172
  50:     102750 Mb /dev/rhdisk173
  51:     102750 Mb /dev/rhdisk174
  52:     102750 Mb /dev/rhdisk175
  53:     102750 Mb /dev/rhdisk176
  54:     102750 Mb /dev/rhdisk177
  55:     102750 Mb /dev/rhdisk178
  56:     102750 Mb /dev/rhdisk179
  57:     102750 Mb /dev/rhdisk180
  58:     102750 Mb /dev/rhdisk181
  59:     102750 Mb /dev/rhdisk182
  60:     102750 Mb /dev/rhdisk183
  61:     102750 Mb /dev/rhdisk184
  62:     102750 Mb /dev/rhdisk185
  63:     102750 Mb /dev/rhdisk186
  64:     102750 Mb /dev/rhdisk187
  65:     102750 Mb /dev/rhdisk188
  66:     102750 Mb /dev/rhdisk189
  67:     102750 Mb /dev/rhdisk190
  68:     102750 Mb /dev/rhdisk191
  69:     102750 Mb /dev/rhdisk192
  70:     102750 Mb /dev/rhdisk193
  71:     205500 Mb /dev/rhdisk26
  72:     205500 Mb /dev/rhdisk27
  73:     205500 Mb /dev/rhdisk28
  74:     205500 Mb /dev/rhdisk29
  75:     102750 Mb /dev/rhdisk30
  76:     102750 Mb /dev/rhdisk31
  77:     102750 Mb /dev/rhdisk32
  78:     102750 Mb /dev/rhdisk33
  79:     102750 Mb /dev/rhdisk34
  80:     102750 Mb /dev/rhdisk35
  81:     102750 Mb /dev/rhdisk36
  82:     102750 Mb /dev/rhdisk37
  83:     102750 Mb /dev/rhdisk38
  84:     102750 Mb /dev/rhdisk39
  85:     102750 Mb /dev/rhdisk40
  86:     102750 Mb /dev/rhdisk41
  87:     102750 Mb /dev/rhdisk42
  88:     102750 Mb /dev/rhdisk43
  89:     102750 Mb /dev/rhdisk44
  90:     102750 Mb /dev/rhdisk45
  91:     102750 Mb /dev/rhdisk46
  92:     102750 Mb /dev/rhdisk47
  93:     205500 Mb /dev/rhdisk48
  94:     205500 Mb /dev/rhdisk49
  95:     205500 Mb /dev/rhdisk50
  96:     205500 Mb /dev/rhdisk51
  97:     205500 Mb /dev/rhdisk52
  98:     205500 Mb /dev/rhdisk53
  99:     205500 Mb /dev/rhdisk54
 100:     205500 Mb /dev/rhdisk55
 101:     205500 Mb /dev/rhdisk56
 102:     205500 Mb /dev/rhdisk57
 103:     205500 Mb /dev/rhdisk58
 104:     205500 Mb /dev/rhdisk59
 105:       2048 Mb /dev/rhdisk60
 106:       2048 Mb /dev/rhdisk61
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME
================================================================================
     +ASM1 /opt/oracle/products/11.2/grid
     +ASM2 /opt/oracle/products/11.2/grid
     +ASM4 /opt/oracle/products/11.2/grid
     +ASM3 /opt/oracle/products/11.2/grid
[XXXXXHOST]/dev> kfod op=groups

--Checking ORACLE_ASM_HOME


[XXXXHOST]/dev> kfod a='/dev/hdisk*' d=all
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME
================================================================================
     +ASM1 /opt/oracle/products/11.2/grid
     +ASM2 /opt/oracle/products/11.2/grid
     +ASM4 /opt/oracle/products/11.2/grid
     +ASM3 /opt/oracle/products/11.2/grid


Best Regards,
Paulo Portugal

Wednesday, August 21, 2013

Standby Database errors in alert ORA-12801ORA-00600 ORA-10567 ORA-10564 ORA-01110 ORA-10561

If your MRP process stop on standby database with errors like below:


Errors in file /dbmid/admin/XXX/bdump/bwmdpr1_mrp0_1646.trc:
ORA-12801: error signaled in parallel query server P007, instance hostname055:XXX1 (1)
ORA-00600: internal error code, arguments: [3020], [37], [1277558], [156466806], [], [], [], []
ORA-10567: Redo is inconsistent with data block (file# 37, block# 1277558)
ORA-10564: tablespace TS_XXX_INDEX_M
ORA-01110: data file 37: '+DG_XXX_DATA/xxx/datafile/tsin_xxx_index_m.dbf'
ORA-10561: block type 'TRANSACTION MANAGED INDEX BLOCK', data object# 135950
Wed Aug 21 15:24:02 2013
MRP0: Background Media Recovery process shutdown (XXXR1)


Action Plan:

1-Check the object in primary database
select OWNER, OBJECT_NAME, SUBOBJECT_NAME, OBJECT_TYPE 
     from DBA_OBJECTS 
     where DATA_OBJECT_ID = 135950;

In My case it was an index and was not corrupted on primary database.

2-Start recover of standby allowing one corruption using this command below:

SQL> alter database recover automatic standby database allow 1 corruption;

Best Regards,
Paulo Portugal

Saturday, August 3, 2013

Start and Stop GoldenGate Veridata Command Line

-> Start
cd $GG_VER_HOME/web/bin
./startup.sh

-> Stop

cd $GG_VER_HOME/web/bin
./shutdown.sh


Best Regards,
Paulo Portugal

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

Wednesday, June 26, 2013

Top 10 New Features for Database 12c

My top 10 for Database 12c by now:

1-Data Guard Active Far Sync
2-Tuning network with SDU up to 2MB
3-DRCP can now be used with Oracle JDBC drivers
4-Heat Map stats in also new ADO
5-New security feature Data Redaction (kind of database firewall)
6-GDS with Active Data Guard and Golden Gate(Global Services, GDS Pool, GDS Region)
7-Recover tables in RMAN
9-Recover standby databases using incremental backups with one command (recover from service)
10-Move datafiles ONLINE!!

There are too many!! ;)

Best Regards,
Paulo Portugal

Download Oracle Database 12c NOW

http://www.oracle.com/technetwork/indexes/downloads/index.html

Oracle just released 12c Database.

Enjoy it!

BEst Regards,
Paulo Portugal

Wednesday, June 19, 2013

DGMGRL> switchover to db11gstb Performing switchover NOW, please wait... Error: ORA-16775: target standby database in broker operation has potential data loss Failed. Unable to switchover, primary database is still "db11g" DGMGRL>


If you got this error below while switching database using Data Guard Broker,

############################
DGMGRL> switchover to db11gstb
Performing switchover NOW, please wait...
Error: ORA-16775: target standby database in broker operation has potential data loss

Failed.
Unable to switchover, primary database is still "db11g"
DGMGRL>
############################

Stop the MRP process at standby database and restart it using current log file:

recover managed standby database cancel;
recover managed standby database using current logfile disconnect from session;


Do the switchover again.

Best Regards,
Paulo Portugal

Monday, June 17, 2013

If you got error below trying to initialize a NFS mount in your VM Server ;

#################################################
[root@f2cvmsrv ~]# /opt/ovs-agent-2.3/utils/repos.py -i
Mount point:
Error: errcode=00000, errmsg=Unexpected error: errcode=00000, errmsg=Unexpected error: failed:
StackTrace:
  File "/opt/ovs-agent-2.3/OVSSiteHA.py", line 248, in ha_check_cpu_compatibility
    raise Exception("CPU not compatible! %s" % repr(d))
>
StackTrace:
  File "/opt/ovs-agent-2.3/OVSSiteCluster.py", line 612, in cluster_check_prerequisite
    raise Exception(msg)
StackTrace:
  File "/opt/ovs-agent-2.3/OVSSiteCluster.py", line 649, in _cluster_setup
    _check(ret)
  File "/opt/ovs-agent-2.3/OVSXCluster.py", line 342, in _check
    raise OVSException(error=ret["error"])
#################################################
Edit this file below:
vi  /opt/ovs-agent-2.3/OVSSiteCluster.py
--comment this line below
# rs.append(("ha_check_cpu_compatibility", ha_check_cpu_compatibility(hosts)))
Restart ovs agent:
service ovs-agent restart --disable-nowayout

Best Regards,
Paulo Portugal

Monday, June 10, 2013

RE-Create database link another schema in Oracle


There is a way to simple do that using dbms_sys_sql package.

--Change your username here MYUSER
DECLARE
  lv_stmt VARCHAR2(2000);

  PROCEDURE run_sql_as(p_user IN VARCHAR2, p_statement IN VARCHAR2) IS
    lv_userid NUMBER;
lv_cursor NUMBER;
lv_result NUMBER;
  BEGIN
-- Get USER_ID for specified user
SELECT user_id INTO lv_userid FROM dba_users WHERE username = p_user;

-- Open, parse, execute and close
lv_cursor := sys.dbms_sys_sql.open_cursor;
sys.dbms_sys_sql.parse_as_user(lv_cursor, p_statement, dbms_sql.native, lv_userid, TRUE);
lv_result := sys.dbms_sys_sql.execute(lv_cursor);
sys.dbms_sys_sql.close_cursor(lv_cursor);
  EXCEPTION
WHEN OTHERS THEN
 DBMS_OUTPUT.PUT_LINE('Failed to execute the specified statement for user: '||p_user);
 DBMS_OUTPUT.PUT_LINE(SUBSTR(SQLERRM, 1, 100));
  END;

BEGIN
  run_sql_as('MYUSER','DROP DATABASE LINK DBL_ZZZ');
  lv_stmt := 'CREATE DATABASE LINK "DBL_ZZZ"
   CONNECT TO "XXXUSER" IDENTIFIED BY VALUES ''0581EB2B81E82590B67687F1E6852E21C6BB0FFF991398A158''
   USING ''(DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = host1.b2w)(PORT = 1522))
  (ADDRESS = (PROTOCOL = TCP)(HOST = host2.b2w)(PORT = 1522))
  (ADDRESS = (PROTOCOL = TCP)(HOST = host3.b2w)(PORT = 1522))
  (ADDRESS = (PROTOCOL = TCP)(HOST = host4.b2w)(PORT = 1522))
  (LOAD_BALANCE = yes)
  (CONNECT_DATA =
   (SERVER = DEDICATED)
   (SERVICE_NAME = MYDB)
   (FAILOVER_MODE =
    (TYPE = SELECT)
    (METHOD = BASIC)
    (RETRIES = 180)
    (DELAY = 5)
   )
  )
 )''';
  run_sql_as('MYUSER',lv_stmt);
END;
/



Best Regards,
Paulo Portugal

Thursday, June 6, 2013

Find and Compress OSW files quickly

I want to find and compress OSW files from time that my instance crashed:

INSTANCE_NAME     STATUS       TO_CHAR(STARTUP_TIM
---------------- ------------ -------------------
INST3     OPEN          06-06-2013 01:42:43
INST2     OPEN          03-05-2013 15:16:42
INST1     OPEN          03-05-2013 15:16:20
INST4     OPEN          06-06-2013 01:47:37


So you need to generate OSW analyze report using files from 00am to 2am.

Find and zip files:
find . -name "*13.06.06.0[0-2]00*" -exec zip /tmp/osw_`hostname`_06_Jun.zip {} \;

Use oswbb.jar to generate analyze report. Start osw Tool with command similar below:

export JAVA_HOME=/usr/java/jre1.7.0_21
/usr/java/jre1.7.0_21/bin/java -jar oswbba.jar -i /tmp/tmp/archive_new


Best Regards,
Paulo Portugal

Tuesday, June 4, 2013

Root.sh second rac node DG_GRID creation failed with the following message: ORA-15018: diskgroup cannot be created ORA-15031: disk specification '/dev/rhdisk37' matches no disks ORA-15025: could not open disk "/dev/rhdisk37" ORA-27041: unable to open file

If you run root.sh on second node while installing grid infrastructure 11g and got this error below:



Disk Group DG_GRID creation failed with the following message:
ORA-15018: diskgroup cannot be created
ORA-15031: disk specification '/dev/rhdisk37' matches no disks
ORA-15025: could not open disk "/dev/rhdisk37"
ORA-27041: unable to open file


Check if you can see all the same disks on both nodes using this command below:

--Run on both nodes
kfod asm_diskstring='/dev/rhdisk37*' disks=all

--To check all disks on run on both nodes
kfod asm_diskstring='/dev/rhdisk*' disks=all

If you cannot see, ask Storage Administrator to see why disk is not there and they must fix it before you run root.sh on second node again.

Best Regards,
Paulo Portugal

ORA-16057 DGID from server not in Data Guard configuration

If you got his error below in v$archive_dest_status:

ORA-16057 DGID from server not in Data Guard configuration

Check your log_archive_config parameter on both primary and standby database and make sure that all db_unique_name from both primary and standby are on this parameter in both primary and standby database.


After changing this parameter, defer and enable your log_archive_dest_state_x parameter and make a new "alter system log switch or alter system archive log current"  and finally check v$archive_dest_status view again.

Best Regards,
Paulo Portugal

Monday, June 3, 2013

Creating Listener using NETCA with RAC : TNS-04605 Invalid Syntax Error Literal "(" before or at ( PORT

If you got error below when trying to create a listener using netca:

TNS-04605 Invalid Syntax Error Literal "(" before or at ( PORT

Check your tnsnames.ora file. Something is wrong there. Move it to OLD and try to create listener again.

Best Regards,
Paulo Portugal

Tuesday, March 12, 2013

How to check SERIAL number of Exadata Hardware

You can check SERIAL NUMBER of your hardware using this simple command below:

cd /opt/oracle.cellos
./CheckHWnFWProfile -S

Best Regards,
Paulo Portugal

Cannot login with celladmin on Exadata Storag Servers (CELLS)

Login as root and reset failed login attempt for celladmin user using this command below and try again:

/sbin/pam_tally2 --reset=0 -u celladmin

Best Regards,
Paulo Portugal

Tuesday, March 5, 2013

How to check Bundle Patch applies to Exadata Database

Query below can be used to check in which Bundle Patch (BP)  your Exadatabase Database is running.

#######################################################################
select substr(action_time,1,30) action_time,
  substr(id,1,10) id,
  substr(action,1,10) action,
  substr(version,1,8) version,
  substr(BUNDLE_SERIES,1,6) bundle,
  substr(comments,1,20) comments
from registry$history;

ACTION_TIME                     ID                                       ACTION     VERSION    BUNDLE                         COMMENTS
------------------------------- ---------------------------------------- ---------- ---------- ------------------------------ --------------------
26-DEC-12 04.04.43.992511 PM    0                                        APPLY      11.2.0.3   PSU                            Patchset 11.2.0.2.0
31-JAN-13 10.06.31.615873 PM    14                                       APPLY      11.2.0.3   EXA                            BP14
#######################################################################

Best Regards,
Paulo Portugal

Change the date/time in all Exadara servers using dcli


This command below will change the data of all database nodes listed in files dbs_group. The date format used is MMDDHHMIYYYY

dcli -g /home/oracle/dbs_group -l root date  022511522013

Best Regards,
Paulo Portugal

Get EM Cloud 12c plugin status using emcli

emcli get_plugin_deployment_status -plugin_id=oracle.sysman.xa


Best Regards,
Paulo Portugal

New agentca for EM Grid Control 12c

In old Grid Control 10g, to force a reconfiguration of all targets for an agent we used "agentca -f" command.

For Cloud Control 12c we now use this command below:

/u01/app/oracle/product/12.1.0/agent_1/core/12.1.0.2.0/oui/bin/runConfig.sh ORACLE_HOME=/u01/app/oracle/product/12.1.0/agent_1/core/12.1.0.2.0 ACTION=Configure MODE=Perform


Best Regards,
Paulo Portugal

How to find files and zip using dcli on Exadata:


This command below will find files of date Jan 13 2008 and zip all to /tmp/osw.zip in all databse nodes os exadata that are listed in file dbs_group.

dcli -l root -g dbs_group 'cd /opt/oracle.oswatcher/osw/archive; find . -name "*13.01.28*" -exec zip /tmp/osw.zip {} \;'

Best Regards,
Paulo Portugal

EXPDP/IMPDP show error ORA-39006 and ORA-39213: Metadata processing is not available

When trying to expdp or impdp you got error below:

#################################################################################################
Export: Release 11.2.0.3.0 - Production on Tue Mar 5 11:57:03 2013

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

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
ORA-39006: internal error
ORA-39213: Metadata processing is not available
#################################################################################################

Run the procedure below to fix the problem:

sqlplus / as sysdba

SQL> execute sys.dbms_metadata_util.load_stylesheets;


Best Regards,
Paulo Portugal