oracle 10 g upgrade

Upload: vishwa-singh

Post on 14-Apr-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 Oracle 10 g Upgrade

    1/12

    M o n d a y , j u l y 1 3 , 2 0 0 9

    ORACLE 9I TO 10G oracle upgrade from 9i to 10g (unix platform)

    Hi all,

    here is the procedure to upgrade the oracle 9i to 10g (9.2.0.6 to 10.2.0.4) ...

    Some notes you might need in between:

    1) note 841728 - 10.2: solutions for installation and upgrade problems

    2) note 819830 - oracle database 10g: additional information on upgrade:unix

    3) note 886783 - installing oracle 9207 client software on unix

    4) note 600141 - oracle9i: automatic undo management

    5) note 819829 - oracle instant client installation and configuration on unix

    6) note 830577 - oracle database 10g: ora-21700 when upgrading to 10.1/10.2

    7) note 871735 - current patch set for oracle 10.2.0

    prerequisites for unix system :

    1. Checking the correct unix users, groups, and authorizations:

    enter the following commands with user orasid:

    touch /oracle/write_test

    rm /oracle/write_test

    umask 022

    2) checking the directory structure

    create the staging directory /oracle/stage/102_64.

    Extract or110264.sar from cd 51031670 to /oracle/stage/102_64

    now perform the following:

    cd /oracle/stage/102_64/database or

    cd /oracle/stage/102_64/database/disk1

    mv sap sap_orig

    3) download rdbms_sap_64.zip from note #819830 and copy it over to the

    /oracle/stage /102_64/database directory

    4) extract the zip file:

    cd /oracle/stage/102_64/database or

    cd /oracle/stage/102_64/database/disk1

    http://gagankaushal.blogspot.in/2009/07/oracle-upgrade-from-9i-to-10g-unix.htmlhttp://gagankaushal.blogspot.in/2009/07/oracle-upgrade-from-9i-to-10g-unix.htmlhttp://gagankaushal.blogspot.in/2009/07/oracle-upgrade-from-9i-to-10g-unix.html
  • 7/29/2019 Oracle 10 g Upgrade

    2/12

    unzip rdbms_sap_64.zip (you should now see the directory sap extracted which

    contains the updated version of sap-specific files)

    5) check the oracle inventory directory /var/opt/oracle/orainst.loc

    the default location for the oracle inventory is $oracle_base/orainventory

    6) create the empty oracle home directory before starting the oui.

    /oracle//102_64

    7) running the pre-upgrade script

    execute the following commands:

    sqlplus /nolog

    sql> connect / as sysdba

    sql> spool /tmp/pre_upgrade.log

    sql> @/oracle/stage/102_64/database/disk1/sap/utlu102i.sql

    sql> spool off

    sql> exit

    (you can check the results of the pre-upgrade script by looking at the log file /tmp/pre_upgrade.log.)

    8) checking the prerequisites for the oracle universal installer

    log in as the oracle user ora.

    Execute the following commands:

    cd /oracle/stage/102_64/database/disk1

    ./runinstallerexecutesysprereqs

    (if the oui complains that the operating system version is not certified or

    supported, you can ignore this.if oui reports missing os patches, you need to

    apply these before you can continue. )

    9) download the latest version of the oracle client software ocl1020464.sar

    before you start installing / extracting the oracle client software please

    shutdown the sap application running on that host.updating the oracle client

    software online (when the sap system is still running) is not supported and may

    result in system errors/inconsistencies.

    Now do the following:

    mv /oracle/client/10x_64 /oracle/client/10x_64_orig

    mkdir /oracle/client/10x_64

  • 7/29/2019 Oracle 10 g Upgrade

    3/12

    important!! Go up to this directory, cd /oracle/client/10x_64

    sapcar -xvf /tmp/ocl1020464.sar

    (refer note # 886783)

    10) execute the sql script sapconn_role.sql as follows:

    cp /oracle/stage/102_64/database/disk1/sap/sapconn_role.sql $oracle_home/dbs

    cd $oracle_home/dbs

    sqlplus /nolog @sapconn_role

    11) 9. Migrating to automatic undo management

    read sap note 600141,

    12) 10. Stopping statspack reports (if running)

    log on as the user under which the statspack jobs run (usually perfstat):

    sql> connect perfstat/

    sql> select job, what from user_jobs;

    this displays a list of the jobs that are currently entered under the user perfstat.

    Delete all jobs with the print job number :

    sql> connect perfstat/

    sql> execute dbms_job.remove( );

    13)checking the system and sysaux tablespace for free space

    make sure that the system and sysaux tablespaces have at least between 500 mb and 750 mb freespace.

    (if your source database is oracle 9.2, there is no sysaux tablespace. In this case you can ignore references to the sysaux

    tablespace in this section. )

    check space by:

    brspacef dbshowc tsinfos system

    brspacef dbshowc tsinfos sysaux

    if the size is less then 750 mb of freespace extend the tablespace.

    14) checking for invalid database objects

    a). Execute the following commands:

    sql> spool invalid_objects

    sql> select unique object_name, object_type, owner from dba_objects where status ='invalid';

  • 7/29/2019 Oracle 10 g Upgrade

    4/12

    sql> @?/rdbms/admin/utlrp.sql

    sql> select unique object_name, object_type, owner from dba_objects where status ='invalid';

    sql> spool off

    a) list of invalid objects before the upgrade is now generated.invalid objects before upgrade

    b) check the list of invalid objects after the upgrade.if any objects in the list from before the upgrade are also in the list of invalid

    objects after the upgrade, you can be sure that this is not due to the upgrade process.

    Oracle software installation( started )

    1) set the environment variables below by editing the files .dbenv_.sh and .dbenv_.csh in the home directory of ora.

    (do not make the changes to the environment permanent as long as the old database is still running)

    a). Make sure the following environment variables are not set:

    n two_task

    n ora_nls

    n ora_nls32

    n ora_nls33

    b). Set the following environment variables:

    display :0.0 (it is the host on which the oui will be displayed.)

    Oracle_base /oracle

    oracle_sid

    oracle_home /oracle//102_64

    nls_lang set this to the output of the script checks.sql (/oracle/stage/102_64/database/disk1/sap . The database must be open

    before you execute the script checks.sql. )

    ora_nls10 $oracle_home/nls/data

    sapdata_home /oracle/

    shlib_path $oracle_home/lib:$shlib_path

    c). Include $oracle_home/bin in your path or path variable, replacing the existing variable with the new one:

    set path = ($oracle_home/bin $path)

    check if the temporary directory (usually /tmp) has at least 400 mb of f ree space.

    2) backup the oracle inventory

  • 7/29/2019 Oracle 10 g Upgrade

    5/12

    3)running the oracle universal installer

    start the oui with the user ora as follows:

    cd /oracle/stage/102_64/database/disk1/sap

    ./runinstaller

    4) on the first screen press next

    5)

    6) after this press next next and you will see this screen

    http://4.bp.blogspot.com/_-mCNSSQ9kxY/Sl3VUVavp2I/AAAAAAAAAXc/7OV598HdcXI/s1600-h/2.JPGhttp://3.bp.blogspot.com/_-mCNSSQ9kxY/Sl3U5ZV2s7I/AAAAAAAAAXU/shoGzp0XrDk/s1600-h/1.JPGhttp://4.bp.blogspot.com/_-mCNSSQ9kxY/Sl3VUVavp2I/AAAAAAAAAXc/7OV598HdcXI/s1600-h/2.JPGhttp://3.bp.blogspot.com/_-mCNSSQ9kxY/Sl3U5ZV2s7I/AAAAAAAAAXU/shoGzp0XrDk/s1600-h/1.JPG
  • 7/29/2019 Oracle 10 g Upgrade

    6/12

    7) installing the current patch set

    only have to install the latest (that is, the current) patch set.

    Sap note 871735.

    51036965_4 patch cd.

    Now enter the following command to unzip and extract the installation files:

    $ unzip *.zip

    stop all listeners and other processes running in the oracle home directory, where you need to install the patch set.

    Cd patchset_directory/disk1

    ./runinstaller

    8) specify the detail and continue with installation

    prerequisites for db upgrade

    1. Copying and adapting the sql*net files

    i. Log on as user ora.

    Ii. If ora have environment variable tns_admin set, do the following:

    a) choose a new location for the new sql*net parameter files and set tns_admin to point to the new location .

    B) copy the sql*net parameter files from the old location to

    c) edit the new sql*net files by adapting all file paths for the new directory. Be sure to adapt the value of oracle_home in the

    listener.ora file.

    Iii. If ora has not set the tns_admin environment variable, oracle first searches in /etc, in

    $oracle_home/network/admin for the sql*net parameter files. Choose which of the following applies to your installation:

    http://2.bp.blogspot.com/_-mCNSSQ9kxY/Sl3VqF4-pzI/AAAAAAAAAXk/lIh_RPtBqnI/s1600-h/3.JPG
  • 7/29/2019 Oracle 10 g Upgrade

    7/12

    n the sql*net parameter files are located in directory /etc:

    a) make a backup copy of the files.

    B) edit the new sql*net files by adapting all file paths for the new directory. Be sure to adapt the value of oracle_home in the

    listener.ora file.

    N the sql*net parameter files are located in /network/admin:

    a) copy the sql*net parameter files from to .

    B) edit the new sql*net files by adapting all file paths for the new directory. Be sure to adapt the value of oracle_home in the

    listener.ora file.

    Iv. Since your database is still running in the old environment, do not start the listener with the new

    listener.ora file at this point.

    2) shutting down the sap system and oracle listener process

    stopsap r3

    lsnrctl stop

    database upgrade( started)

    1) checking the oratab entry

    oratab file( /etc )

    a). Make sure that the oratab file contains the following entry:

    ::n

    where old_oracle_home stands for the path to the old oracle software installation.

    B). If this entry does not exist, insert it using a text editor.

    2) starting the database upgrade assistant

    start the oracle database upgrade assistant (dbua).

    Before starting check:

    confirm that the following environment variables point to oracle 10.2 directories:

    oracle_home points to /oracle//102_64

    path

    ora_nls10

    ld_library_path or shlib_path or libpath

    before you start the dbua make sure that the display environment variable is correctly set.

    Now start the dbua:

    cd $oracle_home/bin

  • 7/29/2019 Oracle 10 g Upgrade

    8/12

    ./dbua

    3) after this you should be able to see this

    4) choose the database sid in the database screen. And click on next

    5) check the database assistant information window detail after analysis. If the information

    is regarding the following points, you can ignore and proceed further by clicking yes

    (default is no)

    1. Stale optimizer statistics

    2. Changes to oracle connect role

    3. Information on invalid objects

    6) in the sysaux creation screen apply the following changes

    1. Datafile name and location

    a. Change the data file path and f ile name as

    /oracle/sid/sapdata1/sysaux_1/sysaux.data1

    b. Increase the initial size to 1000mb

    c. Select the autoextend on check box

    d. Increment 100mb

    e. Modify the selection of maximum size value to 2000mb from unlimited

    7) in the recompilation of invalid objects screen

    1. Choose check for the recompilation of invalid objects

    2. Select the check box for disable the archive log during the upgrade.

    http://1.bp.blogspot.com/_-mCNSSQ9kxY/Sl3X3_wmxUI/AAAAAAAAAXs/LxScSubnJq4/s1600-h/4.JPG
  • 7/29/2019 Oracle 10 g Upgrade

    9/12

    3. Click on next to proceed

    8) select the i already backed up my database and choose next

    9) in the management options screen disable the configure the database with

    enterprise manager option

    10) in the management options screen disable the configure the database with

    enterprise manager option

    11) click finish on the summary screen

    12) a. Conversion started by 09:00 pm

    b. Conversion end by 11:07 pm

    c. Total conversion time 2hr (approx)

    post-upgrade steps

    1). Finalizing the environment of the orauser

    make sure that the changes you made to the oracle user environment are permanently stored in the profiles (.cshrc,

    .dbenv_.csh, and so on).

    2) checking the upgraded database

    a) log onto the database as the ora user.

    B) enter the following command to start sqlplus:

    sqlplus / as sysdba

    c) enter the following sql commands:

    a) enter the following command to determine the release of the installed software:

    sql> select version from v$instance;

    b) enter the following command to determine the release and status of the installed database components:

    sql> select comp_id, version, status from dba_registry;

    make sure that the command returns the status valid.

    C) check that the version returned in the previous two commands is identical.

    After the upgrade check that the following document is created:

    $oracle_home/assistants/dbua/doc/help/defaultbehaviorchangesin10g.html

    3) extract the latest br*tools to the kernel directory /sapmnt/sid/exe

  • 7/29/2019 Oracle 10 g Upgrade

    10/12

    (i) cd /sapmnt/sys/exe

    (ii) sapcarxvf dbatl700o10_18-20001045.sar

    4) copy the initsid.sap from /oracle/sid/920_64/dbs directory

    (i) cd $oracle_home/dbs

    (ii) cp /oracle/sid/920_64/dbs/initsid.sap .

    5) update the permissions for the os$ users for br*tools usage

    i) cp /sapmnt/sid/exe/sapdba_role.sql /oracle/sid/102_64/dbs

    ii) cd /oracle/sid/102_64/dbs

    iii) ./sqlplus /nolog @sapdba_role sid

    6) change database compatibility by executing the following sql command as the ora user

    a) login as orasid

    b) sqlplus /nolog

    c) connect / as sysdba

    i) sql> alter system set compatible='10.2.0' scope = spfile;

    d) restart the oracle database.

    I) shutdown immediate

    ii) startup

    7) deactivate the oracle recycle bin by executing the following sql command as the ora user:

    a) sql> purge dba_recyclebin;

    b) sql> alter system set recyclebin = 'off' scope = spfile;

    8) gather oracle optimizer statistics as follows:

    a) execute the following commands as the ora user:

    b) sql> spool $oracle_home/cfgtoollogs/dbstats.log

    c) sql> execute dbms_scheduler.disable('gather_stats_job');

    d) sql> execute dbms_stats.gather_system_stats;

    e) sql> execute dbms_stats.gather_dictionary_stats (estimate_percent => null,

    method_opt => 'for all columns size auto',granularity => 'all',

    cascade => true, options => 'gather', no_invalidate => false);

    f) sql> execute dbms_stats.gather_fixed_objects_stats;

    g) check the log file dbstats.log created at $oracle_home/cfgtoollogs for any errors during the gathering of statistics

  • 7/29/2019 Oracle 10 g Upgrade

    11/12

    9) identify the objects that are invalid after the upgrade as follows:

    a) execute the following commands as the ora user:

    b) sql> @?/rdbms/admin/utlrp.sql;

    c) sql> spool $oracle_home/cfgtoollogs/invalid_post.log

    d) sql> select count(*) from dba_objects where status = 'invalid';

    e) sql> select substr(owner,1,12) owner, substr(object_name,1,30) object, substr(object_type,1,30) type, status from

    dba_objects where status 'valid' order by owner;

    f) sql> spool off;

    g) check the log file to compare the invalid objects before the start of the upgrade to the upgraded system

    10) disable the following oracle parameters

    a) alter system reset commit_write scope = spfile sid=*;

    b) alter system reset cursor_space_for_time scope = spfile sid=*;

    c) alter system reset db_file_multiblock_read_count scope = spfile sid=*;

    d) alter system reset hash_join_enabled scope = spfile sid=*;

    e) alter system reset log_archive_start scope = spfile sid=*;

    f) alter system reset optimizer_index_cost_adj scope = spfile sid=*;

    g) alter system reset optimizer_mode scope = spfile sid=*;

    h) alter system reset statistics_level scope = spfile sid=*;

    i) alter system reset timed_statistics scope = spfile sid=*;

    j) alter system reset trace_enabled scope = spfile sid=*;

    11) restart the database to activate the changes

    a) sqlplus /nolog

    b) connect / as sysdba

    c) shutdown immediate;

    d) startup

    12) gather statistics for sap schema

    a) sqlplus /nolog

    b) sql> connect / as sysdba

    c) sql> @/oracle/stage/102_64/database/sap/upddbstatc10.sql

    13) update the dbcheckora control table after the upgrade as follows:

    a) cd /oracle/stage/102_64/database/sap

    b) sqlplus sap/ @dbcheckora10upgr

  • 7/29/2019 Oracle 10 g Upgrade

    12/12

    14) checking the oratab entry

    a) cd /var/opt/oracle

    b) make sure that there is an entry like the following in your oratab file:

    i) sid:/oracle/c11/102_64:n

    15) start the listener process

    a) login orasid

    b) check the status of the listener process

    (i) lsnrctl staus

    c) if the process is already not running, start the process

    i) to start the listener lsnrctl start

    16) dont rename the old oracle home directory, just rename the /oracle/sid/920_64 directory.

    A) mv /oracle/sid/920_64/bin /oracle/sid/920_64/bin.old

    17) change the following r3 instance parameter to the new oracle home /oracle/sid/102_64.

    A) dir_orahome

    b) dir_client_orahome

    c) dir_server_orahome

    18) install the oracle 9.2.0.7 client software as per the note 886783

    a) login as orasid

    b) cd /oracle/client

    c) mkdir 92x_64

    d) cd 92x_64

    e) sapcarxvf /oracle/stage/920_64/client/ocl92064.sar

    that's all if you have any problem start troubleshooting

    dont forget to apply sap recommeneded opatches after this..

    Hope it will make your upgrade smooth...