Showing posts with label oracle patch. Show all posts
Showing posts with label oracle patch. Show all posts

Tuesday, December 13, 2011

upgrade Oracle 10g to 11g using DBUA


Prerequistics

1) oracle 10g version should be above or equal to 10.2.0.4. if not please upgrade it to 10.2.0.4


SQL> select banner from v$version;


2) timezone should be >=4

SELECT CASE COUNT(DISTINCT(tzname))
WHEN 183 then 1
WHEN 355 then 1
WHEN 347 then 1
WHEN 377 then 2
WHEN 186 then case COUNT(tzname) WHEN 636 then 2 WHEN 626 then 3 ELSE 0 end
WHEN 185 then 3
WHEN 386 then 3
WHEN 387 then case COUNT(tzname) WHEN 1438 then 3 ELSE 0 end
WHEN 391 then case COUNT(tzname) WHEN 1457 then 4 ELSE 0 end
WHEN 392 then case COUNT(tzname) WHEN 1458 then 4 ELSE 0 end
WHEN 188 then case COUNT(tzname) WHEN 637 then 4 ELSE 0 end
WHEN 189 then case COUNT(tzname) WHEN 638 then 4 ELSE 0 end
ELSE 0 end VERSION
FROM v$timezone_names;


3) Stop all batch jobs

4) Ensure no files need media recovery

sqlplus "/ as sysdba"
SQL> SELECT * FROM v$recover_file;
This should return no rows.

5) Ensure no files are in backup mode:
SQL> SELECT * FROM v$backup WHERE status!='NOT ACTIVE';
This should return no rows.

6) Resolve any outstanding unresolved distributed transaction:
SQL> select * from dba_2pc_pending;

7) Ensure the users sys and system have 'system' as their default tablespace.
SQL> SELECT username, default_tablespace FROM dba_users WHERE username in ('SYS','SYSTEM');


8) Ensure that the aud$ is in the system tablespace when auditing is enabled.
SQL> SELECT tablespace_name FROM dba_tables WHERE table_name='AUD$';


09) Empty Recyclebin before start upgradation

sqlplus "/ as sysdba"

PURGE DBA_RECYCLEBIN;

select * from recyclebin;

10) Gathers dictionary and schema statistics

sqlplus "/ as sysdba"

EXEC DBMS_STATS.GATHER_DICTIONARY_STATS;

EXEC DBMS_STATS.GATHER_SCHEMA_STATS('SYS');

EXEC DBMS_STATS.GATHER_SCHEMA_STATS('SYSMAN');


EXEC DBMS_STATS.GATHER_SCHEMA_STATS('DPCDSL');

11) check invalid objects and resolve

select OWNER,OBJECT_NAME,OBJECT_TYPE from dba_objects where status='INVALID' ORDER BY OWNER;

-----------COMPILE INVALID OBJECTS

spool c:\temp\invalid.sql ;
select OBJECT_NAME from dba_objects where owner='LDBO' AND STATUS='INVALID'

select
'ALTER ' || OBJECT_TYPE || ' ' ||
OWNER || '.' || OBJECT_NAME || ' COMPILE;'
from
dba_objects
where
status = 'INVALID'
and
object_type in ('PACKAGE','FUNCTION','PROCEDURE','VIEW','TRIGGER')
;
spool out ;
@ c:\temp\invalid.sql ;

-----

12) Perform Cold Backup
sql>shutdown immediate
backup physical file folder to safe location in case of disaster


13) Check for adequate freespace on archive log destination file systems. Note that if your database is in archivelog mode, then it is always desirable and advisable to upgrade the database in noarchivelog mode as that will reduce the time taken to upgrade the database. After the upgrade you can again put the database in the archivelog mode.

sqlplus "/ as sysdba"

SQL> SELECT LOG_MODE FROM SYS.V$DATABASE;

SQL> startup mount;

SQL> alter database noarchivelog;


SQL> alter database open;


14)
Install oracle 11g software without using create database also without upgrade option

15)

Oracle Database 11.1 Pre-Upgrade Information Tool for checking any error

Copy file : utlu112i.sql to C:\temp (any temporary location) from “D:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\utlu112i.sql” .

Connected into Oracle 10g instance while DB is up and running and execute the utlu112i.sql file from SQL prompt.

sqlplus "/ as sysdba"

SQL10g> @C:\temp\utlu112i.sql


SQL10g>select * from registry$sys_inv_objs;


SQL10g>select * from registry$nonsys_inv_objs;


resolve all errors

16)

Final) Now lets perform the Database upgrade steps using : Database Upgrade Assistant(DBUA) a GUI to upgrade the DB and it can be found under Start -) All Programs -) Oracle 11g Home -) Configuration and Migration Tool -) Database Upgrade Assistant


17) Version Validation

SQL11g>select comp_name,version,status from dba_registry;

SELECT * FROM dba_registry_log;

SELECT * FROM sys.registry$error;
SQL11g>select banner from v$version;

18) repeat Oracle Database 11.2 Pre-Upgrade Information Tool until all error resolved

SQL11g>sqlplus "/ as sysdba"

SQL11g> @C:\temp\utlu112i.sql


19) Use utluiobj.sql after the upgrade to identify any new invalid

Oracle Database 11.1 Post-Upgrade Invalid Objects Tool

This tool lists post-upgrade invalid objects that were not invalid prior to upgrade (it ignores pre-existing pre-upgrade invalid objects).


SQL11g>@D:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\utluiobj.sql


---------------------
SQL11g> @D:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\utluiobj.sql
.
Oracle Database 11.1 Post-Upgrade Invalid Objects Tool 12-06-2011 11:38:59
.
This tool lists post-upgrade invalid objects that were not invalid
prior to upgrade (it ignores pre-existing pre-upgrade invalid objects).
.
Owner Object Name Object Type
.

PL/SQL procedure successfully completed.

--------------------------

20) result of upgrade

@D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utlu102s.sql

21) if owr is not installed and if require then instal manually

to install oracle workspace manager

select username from dba_users where username ='WMSYS';

ALTER USER WMSYS IDENTIFIED BY WMSYS ACCOUNT UNLOCK;

@D:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\owminst.plb

select comp_name,version,status from dba_registry;

@D:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\utlu112s.sql


Friday, March 18, 2011

Which file include platform info about oracle server setup

\database\stage\prereq\prerequisite.properties

Thursday, March 17, 2011

some instances on 10.2.0.1 and some on 10.2.0.3 on different servers. We have to create database for all instances on one server

Scenario
some instances on 10.2.0.1 and some on 10.2.0.3 on different servers. We have to create database for all instances on one server


Install 10.2.0.1
Apply patch set 10.2.0.3

Before you apply the patchset you have to check whether the Oracle Version is 32 bit or 64 bit Version, because
the patchsets are different.


SQL> SHUTDOWN IMMEDIATE.
Stop all the Oracle Related Services.
Ex:- Oracle Listener, Oracle DB Console,Oracle JobScheduler,
Distrubed Transaction Co-ordinator.
Run the Patch Setup.exe in the same Oracle Home.

------------------------startup upgrade for all instances------------
SQL> CONNECT SYS/oracle@ari0809srv AS SYSDBA

STARTUP UPGRADE
SPOOL c:\patch.log
@D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catupgrd.sql
SQL> SPOOL OFF

SHUTDOWN IMMEDIATE
STARTUP
------------------------

@D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utlip.sql
@D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utlrp.sql



mkdir D:\oracle\product\10.2.0\admin\ari0405\adump
mkdir D:\oracle\product\10.2.0\admin\ari0405\bdump
mkdir D:\oracle\product\10.2.0\admin\ari0405\cdump
mkdir D:\oracle\product\10.2.0\admin\ari0405\dpdump
mkdir D:\oracle\product\10.2.0\admin\ari0405\pfile
mkdir D:\oracle\product\10.2.0\admin\ari0405\udump


mkdir D:\oracle\product\10.2.0\admin\ari0506\adump
mkdir D:\oracle\product\10.2.0\admin\ari0506\bdump
mkdir D:\oracle\product\10.2.0\admin\ari0506\cdump
mkdir D:\oracle\product\10.2.0\admin\ari0506\dpdump
mkdir D:\oracle\product\10.2.0\admin\ari0506\pfile
mkdir D:\oracle\product\10.2.0\admin\ari0506\udump


mkdir D:\oracle\product\10.2.0\admin\ari0607\adump
mkdir D:\oracle\product\10.2.0\admin\ari0607\bdump
mkdir D:\oracle\product\10.2.0\admin\ari0607\cdump
mkdir D:\oracle\product\10.2.0\admin\ari0607\dpdump
mkdir D:\oracle\product\10.2.0\admin\ari0607\pfile
mkdir D:\oracle\product\10.2.0\admin\ari0607\udump

mkdir D:\oracle\product\10.2.0\admin\ari0708\adump
mkdir D:\oracle\product\10.2.0\admin\ari0708\bdump
mkdir D:\oracle\product\10.2.0\admin\ari0708\cdump
mkdir D:\oracle\product\10.2.0\admin\ari0708\dpdump
mkdir D:\oracle\product\10.2.0\admin\ari0708\pfile
mkdir D:\oracle\product\10.2.0\admin\ari0708\udump

mkdir D:\oracle\product\10.2.0\admin\ari0809\adump
mkdir D:\oracle\product\10.2.0\admin\ari0809\bdump
mkdir D:\oracle\product\10.2.0\admin\ari0809\cdump
mkdir D:\oracle\product\10.2.0\admin\ari0809\dpdump
mkdir D:\oracle\product\10.2.0\admin\ari0809\pfile
mkdir D:\oracle\product\10.2.0\admin\ari0809\udump


mkdir D:\oracle\product\10.2.0\admin\ari0910\adump
mkdir D:\oracle\product\10.2.0\admin\ari0910\bdump
mkdir D:\oracle\product\10.2.0\admin\ari0910\cdump
mkdir D:\oracle\product\10.2.0\admin\ari0910\dpdump
mkdir D:\oracle\product\10.2.0\admin\ari0910\pfile
mkdir D:\oracle\product\10.2.0\admin\ari0910\udump


copy paste init files to database folder and tnsnames, listener to network admin folder


set ORACLE_SID=ari2

oradim -new -sid ari2 -SRVC OracleServiceari2 -intpwd oracle -MAXUSERS 5 -STARTMODE auto -PFILE D:\oracle\product\10.2.0\db_1\database\initari2.ORA

set ORACLE_SID=ari3

oradim -new -sid ari3 -SRVC OracleServiceari3 -intpwd oracle -MAXUSERS 5 -STARTMODE auto -PFILE D:\oracle\product\10.2.0\db_1\database\initari3.ORA


set ORACLE_SID=ari4
oradim -new -sid ari4 -SRVC OracleServiceari4 -intpwd oracle -MAXUSERS 5 -STARTMODE auto -PFILE D:\oracle\product\10.2.0\db_1\database\initari4.ORA


set ORACLE_SID=ari5
oradim -new -sid ari5 -SRVC OracleServiceari5 -intpwd oracle -MAXUSERS 5 -STARTMODE auto -PFILE D:\oracle\product\10.2.0\db_1\database\initari5.ORA


set ORACLE_SID=ari6
oradim -new -sid ari6 -SRVC OracleServiceari6 -intpwd oracle -MAXUSERS 5 -STARTMODE auto -PFILE D:\oracle\product\10.2.0\db_1\database\initari6.ORA


set ORACLE_SID=ari7
oradim -new -sid ari7 -SRVC OracleServiceari7 -intpwd oracle -MAXUSERS 5 -STARTMODE auto -PFILE D:\oracle\product\10.2.0\db_1\database\initari7.ORA



sqlplusw sys/oracle@ari0405srv as sysdba
startup pfile='D:\oracle\product\10.2.0\db_1\database\initari2.ora';
create spfile from pfile;
shut immediate
startup

sqlplusw ldbo/ldbo@ari0405srv as sysdba




sqlplusw sys/oracle@ari0506srv as sysdba
startup pfile='D:\oracle\product\10.2.0\db_1\database\initari3.ora';
create spfile from pfile;
shut immediate
startup

sqlplusw ldbo/ldbo@ari0506srv as sysdba



sqlplusw sys/oracle@ari0607srv as sysdba
startup pfile='D:\oracle\product\10.2.0\db_1\database\initari4.ora';
create spfile from pfile;
shut immediate
startup

sqlplusw ldbo/ldbo@ari0607srv as sysdba



sqlplusw sys/oracle@ari0708srv as sysdba
startup pfile='D:\oracle\product\10.2.0\db_1\database\initari5.ora';
create spfile from pfile;
shut immediate
startup


sqlplusw ldbo/ldbo@ari0708srv as sysdba



sqlplusw sys/oracle@ari0809srv as sysdba
startup pfile='D:\oracle\product\10.2.0\db_1\database\initari6.ora';
create spfile from pfile;
shut immediate
startup


sqlplusw sys/oracle@ari0910srv as sysdba
startup pfile='D:\oracle\product\10.2.0\db_1\database\initari7.ora';
create spfile from pfile;
shut immediate
startup

Tuesday, March 15, 2011

Patch

Apply patch

Before you apply the patchset you have to check whether the Oracle Version is 32 bit or 64 bit Version, because
the patchsets are different.
For 32 Bit Version, Patch no is p6810189_10204_Win32_patchset
For 64 Bit Version, Patch no is p6810189_10204_MSWIN-x86-64.

1. Shut down the database:
SQL> SHUTDOWN IMMEDIATE.
Stop all the Oracle Related Services.
Ex:- Oracle Listener, Oracle DB Console,Oracle JobScheduler,
Distrubed Transaction Co-ordinator.
Run the Patch Setup.exe in the same Oracle Home.
For Example: If Existing Oracle is installed in c:\Oracle\product\10.2.0\db_1 then you
have to select the same path When you run the Setup.exe. After Successful installation
start the Listener & Db Console etc.,
Enter the following SQL*Plus commands:
SQL> SET ORACLE_SID=sns6
SQL> SQLPLUS/NOLOG
SQL> CONNECT SYS/LINUX@sns1011SRV AS SYSDBA
SQL> STARTUP UPGRADE
SQL> SPOOL patch.log
SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\catupgrd.sql
SQL> SPOOL OFF

@D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utlu102s.sql TO DISPLAY RESULT OF UPGRADE

Review the patch.log file for errors and inspect the list of components that is displayed at the end of
catupgrd.sql script.
This list provides the version and status of each SERVER component in the database.
If necessary, rerun the catupgrd.sql script after correcting any problems.


SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP

Run the utlrp.sql script to recompile all invalid PL/SQL packages now instead of when the packages are
accessed for the first time. This step is optional but recommended.

SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\utlip.sql
SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\utlirp.sql
SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\utlrp.sql




result of upgrade

@D:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\utlu102s.sql

if owr is not installed and if require then instal manually

to install oracle workspace manager

select username from dba_users where username ='WMSYS';

ALTER USER WMSYS IDENTIFIED BY WMSYS ACCOUNT UNLOCK;

@%oracle_home%\RDBMS\ADMIN\owminst.plb

select comp_name,version,status from dba_registry;

Wednesday, March 9, 2011

Why 10.2.0.4 patch set?

bugs fixed in this patch set:

Higher CPU / Higher "cache buffer chains" latch gets / Higher "consistent gets" after truncate/Rebuild.

SYSTEM RESET of an spfile parameter can corrupt the SPFILE
/*append parallel*/ can corrupt an index

deadlock hang on "cursor: pin S wait on X" (typically from DBMS_STATS)
Wrong results with bind variables/CURSOR_SHARING

5079978 High US enqueue contention in RAC
5387030 Automatic tuning of undo_retention causes unusual extra space allocation
5439554 "buffer busy wait" timeouts with automatic undo management and in memory undo
5442919 Expired extents not being reused (ORA-30036)
5512921 Instance crash caused by SMON OERI[kcblus_1] / dump

----------------------

Monday, February 8, 2010

Oracle Patch 10.20.3 to 10.2.0.4

Oracle Patch 10.20.3 to 10.2.0.4

How to Apply the Patchset ?

Before you apply the patchset you have to check whether the Oracle Version is 32 bit or 64 bit Version, because the patchsets are different.

For 32 Bit Version, Patch no is p6810189_10204_Win32_patchset

For 64 Bit Version, Patch no is p6810189_10204_MSWIN-x86-64.

1. Shut down the database:

SQL>SHUTDOWN IMMEDIATE.

Stop all the Oracle Related Services.

Ex:- Oracle Listener, Oracle DB Console,Oracle JobScheduler, Distrubed Transaction Co-ordinator.

Run the Patch Setup.exe in the same Oracle Home.

For Example: If Existing Oracle is installed in c:\Oracle\product\10.2.0\db_1 then you have to select the same path When you run the Setup.exe. After Successful installation start the Listener & Db Console etc.,

Enter the following SQL*Plus Commands:

SQL> SET ORACLE_SID=sns5

SQL> SQLPLUS/NOLOG

SQL> CONNECT SYS/ORACLE@sns0910SRV AS SYSDBA

SQL> STARTUP UPGRADE SQL> SPOOL patch.log

SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\catupgrd.sql

SQL> SPOOL OFF

Review the patch.log file for errors and inspect the list of components that is displayed at the end of catupgrd.sql script.

This list provides the version and status of each SERVER component in the database.

If necessary, rerun the catupgrd.sql script after correcting any problems.

Restart the database:

SQL> SHUTDOWN IMMEDIATE SQL> STARTUP

Run the utlrp.sql script to recompile all invalid PL/SQL packages now instead of when the packages are accessed for the first time. This step is optional but recommended.

SQL> @ORACLE_BASE\ORACLE_HOME\rdbms\admin\utlrp.sql

Followers