Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Upgrade from Oracle 11.2 to Oracle (Linux Red Hat) (2/3)

Upgrade from Oracle 11.2 to Oracle (Linux Red Hat) (3/3)



Disclaimer

Creating SSFS

Creating directories

Maintaining the SSFS profile parameters

Maintaining the SSFS environment variable

Setting up the SSFS storage

Changing to the new connection method

Checking the successful changeover

Upgrading BR*Tools

Checking the installed version

Upgrading BR*Tools to version 7.40

Migrating software owner to “oracle”

Stop the SAP system and the database

Stop the database listener

Create Oracle Software Owner account 'oracle'

Modify SAP administrator account '<sapsid>adm'

Modify Database Administrator account 'ora<dbsid>'

Check Oracle environment consistency

Change Ownership of Database Files and Directories

Change Ownership of Oracle Home (Software Owner)

Start the database listener

Configure SAP BR*Tools for user 'oracle'

Disclaimer

The target of this guide is to upgrade from version 11.2.0.X to version 12.1. It has been used sucessfully, but you may find errors following it. I really encourage to test in a sandbox system prior to use real ones.


Also, take in account:

  • Default Listener Port (1521) has not been used here.
  • This is based on a pure ABAP system.
  • Oracle RAC and ASM is not covered by this guide.

Please, feel free to comment if you find errors or suggest improvements for this document.


Creating  SSFS

Due to the change to Oracle 12.1, the "old" way SAP identifies itself onto Oracle is deprecated. In fact, it can be used but, with version 12.2, it will be mandatory to move to SSFS system.


Creating directories

It's recommended storing the secure storage in the file system and the optional external encryption key on SAPGLOBALHOST under $(DIR_GLOBAL)/security/rsecssfs/data or $(DIR_GLOBAL)/security/rsecssfs/key, whereby these directories should be secured accordingly.

Determine the value for DIR_GLOBAL (for example, from transaction AL11) on SAPGLOBALHOST. Replace $(DIR_GLOBAL) in the following description with the determined value <dir_global>. Create the required directories as described below if they do not already exist.



Log on to SAPGLOBALHOST to the operating system as user <sid>adm and execute the following commands:

mkdir <dir_global>/security

mkdir <dir_global>/security/rsecssfs

mkdir <dir_global>/security/rsecssfs/data

mkdir <dir_global>/security/rsecssfs/key



Make the directories that were created available exclusively for the users of the SAP system <sid>.

chmod 700 <dir_global>/security

chmod 700 <dir_global>/security/rsecssfs

chmod 700 <dir_global>/security/rsecssfs/data 

chmod 700 <dir_global>/security/rsecssfs/key 



Maintaining  the SSFS profile parameters

Set the following profile parameters that point to the previously created directories as the location for the secure storage and the external key. The best option is to add the parameters to the default profile DEFAULT.PFL. Add the following entries:


rsec/ssfs_datapath = $(DIR_GLOBAL)$(DIR_SEP)security$(DIR_SEP)rsecssfs$(DIR_SEP)data

rsec/ssfs_keypath  = $(DIR_GLOBAL)$(DIR_SEP)security$(DIR_SEP)rsecssfs$(DIR_SEP)key

Maintaining  the SSFS environment variable

The profile parameters rsec/ssfs_datapath and rsec/ssfs_keypath are interpreted only by the SAP system. The do not apply to the SAP tools R3trans, R3load, and so on. For this, corresponding environment variables must be set in .sapenv.sh, .sapenv.csh, .sapenv_<host name>.csh, and .sapenv_<hostname>.sh on each application server, including the central instance.


setenv RSEC_SSFS_DATAPATH /usr/sap/MW1/SYS/global/security/rsecssfs/data

setenv RSEC_SSFS_KEYPATH /usr/sap/MW1/SYS/global/security/rsecssfs/key

Setting  up the SSFS storage

Fill the secure storage in the file system with the required access information for the ABAP database user. This information consists of at least the name of the ABAP database user and the password of this user.
In the case of some database types, you must also make specifications about the target database. In all other cases, this information is still derived from the SAP profile.

Note that storage differentiates between uppercase and lowercase characters.

  • DB_CONNECT/DEFAULT_DB_USER
    ABAP database connect user (usually "SAPSR3")
    The storage in the secure storage should take place in an unencrypted manner for Support reasons.

  • DB_CONNECT/DEFAULT_DB_PASSWORD
    Password of the ABAP database user
    The storage in the secure storage takes place in an encrypted manner.



Log on to SAPGLOBALHOST as the <sid>adm user.



Make sure that the environment variables RSEC_SSFS_DATAPATH and RSEC_SSFS_KEYPATH are set.

setenv |grep RSEC_SSFS_DATAPATH

RSEC_SSFS_DATAPATH=/usr/sap/MW1/SYS/global/security/rsecssfs/data



setenv |grep RSEC_SSFS_KEYPATH

RSEC_SSFS_KEYPATH=/usr/sap/MW1/SYS/global/security/rsecssfs/key



Use the command line tool of the secure storage rsecssfx from the SAP kernel to add entries for the user SAPSR3 and the password (“testland” in this example), and to add any information about the target database as follows:

rsecssfx put DB_CONNECT/DEFAULT_DB_USER SAPSR3 -plain

rsecssfx put DB_CONNECT/DEFAULT_DB_PASSWORD testland



Check the content of the secure storage as follows:

rsecssfx list

|---------------------------------------------------------------------------------|

| Record Key | Status | Timestamp of last Update |

|---------------------------------------------------------------------------------|

| DB_CONNECT/DEFAULT_DB_PASSWORD | Encrypted | 2015-11-06 00:15:53 UTC |

| DB_CONNECT/DEFAULT_DB_USER | Plaintext | 2015-11-06 00:15:36 UTC |

|---------------------------------------------------------------------------------|



Summary

-------

Active Records : 2 (Encrypted : 1, Plain : 1, Wrong Key : 0, Error : 0)

Datafile Location : /usr/sap/MW1/SYS/global/security/rsecssfs/data/SSFS_MW1.DAT (when existing)

Keyfile Location : /usr/sap/MW1/SYS/global/security/rsecssfs/key/SSFS_MW1.KEY (when existing)




Due to the first call of "rsecssfx put", the system also creates the data storage of the secure storage. The directory $(DIR_GLOBAL)/security/rsecssfs/data should now contain the file SSFS_<sid>.DAT

ls -l

total 4

-rw-r--r--.  1 mw1adm sapsys 486 Nov 6 00:15 SSFS_MW1.DAT




You must correct the access rights for the file, so that only <sid>adm are authorized.

> chmod 600 SSFS_MW1.DAT

> ls -l

total 4

-rw-------.  1 mw1adm sapsys 486 Nov 6 00:15 SSFS_MW1.DAT



As an alternative to the method described in SAP Note 1639578 for entering or changing a user and password (in two steps using "sqlplus" in the database and with "rsecssfx" in secure storage), you can do this in one step using "brconnect". The following example for the user "sapsr3" with the new password "testland" changes the password in the database and changes or enters the user and password in the SSFS.


Related to the previous paragraph, I'm not sure if it inserts anything in SSFS. I tried it before creating the SSFS, and it didn't work. It can be useful for updating the SAPSR3 password and make it match with the one stored in SSFS.


> brconnect -u / -f chpass -o sapsr3 -p testland

BR0801I BRCONNECT 7.20 (36)

BR0280I BRCONNECT time stamp: 2015-11-06 00.05.06

BR0828I Changing password for database user SAPSR3 ...

BR0280I BRCONNECT time stamp: 2015-11-06 00.05.06

BR0256I Enter 'c[ont]' to continue, 's[top]' to cancel BRCONNECT:

c

BR0280I BRCONNECT time stamp: 2015-11-06 00.05.10

BR0257I Your reply: 'c'

BR0259I Program execution will be continued...

BR0280I BRCONNECT time stamp: 2015-11-06 00.05.10

BR0829I Password changed successfully indatabase for user SAPSR3

BR0830I Password changed successfully in table OPS$MW1ADM.SAPUSER for user SAPSR3

BR0280I BRCONNECT time stamp: 2015-11-06 00.05.10

BR0802I BRCONNECT completed successfully


Changing  to the new connection method

If you have executed all of the previous steps correctly, the SAP system should now be able to retrieve the password information that is required for the connection to the primary ABAP database from the secure storage in the file system. However, the conventional password storage is consulted by default.

The changeover to the new method now takes place due to a further profile parameter or a further environment variable and the environment variable for all the application servers.

  • Profile  parameter: rsdb/ssfs_connect = 1
  • Environment  variable: rsdb_ssfs_connect 1

So DEFAULT.PFL must be edited for adding it.


Also the environment variable must be set editing files .sapenv.csh and .sapenv_<hostname>.csh for changing the '0' value to '1' on each application server, including the central instance.

These lines need to be added:

setenv rsdb_ssfs_connect 1

setenv DIR_SEP /



Checking  the successful changeover

Restart the SAP system.

Log into SAP, then go to transaction SM50



If everything worked correctly, these text should appear in trace file:


DBSL supports extended connect protocol

==> connect info for default DB will be read from ssfs





Upgrading BR*Tools

For this upgrade, it's necessary to use BR*Tools version 7.40.


Checking  the installed version

We can check which version is installed on system by typing this as ora<sid>:

brtools -V

BR0651I BRTOOLS 7.20 (36)

Patch Date Info

1 2010-01-26 BR*Tools support for Oracle 11g (note 1430669)

9 2010-10-27 BR*Tools support for eSourcing databases (note 1523205)

18 2011-09-07 BR*Tools support for Oracle ASM and Exadata (note 1627541)

25 2012-06-28 Corrections in BR*Tools 7.20 patch 25 (note 1735811)

26 2012-09-12 Corrections in BR*Tools 7.20 patch 26 (note 1763972)

27 2012-09-12 Support for secure storage in BR*Tools (note 1764043)

28 2012-10-25 Corrections in BR*Tools 7.20 patch 28 (note 1780057)

29 2012-12-03 Corrections in BR*Tools 7.20 patch 29 (note 1795814)

30 2013-01-31 Corrections in BR*Tools 7.20 patch 30 (note 1816874)

31 2013-03-26 Corrections in BR*Tools 7.20 patch 31 (note 1838852)

32 2013-05-28 Corrections in BR*Tools 7.20 patch 32 (note 1865897)

33 2013-07-03 Corrections in BR*Tools 7.20 patch 33 (note 1882181)

34 2013-09-05 Corrections in BR*Tools 7.20 patch 34 (note 1909451)

35 2013-11-14 Corrections in BR*Tools 7.20 patch 35 (note 1940675)

36 2014-02-24 Corrections in BR*Tools 7.20 patch 36 (note 1983045)



release note 1428529

kernel release 720

patch date 2014-02-24

patch level 36

make platform linuxx86_64

make codeline 721_EXT_REL

make mode OCI_112

make date Mar 29 2014




Upgrading BR*Tools to version 7.40

This version is provided as part of the Oracle DBA tools for kernel 7.42 instead of kernel 7.21 EXT, therefore, is in this section of the Service Marketplace where we can find them.

Support Packages and Patches → SAP KERNEL 64-BIT UNICODE → SAP KERNEL 7.42 64-BIT UNICODE

DBATL740O11_17-20012214.SAR

We upload them to the server and sustitute the ones located at SAP's kernel folder by these ones.

As always, SAP system must be stopped for changing files in the kernel's folder.

Once modified, we test it's done:

brtools -V

BR0651I BRTOOLS 7.40 (17)

Migrating   software owner to “oracle”

Until Oracle Database 11g, Oracle Database software for SAP standard installations with an Oracle single instance database on file system is always installed with software owner and database administrator 'ora<dbsid>' (user concept 'SAP Classic'). Starting Oracle Database 12c, the Oracle Database software for SAP standard installations on Unix and Linux platforms can also be installed by software owner 'oracle' (user concept 'Oracle Standard').

User concept ‘SAP Classic’ is deprecated. For the future with Oracle Releases 12.2 or higher SAP may de-support or replace the old, classic user concept ‘SAP classic’.

Stop  the SAP system and the database

Log on as SAP administrator and stop the SAP system. Then type

stopsap

Stop  the database listener

Log on as ora<dbsid>.

Check the name of the listener and also any other processes running as user ora<dbsid>.

> ps -ef |grep oramw1

oramw1 4340 1 0 Jul20 ? 00:08:25 /oracle/MW1/112_64/bin/tnslsnr LISTENER_MW1 -inherit

root 27455 23457 0 21:24 pts/0 00:00:00 su - oramw1

oramw1 27456 27455 2 21:24 pts/0 00:00:00 -csh

oramw1 27638 27456 6 21:25 pts/0 00:00:00 ps -ef

oramw1 27639 27456 0 21:25 pts/0 00:00:00 grep oramw1





In this example, only the listener is running, so we stop it typing lsnrctl stop <listener_name>:

lsnrctl stop LISTENER_MW1

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 08-NOV-2015 21:32:01

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

Connecting  to (ADDRESS=(PROTOCOL=IPC)(KEY=MW1.WORLD))

The command completed successfully



It's also interesting to check the file /oracle/MW1/11203/network/admin/listener.ora for getting the required information about the port being used by the listener.

more /oracle/MW1/11203/network/admin/listener.ora

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

# Filename......: listener.ora

# Created.......: created by SAP AG, R/3 Rel. >= 6.10

# Name..........:

# Date..........:

# @(#) $Id: //inst/inst_scripts/lmts_006_REL/tpls/ora/LISTENER.ORA#1 $

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

ADMIN_RESTRICTIONS_LISTENER_MW1 =      on

LISTENER_MW1  =

(ADDRESS_LIST =

(ADDRESS =

(PROTOCOL = IPC)

(KEY = MW1.WORLD)

)

(ADDRESS=

(PROTOCOL = IPC)

(KEY = MW1)

)

(ADDRESS =

(COMMUNITY = SAP.WORLD)

(PROTOCOL = TCP)

(HOST = sapbiwm01)

(PORT = 1651)

)

)

STARTUP_WAIT_TIME_LISTENER_MW1 =      0

CONNECT_TIMEOUT_LISTENER_MW1      = 10

TRACE_LEVEL_LISTENER_MW1      = OFF

SID_LIST_LISTENER_MW1      =

(SID_LIST =

(SID_DESC =

(SID_NAME = MW1)

(ORACLE_HOME = /oracle/MW1/112_64)

)

)

ADR_BASE_LISTENER_MW1      = /oracle/MW1/saptrace


Create  Oracle Software Owner account 'oracle'

Based on 1915317 - Migrating Software Owner to 'oracle' Log as “root” and make sure that '/usr/local/bin' is added to PATH (required for executing oraenv, coraenv):

echo $PATH

/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin



In this case, it's added.

Continue typing the following commands in order to create the required group and user:

# groupadd oinstall

# useradd -g oinstall -G dba,oper -c "Oracle Software Owner" -m -s "/bin/sh" oracle

# passwd oracle

Changing password for user oracle.

New password:

BAD PASSWORD: it is based on a dictionary word

Retype new password:

passwd: all authentication tokens updated successfully.

# su - oracle -c "id; pwd"

uid=504(oracle)   gid=505(oinstall) groups=505(oinstall),503(dba),504(oper) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023   /home/oracle





Modify  SAP administrator account '<sapsid>adm'

On the database server, log on as 'root' and add the '<sapsid>adm' account as a member to OS group 'oinstall'. This is required to run SAP BR*TOOLS. You must specify all groups <sapsid>adm is a already member of.

usermod -G sapsys,sapinst,dba,oper,oinstall mw1adm


Modify  Database Administrator account 'ora<dbsid>'

Change user home directory from '/oracle/<DBSID>' to the standard user home directory '/home/ora<dbsid>'

  1. Change group membership of 'ora<dbsid>' to primary group 'dba' and secondary groups 'oper', 'oinstall'
  2. Move 'ora<dbsid>' profiles and scripts (.profile .login .bashrc .cshrc .sap* .dbenv* .j2eeenv* startdb stopdb) from old user home to new user home directory
  3. Change ownership of files in the new home directory



Log as “root” and run the following commands:

# mkdir -p /home/oramw1

# chown oramw1:dba /home/oramw1

# usermod -d /home/oramw1 oramw1

# usermod -g dba -G oper,oinstall oramw1

# cd /oracle/MW1

# mv .profile .login .bashrc .cshrc .sap* .dbenv* .j2eeenv* /home/oramw1

# mv startdb stopdb /home/oramw1

# chown -R oramw1:dba /home/oramw1





When finished, log on as ora<dbsid> and check/verify the environment.

# id

uid=502(oramw1)   gid=503(dba) groups=503(dba),504(oper),505(oinstall) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

# env

TERM=xterm

DISPLAY=localhost:10.0

HOME=/home/oramw1

SHELL=/bin/csh

USER=oramw1

LOGNAME=oramw1

PATH=/oracle/MW1/112_64/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/sap/MW1/SYS/exe/uc/linuxx86_64:/usr/sap/MW1/SYS/exe/run:/home/oramw1:.

HOSTTYPE=x86_64-linux

VENDOR=unknown

OSTYPE=linux

MACHTYPE=x86_64

SHLVL=1

PWD=/home/oramw1

GROUP=dba

HOST=ls-sap-tmpvm11

REMOTEHOST=192.168.11.145

MAIL=/var/spool/mail/oramw1

HOSTNAME=ls-sap-tmpvm11

LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:

CVS_RSH=ssh

G_BROKEN_FILENAMES=1

SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass

KDEDIRS=/usr

KDE_IS_PRELINKED=1

LANG=en_GB.UTF-8

LESSOPEN=|/usr/bin/lesspipe.sh      %s

MODULESHOME=/usr/share/Modules

MODULEPATH=/usr/share/Modules/modulefiles:/etc/modulefiles

LOADEDMODULES=

QTDIR=/usr/lib64/qt-3.3

QTINC=/usr/lib64/qt-3.3/include

QTLIB=/usr/lib64/qt-3.3/lib

SAPSYSTEMNAME=MW1

DIR_LIBRARY=/usr/sap/MW1/SYS/exe/run

RSEC_SSFS_DATAPATH=/usr/sap/MW1/SYS/global/security/rsecssfs/data

RSEC_SSFS_KEYPATH=/usr/sap/MW1/SYS/global/security/rsecssfs/key

rsdb_ssfs_connect=0

LD_LIBRARY_PATH=/usr/sap/MW1/SYS/exe/run:/usr/sap/MW1/SYS/exe/uc/linuxx86_64:/oracle/MW1/112_64/lib

SAPEXE=/usr/sap/MW1/SYS/exe/run

THREAD=NOPS

DB_SID=MW1

dbms_type=ORA

dbs_ora_tnsname=MW1

dbs_ora_schema=SAPSR3

ORACLE_SID=MW1

ORACLE_BASE=/oracle

ORACLE_HOME=/oracle/MW1/112_64

NLS_LANG=AMERICAN_AMERICA.UTF8

SAPDATA_HOME=/oracle/MW1

Check  Oracle environment consistency

Log on as 'oracle', '<sapsid>adm' and 'ora<dbsid>' and verify that environment variables ORACLE_BASE, ORACLE_HOME and ORACLE_SID are set identical.

Log as <sapsid>adm

# setenv ## only displayed the relevant data for this guide

ORACLE_SID=MW1

ORACLE_BASE=/oracle

ORACLE_HOME=/oracle/MW1/112_64



Log as ora<dbsid>

# setenv ## only displayed the relevant data for this guide

ORACLE_SID=MW1

ORACLE_BASE=/oracle

ORACLE_HOME=/oracle/MW1/112_64



Log as 'oracle'

-sh-4.1$ oraenv

ORACLE_SID  = [oracle] ? MW1

ORACLE_HOME  = [/home/oracle] ? /oracle/MW1/112_64

The Oracle base has been set to /oracle


For OS accounts 'ora<dbsid>' / '<sapsid>adm' the Oracle environment is set in the SAP scripts '.dbenv*' located at /home/user_subfolder.




Change   Ownership of Database Files and Directories

For this step, it's needed to execute the script 'orasid2oracle.sh' which is attached to the SAP Note 1915317 -  Migrating Software Owner to 'oracle'


Run script as 'root':



Log on to the database server as 'root'



Set environment variables SAPDATA_HOME, ORACLE_BASE and DB_SID

# export SAPDATA_HOME=/oracle/MW1

# export ORACLE_BASE=/oracle

# export DB_SID=MW1



Make the uploaded script executable

# chmod 755 orasid2oracle.sh



Perform  a test run of the script:

# ./orasid2oracle.sh -v



Run the script with '-exec' option to perform the changes:

# ./orasid2oracle.sh -v -exec



Check whether you need to change the ownership of additional, non-standard directories!

drwxr-xr-x.  82 oramw1 dba 4096 Jul 23 12:54 11203

lrwxrwxrwx.  1 oracle oinstall 5 Jul 20 11:54 112_64 -> 11203



11203 still belongs to oramw1:dba so it's neccesary to execute:

# chown -R oracle:oinstall 11203



Change Ownership of Oracle Home (Software Owner)

Change the software owner of the existing Oracle home from 'ora<dbsid>' to 'oracle'. Use the Oracle Home Cloning Tool from SAP Note 1983457 - Oracle Home Cloning on Unix and Linux for this.



Log on as the old software owner 'ora<dbsid>' and start 'clone_assistant.sh' to generate the scripts. This script will ask some questions for further execution steps.

-sh-4.1$  ./clone_assistant.sh

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

### clone_assistant.sh (V2.0 PL 002 2015-11-04)

### Oracle Home Cloning Assistant

### Copyright (c) Oracle Corporation 2015. All Rights Reserved.

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



Do not use this script for Oracle Grid Infrastructure Homes!



Run this script as Oracle Software Owner.



Enter name of the Oracle Software Owner:

[oracle]:

Your answer is: oracle

(OK) - oracle is software owner of SAP user concept Oracle Standard.

(OK) - You are running as Oracle software owner.

Current OS user is oracle.

Oracle Software Owner is oracle.



Action help

-----------



ID CODE : DESCRIPTION

-- ---- : -----------

( 1) Action 'clone' : Copying and Cloning an existing Oracle home to a new location

( 2) Action 'relocate' : Moving and Cloning an existing Oracle home to a new location

( 3) Action 'config' : Changing the configuration of an existing Oracle home

( 4) Action 'check' : Checking the configuration of an existing Oracle home

( 5) Action 'manage' : Managing an existing Oracle home (attach, detach, deinstall)

( 0) Action 'all' : All action functions



Which of these actions do you want to perform?

Enter action code or action id.

[clone]: 3

Your answer is: 3



(INFO) - For action 'config', several parameters are required.



Enter Oracle database release:

[11.2]:

Your answer is: 11.2


Default value settings

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

Oracle Release : 11.2

Database name <DBSID> : <DBSID>

Source Oracle Home <IHRDBMS>: /oracle/<DBSID>/1120X

Target Oracle Home <IHRDBMS>: /oracle/<DBSID>/1120XCLONE

Target Oracle Base : /oracle/<DBSID>



Parameter help

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

For Source Oracle home path, use installation Oracle home <IHRDBMS>.

For Target Oracle home path, use installation Oracle home <IHRDBMS>.



Example(s):



+---------+----------------------+----------------------+

|RELEASE  |ORACLE_HOME           |IHRDBMS               |

+---------+----------------------+----------------------+

|11.2.0.4 |/oracle/<DBSID>/112_64|/oracle/<DBSID>/11204 |

+---------+----------------------+----------------------+



Enter location for target Oracle home (ORACLE_HOME):

[/oracle/<DBSID>/1120XCLONE]:      /oracle/MW1/11203

(OK) - Location exists.

Your answer is: /oracle/MW1/11203



Enter name for target Oracle home (ORACLE_HOME_NAME):

If you do not specify an Oracle home name, it will be generated by OUI.

[]:

(INFO) - Oracle home name will be generated by OUI.

Your answer is: empty



Enter location for target Oracle base (ORACLE_BASE):

Reference:  SAP Note 1521371

[/oracle/<DBSID>]:      /oracle/MW1

(OK) - ORACLE_BASE directory exists.

Your answer is: /oracle/MW1



Enter name of OS group (OSDBA):

[dba]:

Your answer is: dba



Enter name of OS group (OSOPER):

[oper]:

Your answer is: oper



Do you want to change the software owner for this Oracle home?

[no]: yes

Your answer is: yes



Enter name of Oracle Software Owner:

[oracle]:

Your answer is: oracle



Enter name of primary group of Oracle Software Owner:

[oinstall]:

Your answer is: oinstall



Enter name of super user:

[root]:

Your answer is: root



Enter location for oraInst.loc:

[/etc/oraInst.loc]:

Your answer is: /etc/oraInst.loc



Enter location for scripts (script directory):

[/home/oracle/clone_scripts]:

Your answer is: /home/oracle/clone_scripts



Do you want to run clone_oh.sh in verbose mode?

[no]:

Your answer is: no



(INFO) - You have specified the following parameters:



Action : config

Source Oracle Home

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

Oracle Home path : not specified



Target Oracle Home

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

Oracle Home path : /oracle/MW1/11203

Oracle base path : /oracle/MW1

Oracle Home Name : not specified

OSDBA group : dba

OSOPER group : oper

OSBACKUPDBA group: not specified

OSDGDBA group : not specified

OSKMDBA group : not specified

Software owner : oracle

Primary Group : oinstall

Release : 11.2

Hardware Type : Custom Hardware



Copy command : not specified

Inventory Pointer : /etc/oraInst.loc

Super user : root

Script location : /home/oracle/clone_scripts

Verbose mode : not specified

Query mode : not specified




(INFO) - For action 'config' and the given parameters, the following command generates the corresponding scripts:



/home/oracle/clone_oh.sh -action      config -tgt_oh /oracle/MW1/11203 -tgt_ob /oracle/MW1 -tgt_osdba dba -tgt_osoper oper -tgt_swowner oracle -tgt_swowner_group oinstall -tgt_release 11.2 -invPtrLoc /etc/oraInst.loc -root root -script_dir /home/oracle/clone_scripts

Do you want to generate the scripts?

[yes]:

Your answer is: yes

(INFO) - Generating scripts ...

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

### clone_oh.sh

### Oracle Home Cloning

### Copyright (c) Oracle Corporation 2015. All Rights Reserved.

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



Hostname / Platform : ls-sap-tmpvm11 linux_x86_64 (64-bit)

Current date : 2015_11_09

Current time : 02:20:38

Current user : oracle (uid: 504)

Current directory : /home/oracle

Working directory : /home/oracle

Script directory : /home/oracle/clone_scripts

Verbose mode : NO

Query mode : NO



Command line : /home/oracle/clone_oh.sh

-tgt_ob /oracle/MW1

-tgt_oh /oracle/MW1/11203

-tgt_osdba dba

-tgt_osoper oper

-tgt_swowner oracle

-tgt_swowner_group oinstall

-tgt_release 11.2

-script_dir /home/oracle/clone_scripts

-invPtrLoc /etc/oraInst.loc

-root root

-action config



Current Settings for Changing the configuration of an existing Oracle home



Source Oracle home = not specified

Source Software Owner = not specified:not specified



Target Oracle home = /oracle/MW1/11203

Target Software Owner = oracle:oinstall

will be changed to oracle:oinstall

Target Oracle home name = not specified

Target Oracle base = /oracle/MW1

Target Oracle release = 11.2

Target OSDBA group = dba

Target OSOPER group = oper



Copy command = tar

Super user (root) = root

Default oraInst.loc = /etc/oraInst.loc

Inventory location = not specified



Creating scripts for action 'Changing the configuration of an existing Oracle home' completed.

Location of generated scripts: /home/oracle/clone_scripts



Do you want to see a list of the generated scripts?

[yes]:

Your answer is: yes

(INFO) - Listing of generated scripts ...

(INFO) - Script location: /home/oracle/clone_scripts

/home/oracle/clone_scripts/config06_cleanup.sh

/home/oracle/clone_scripts/config05_run_rootsh.sh

/home/oracle/clone_scripts/config04_clone_oh.sh

/home/oracle/clone_scripts/config03_set_swowner.sh

/home/oracle/clone_scripts/config02_detach_oh.sh

/home/oracle/clone_scripts/config01_show_env.sh

/home/oracle/clone_scripts/config00_settings.sh



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

### clone_assistant.sh (END)

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

(EXIT) - clone_assistant.sh - Exiting with exit code 0.

-sh-4.1$




Execute as user 'oracle':


-sh-4.1$ ./config01_show_env.sh



DESCRIPTION:   This script sets and displays the environment settings.



Current user is oracle.

This script must be run by user 'oracle'.

Source Oracle home =

Target Oracle home = /oracle/MW1/11203

Target Oracle home name =

Target Oracle base = /oracle/MW1

Target Oracle release = 11.2

Target OSDBA group = dba

Target OSOPER group = oper

Target Software Owner = oracle:oinstall

Inventory Pointer File = /etc/oraInst.loc

Super user (root) = root

OS Platform = linux_x86_64

OS Hostname = ls-sap-tmpvm11

OS User = oracle

-sh-4.1$ ./config02_detach_oh.sh



DESCRIPTION:   This script detaches the Oracle home from the central inventory.



Current user is oracle.

This script must be run by user 'oracle'.

Detaching Oracle home from Central Inventory

Oracle home: /oracle/MW1/11203

Starting Oracle Universal Installer...



Checking swap space: must be greater than 500 MB. Actual 19905 MB Passed

The inventory pointer is located at /etc/oraInst.loc

The inventory is located at /oracle/oraInventory

'DetachHome'   was successful.

OUI finished with return code 0

-sh-4.1$ exit




Execute as 'root'


# ./config03_set_swowner.sh



DESCRIPTION:   This script configures the software owner of the Oracle home (if specified).



Current user is root.

This script must be run by user 'root'.

Changing software owner for /oracle/MW1/11203 to oracle:oinstall

Status before owner change

drwxr-xr-x.  82 oracle oinstall 4096 Jul 23 12:54 /oracle/MW1/11203

Changing owner now

Status after owner change

drwxr-xr-x.  82 oracle oinstall 4096 Jul 23 12:54 /oracle/MW1/11203



Execute as 'oracle':


./config04_clone_oh.sh



DESCRIPTION:   This script runs the clone command (clone.pl) for the Oracle home.



Current user is oracle.

This script must be run by user 'oracle'.

Cloning Oracle home /oracle/MW1/11203

./runInstaller   -clone -waitForCompletion -invPtrLoc /etc/oraInst.loc "ORACLE_BASE=/oracle/MW1" "ORACLE_HOME=/oracle/MW1/11203" "oracle_install_OSDBA=dba" "oracle_install_OSOPER=oper" "oracle.sysman.ccr:PRE_REQUISITE=true" -defaultHomeName -silent -noConfig -nowait

Starting Oracle Universal Installer...



Checking swap space: must be greater than 500 MB. Actual 19905 MB Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-11-09_02-31-52AM. Please wait ...Oracle Universal Installer, Version 11.2.0.3.0 Production

Copyright (C) 1999, 2011, Oracle. All rights reserved.



You can find the log of this install session at:

/oracle/oraInventory/logs/cloneActionsxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.log

.................................................................................................... 100%      Done.



Installation  in progress (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)

...............................................................................       79% Done.

Install successful



Linking in progress (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)

Link successful



Setup in progress (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)

Setup successful



End of install phases.(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)

WARNING:

The following configuration scripts need to be executed as the "root" user.

/oracle/MW1/11203/root.sh

To execute the configuration scripts:

1. Open a terminal window

2. Log in as "root"

3. Run the scripts



The cloning of OraHome1 was successful.

Please check '/oracle/oraInventory/logs/cloneActions2015-11-09_02-31-52AM.log' for more details.

OUI finished with return code 0



Execute as 'root'

# ./config05_run_rootsh.sh



DESCRIPTION:   This script runs root.sh script for the Oracle home.



Current user is root.

This script must be run by user 'root'.

Executing /oracle/MW1/11203/root.sh

Enter password for root:

Check /oracle/MW1/11203/install/root_ls-sap-tmpvmxxxxxxxxxxxxxxx.log for the output of root script



and check the content of the referenced file:

# more /oracle/MW1/11203/install/root_ls-sap-tmpvmxxxxxxxxxxxxxxx.log



Performing  root user operation for Oracle 11g



The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME= /oracle/MW1/11203

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Finished product-specific root actions.



After you have successfully run the scripts above, you can delete the scripts to avoid that they are run again. Execute as 'oracle':

-sh-4.1$ ./config06_cleanup.sh

DESCRIPTION:   This script deletes generated script files in directory /home/oracle/clone_scripts for action config

Current user is oracle.

This script must be run by user 'oracle'.

-sh-4.1$ ls -l

total 0


Start  the database listener

We must edit the file /etc/passwd for changing the default console

oracle:x:504:505:Oracle Software      Owner:/home/oracle:/bin/bash



after that, edit the file .bash_profile for the user 'oracle':

# .bash_profile



# Get the aliases and functions

if [ -f ~/.bashrc ]; then

. ~/.bashrc

fi



# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export ORACLE_SID=MW1

export ORACLE_BASE=/oracle/

export ORACLE_HOME=/oracle/MW1/112_64

export PATH=$ORACLE_HOME/bin:$PATH



and we start the listener:

#lsnrctl start LISTENER_MW1



LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 09-NOV-2015 02:59:17



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



Starting /oracle/MW1/112_64/bin/tnslsnr: please wait...



TNSLSNR for Linux: Version 11.2.0.3.0 - Production

System parameter file is /oracle/MW1/112_64/network/admin/listener.ora

Log messages written to /oracle/MW1/saptrace/diag/tnslsnr/ls-sap-tmpvm11/listener_mw1/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1.WORLD)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.7.151)(PORT=1651)))



Connecting  to (ADDRESS=(PROTOCOL=IPC)(KEY=MW1.WORLD))

STATUS of the LISTENER

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

Alias LISTENER_MW1

Version TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date 09-NOV-2015 02:59:17

Uptime 0 days 0 hr. 0 min. 0 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /oracle/MW1/112_64/network/admin/listener.ora

Listener Log File /oracle/MW1/saptrace/diag/tnslsnr/ls-sap-tmpvm11/listener_mw1/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1.WORLD)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=MW1)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.16.7.151)(PORT=1651)))

Services Summary...

Service "MW1" has 1 instance(s).

Instance "MW1", status UNKNOWN, has 1 handler(s) for this service...

The command completed successfully



and we try to start the database, as user "oracle":

$ sqlplus /"as sysdba"

SQL*Plus: Release 11.2.0.3.0 Production on Mon Nov 9 03:01:09 2015



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

Connected to an idle instance.


SQL> startup

ORA-32004:   obsolete or deprecated parameter(s) specified for RDBMS instance

ORACLE instance started.



Total System Global Area 3440816128 bytes

Fixed Size 2233120 bytes

Variable Size 1728056544 bytes

Database Buffers 1694498816 bytes

Redo Buffers 16027648 bytes

Database mounted.

Database opened.

SQL>



and we can even test starting the SAP system in order to check everything went correctly or just test the database connectivity by typing


R3trans -d

This is R3trans version 6.24 (release 721 - 01.04.15 - 20:15:04).

unicode enabled version

R3trans finished (0000).


Configure  SAP BR*Tools for user 'oracle'

As 'root', set permissions of SAP BR*Tools that are installed in /usr/sap/<SAPSID>/SYS/exe/run as follows:

# chown oracle:oinstall brarchive brbackup brconnect brrecover brrestore brspace

# chmod 6774 brarchive brbackup brconnect brrecover brrestore brspace



As 'root', if doesn't exist, create 'sapprof' profile directory /oracle/<DBSID>/sapprof and move there init<DBSID>.sap and init<DBSID>.ora files.

Sample code:

# mkdir -p <SAPDATA_HOME>/sapprof

# mv <ORACLE_HOME>/dbs/init<DBSID>.sap <SAPDATA_HOME>/sapprof

# mv <ORACLE_HOME>/dbs/init<DBSID>.ora <SAPDATA_HOME>/sapprof

# chown -R oracle:oinstall <SAPDATA_HOME>/sapprof ## If it has not the right ones



As 'oracle', create a new database profile init<DBSID>.ora in the $ORACLE_HOME/dbs directory that contains only the "spfile" parameter.

File: initMW1.ora ## edited with 'nano'

spfile=/oracle/MW1/112_64/dbs/spfileMW1.ora



Log as user 'oracle' and create user 'OPS$ORACLE'.

$ sqlplus /"as sysdba"

SQL> create user ops$oracle identified externally;

User created

SQL> grant sapdba to ops$oracle;

Grant succeeded.

SQL> exit



Check the configuration. Log as <sapsid>adm and test this way. Execution can take some minutes. Not all the output is referenced in this guide:

# brconnect -u / -f check

BR0801I BRCONNECT 7.40 (17)

BR0805I Start of BRCONNECT processing: cerutcmy.chk 2015-11-10 02:14:08

BR0484I BRCONNECT log file: /oracle/MW1/sapcheck/cerutcmy.chk

BR0477I Oracle pfile /oracle/MW1/sapprof/initMW1.ora created from spfile /oracle/MW1/112_64/dbs/spfileMW1.ora

BR1805I Oracle spfile /oracle/MW1/sapprof/spfileMW1.ora created from pfile /oracle/MW1/sapprof/initMW1.ora



BR0280I BRCONNECT time stamp: 2015-11-10 02:14:11

BR0813I Schema owners found in database MW1:

APPQOSSYS,   DBSNMP, DIP, OPS$MW1ADM, OPS$ORACLE, OPS$ORAMW1, OPS$SAPSERVICEMW1, ORACLE_OCM, OUTLN, SAPSR3*,

SYS, SYSTEM



BR0280I BRCONNECT time stamp: 2015-11-10 02:14:22

BR0814I Number of tables/partitions in schema of owner SAPSR3: 31063/62323

BR0836I Number of tables treated as info cubes for owner SAPSR3: 5149

BR0814I Number of tables/partitions in schema ofowner SYS: 886/72

BR0814I Number of tables/partitions in schema of owner SYSTEM: 151/39

BR0280I BRCONNECT time stamp: 2015-11-10 02:14:46

BR0815I Number of indexes/partitions in schema of owner SAPSR3: 49788/561266

BR0815I Number of indexes/partitions in schema of owner SYS: 965/74

BR0815I Number of indexes/partitions in schema of owner SYSTEM: 212/52



BR0280I BRCONNECT time stamp: 2015-11-10 02:18:38

BR0816I Number of segments in schema of owner DBSNMP: 8

BR0816I Number of segments in schema of owner OPS$MW1ADM: 1

BR0816I Number of segments in schema of owner OUTLN: 9

BR0816I Number of segments/LOBs in schema of owner SAPSR3: 579235/2421

BR0816I Number of segments/LOBs in schema of owner SYS: 2263/144

BR0816I Number of segments/LOBs in schema of owner SYSTEM: 407/22



BR0280I BRCONNECT time stamp: 2015-11-10 02:18:38

BR0961I Number of conditions found in DBCHECKORA: 128



BR0280I BRCONNECT time stamp: 2015-11-10 02:18:39

BR0818I Number of tables found in DBDIFF for owner SAPSR3: 428



BR0280I BRCONNECT time stamp: 2015-11-10 02:18:39

BR0818I Number of tables found in DBSTATC for owner SAPSR3: 100



BR0280I BRCONNECT time stamp: 2015-11-10 02:18:39

BR0807I Name of database instance: MW1

BR0808I BRCONNECT action ID: cerutcmy

BR0809I BRCONNECT function ID: chk

BR0810I BRCONNECT function: check

BR0951I Number of active/inactive check conditions for database administration: 23/0

BR0952I Number of active/inactive check conditions for database operations: 8/2

BR0953I Number of active/inactive check conditions for database messages: 58/0

BR0954I Number of active/inactive check conditions for database profile: 37/0



If tapes are used for making backups, set the following init<DBSID>.sap parameter:
tape_copy_cmd = dd


For more information, see Notes 71058 and 96898.

Labels in this area