Saturday, April 19, 2014

DB upgrade from 11.2.0.2 to 11.2.0.3

DB upgrade from 11.2.0.2 to 11.2.0.3

11.2.0.2 database name : ORCL (to be upgraded to 11.2.0.3)


1.Download the required patchset for 11.2.0.3

below are the 2 patchsets( patchset number :1040450)
p10404530_112030_LINUX_1of7.zip
p10404530_112030_LINUX_2of7.zip

2. I have the existing 11.2.0.2 home at /u01/app/oracle/product/11.2.0/dbhome_1 so i installed the new 11.2.0.3 home to '/extend/app/oracle/product/11.2.0.3/dbhome_2'

3. move the existing init.ora and password file from dbs folder(/u01/app/oracle/product/11.2.0/dbhome_1/dbs) to new dbs location (/extend/app/oracle/product/11.2.0.3/dbhome_2/dbs)

4. login to existing ORCL database and run the utlu112i.sql script from (/extend/app/oracle/product/11.2.0.3/dbhome_2/rdbms/admin) location
    this would do the pre-upgrade checks

the above script would advise to run gather_dictionary_stats script
EXECUTE dbms_stats.gather_dictionary_stats;

5. set the new HOME,PATH variables to new 11.2.0.3 values

[oracle@goldengate admin]$ echo $ORACLE_HOME
/extend/app/oracle/product/11.2.0.3/dbhome_2
[oracle@goldengate admin]$ echo $PATH
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/oracle/bin:/extend/app/oracle/product/11.2.0.3/dbhome_2/bin
[oracle@goldengate admin]$ echo $LD_LIBRARY_PATH
/extend/app/oracle/product/11.2.0.3/dbhome_2/lib:/etc/alternatives/jdk1.6.0_27/jre/lib/i386/server

6. export ORACLE_SID=ORCL  and start in upgrade mode

oracle@goldengate:/extend/app/oracle/product/11.2.0.3/dbhome_2/rdbms/admin[oracle@goldengate admin]$ echo $ORACLE_SID
orcl
oracle@goldengate:/extend/app/oracle/product/11.2.0.3/dbhome_2/rdbms/admin[oracle@goldengate admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 18 08:41:26 2014

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

Connected to an idle instance.

SQL> startup upgrade
ORACLE instance started.

Total System Global Area  422670336 bytes
Fixed Size    1345380 bytes
Variable Size  369100956 bytes
Database Buffers   46137344 bytes
Redo Buffers    6086656 bytes
Database mounted.
Database opened.

7. run the catupgrade script

SQL> spool /tmp/upgrade.log
SQL> @/extend/app/oracle/product/11.2.0.3/dbhome_2/rdbms/admin/catupgrd.sql

 would take around 20-30 mins

8. After upgrade complete start the database in normal mode and run the utlu112s.sql (/extend/app/oracle/product/11.2.0.3/dbhome_2/utlu112s.sql) script.

9.Run utlrp.sql to recompile the invalid objects

10. Done... database has been upgraded to 11.2.0.3

[oracle@goldengate admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 18 11:55:39 2014

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
ORCL      READ WRITE           PRIMARY

SQL> select * from v$version
  2  ;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
PL/SQL Release 11.2.0.3.0 - Production
CORE    11.2.0.3.0      Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production

=========================

Issues faced --after upgrading to 11.2.0.3 my alert log was showing the below error messages
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_76957/orcl_ora_13359_i76957.trc:
ORA-00308: cannot open archived log '/u01/app/oracle/fast_recovery_area/ORCL/archivelog/2014_04_17/o1_mf_1_186_9nzglgqk_.arc'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
ORA-07445: exception encountered: core dump [pevm_icd_call_common()+638] [SIGSEGV] [ADDR:0x74] [PC:0x100632AA] [Address not mapped to object] []
ORA-04067: not executed, package body "GGUSER.DDLREPLICATION" does not exist
ORA-06508: PL/SQL: could not find program unit being called: "GGUSER.DDLREPLICATION"
ORA-04067: not executed, package body "GGUSER.DDLREPLICATION" does not exist
ORA-06508: PL/SQL: could not find program unit being called: "GGUSER.DDLREPLICATION"


Solution : disable the trigger 'alter trigger sys.GGS_DDL_TRIGGER_BEFORE disable'



 

Sunday, March 23, 2014

Goldengate upgrade from 11.1 to 12.1

*** Goldengate upgrade from 11.1 to 12.1
*** create directory gguser1_11.2
*** unzip the 12.1 GG software to directory gguser1_11.2

[oracle@goldengate GG112]$ unzip V32409-01.zip -d /home/oracle/gguser1_11.2/
Archive:  V32409-01.zip
  inflating: /home/oracle/gguser1_11.2/fbo_ggs_Linux_x86_ora11g_32bit.tar
  inflating: /home/oracle/gguser1_11.2/OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf
  inflating: /home/oracle/gguser1_11.2/Oracle GoldenGate 11.2.1.0.1 README.txt
  inflating: /home/oracle/gguser1_11.2/Oracle GoldenGate 11.2.1.0.1 README.doc
[oracle@goldengate GG112]$ pwd
/GG112
**** extract the tar file in the gguser1_11.2 directory
[oracle@goldengate gguser1_11.2]$ ls -ltr
total 205004
-rw-rw-r-- 1 oracle oinstall 209367040 Apr 24  2012 fbo_ggs_Linux_x86_ora11g_32bit.tar
-rwxrwxrwx 1 oracle oinstall    220546 May  2  2012 OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf
-rwxrwxrwx 1 oracle oinstall     93696 May  2  2012 Oracle GoldenGate 11.2.1.0.1 README.doc
-rwxrwxrwx 1 oracle oinstall     24390 May  2  2012 Oracle GoldenGate 11.2.1.0.1 README.txt
[oracle@goldengate gguser1_11.2]$ tar -xvf fbo_ggs_Linux_x86_ora11g_32bit.tar

**** copy the gguser1_11.2 content to gguser1 directory
**** mark the 11.2 version upon login to GG
[oracle@goldengate gguser1_11.2]$ pwd
/home/oracle/gguser1_11.2
[oracle@goldengate gguser1_11.2]$ cp -fR * /home/oracle/gguser1/
[oracle@goldengate gguser1_11.2]$ cd ../gguser1
[oracle@goldengate gguser1]$ ./ggsci

2014-03-21 00:43:42  WARNING OGG-00254  enablemonitoragent is a deprecated parameter.

Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x86, 32bit (optimized), Oracle 11g on Apr 23 2012 08:09:25

Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.

GGSCI (goldengate) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     STOPPED
JAGENT      STOPPED
EXTRACT     STOPPED     EORA01      00:00:00      00:12:26
EXTRACT     STOPPED     EPMP01      00:00:00      00:12:11
REPLICAT    ABENDED     RORA02      00:00:00      9448:06:02

**** upgrade the checkpoint table

GGSCI (goldengate) 2> dblogin userid gguser,password oracle
Successfully logged into database.

GGSCI (goldengate) 3> upgrade checkpointtable gguser.GGS_CHECKPOINT

Successfully upgraded checkpoint table gguser.GGS_CHECKPOINT.

***** alter extract and start it

GGSCI (goldengate) 5> alter extract EORA01 etrollover

2014-03-21 00:55:47  INFO    OGG-01520  Rollover performed.  For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file;  it will not happen automatically.
EXTRACT altered.

GGSCI (goldengate) 2> start MANAGER

Manager started.


GGSCI (goldengate) 4> start EXTRACT EORA01

Sending START request to MANAGER ...
EXTRACT EORA01 starting

GGSCI (goldengate) 5> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
JAGENT      STOPPED
EXTRACT     RUNNING     EORA01      00:00:00      00:00:06
EXTRACT     STOPPED     EPMP01      00:00:00      00:27:46
REPLICAT    ABENDED     RORA02      00:00:00      9448:21:38

**** start pump extract process

GGSCI (goldengate) 13> alter extract EPMP01 etrollover

2014-03-21 05:05:29  INFO    OGG-01520  Rollover performed.  For each affected output trail of Version 10 or higher format, after starting the source extract, issue ALTER EXTSEQNO for that trail's reader (either pump EXTRACT or REPLICAT) to move the reader's scan to the new trail file;  it will not happen automatically.
EXTRACT altered.


GGSCI (goldengate) 14> alter extract EPMP01 extseqno 9
EXTRACT altered.


GGSCI (goldengate) 15>  start extract EPMP01

Sending START request to MANAGER ...
EXTRACT EPMP01 starting

**** here extract pump faced an error
****ERROR   OGG-01028  Oracle GoldenGate Capture for Oracle, epmp01.prm:  Incompatible record (101) in ./dirdat/E1000009, rba 1199 (getting header)

**** refer to "How to recover from an OGG-01028 Incompatible Record if the trail is not corrupt (Doc ID 1507462.1)"

GGSCI (goldengate) 4> alter extract EPMP01 , extseqno 9 , extrba 1013
EXTRACT altered.


GGSCI (goldengate) 5> start extract EPMP01

Sending START request to MANAGER ...
EXTRACT EPMP01 starting

**** start replicat

GGSCI (goldengate) 6> alter replicat RORA01 extseqno 6
REPLICAT altered.


GGSCI (goldengate) 7> start replicat RORA01

Sending START request to MANAGER ...
REPLICAT RORA01 starting

**** Replicat failed with error "ERROR   OGG-01028  Oracle GoldenGate Delivery for Oracle, rora01.prm:  Incompatible record (101) in ./dirdat/P1000006, rba 1565 (getting header)"

GGSCI (goldengate) 5> alter replicat RORA01 , extseqno 6 , extrba 1058
REPLICAT altered.


GGSCI (goldengate) 6> start replicat RORA01

Sending START request to MANAGER ...
REPLICAT RORA01 starting