ORACLE 12c Upgrade Migrate the Oracle software to oracle from orasid
Migrate the Oracle software from user ora to user oracle.
1. Stop the sap system using stopsap r3
2. Stop DB
3. Stop listener
4. Create Oracle Software Owner account ‘oracle’ Log on as ‘root’, create OS group ‘oinstall’ and the new Oracle software owner ‘oracle’. Use corresponding platform-specific OS commands. Linux/Solaris/HPUX: root># groupadd oinstall root># useradd -g oinstall -G dba,oper -c “Oracle Software Owner” -m -s “/bin/sh” oracle root># passwd oracle root># su – oracle -c “id; pwd”
5. Modify SAP administrator account ‘adm’ On the database server, log on as ‘root’ and add the ‘adm’ account as a member to OS group ‘oinstall’ (required to run SAP BR*TOOLS). In addition to the standard groups (such as sapsys, dba, oper, sapinst),adm also belongs to the OS group “oinstall” (SAP Note 1598594). Linux: [root]# groupmod -Aadm oinstall
6. Modify Database Administrator account ‘ora’ If you don’t need this OS account as an additional database administrator account, you can skip this step. If you continue to use this account as additional database administator account, then this step is required. Reconfigure OS account ‘ora’ as below:
6.1. Change user home directory from ‘/oracle/’ to the standard user home directory ‘/home/ora’
6.2. Change group membership to dba (primary group), oper, oinstall
6.3. Move ‘ora’ profiles and scripts (.profile .login .bashrc .cshrc .sap* .dbenv* .j2eeenv* startdb stopdb) from old user home to new user home directory
6.4. Log on as ‘root’ and run the following commands: Linux/Solaris/AIX/HPUX: [root]# mkdir -p /home/ora[root]# chown ora:dba /home/ora[root]# usermod -d /home/ora ora[root]# usermod -g dba -G oper,oinstall ora[root]# cd /oracle/[root]# mv .profile .login .bashrc .cshrc .sap* .dbenv* .j2eeenv* /home/ora[root]# mv startdb stopdb /home/ora
6.5. When finished, log on as ora and check/verify the environment. [ora] $ env. In our Case it was already there and hence no need to perform
7. Check Oracle environment consistency. When you log on as any of the Oracle database administrator accounts to perform an administrative task on database, the Oracle environment must be identical. Log on as ‘oracle’, ‘adm’ and ‘ora’ and verify that environment variables ORACLE_BASE,ORACLE_HOME and ORACLE_SID are set identical. OS account ‘oracle’ For this account the Oracle environment for can be set using the Oracle script ‘oraenv’ (see SAP Note 1554661) if the corresponding entry for exists in oratab (location of oratab: /etc or /var/opt/oracle, depending on OS). Note: ORACLE_BASE is not set when you use the 10g version of ‘oraenv’ script. ORACLE_BASE is set in ‘oraenv’ script version 11g and higher. Example for oratab entry for database::/oracle//112_64:N OS accounts ‘ora’ / ‘adm’ For these accounts the Oracle environment is set in the SAP scripts ‘.dbenv*’.
8. Change Ownership of Database Files and Directories In this step you change permissions and ownership of Oracle database files and directories from ‘ora’ to ‘oracle’. Change File Permissions and Ownership with script ‘orasid2oracle.sh’ You find the script ‘orasid2oracle.sh’ attached to this SAP Note. Download the script and extract it.
8.1For help, you can run the script as ‘./orasid2oracle.sh -help’.
8.2Option #1: Log on as ‘ora[root]# export ORACLE_BASE=[root]# export DB_SID=
8.3. For help, run: [root]# ./orasid2oracle.sh -help 8.4. Perform a test run of the script: [root]# ./orasid2oracle.sh -v
8.5. Run the script with ‘-exec’ option to perform the changes: [root]# ./orasid2oracle.sh -v -exec
8.6. Check whether you need to change the ownership of additional, non-standard directories! Note: if needed, you can revert the ownership back from ‘oracle:oinstall’ back to ‘ora:dba’ with the following command: [root]# orasid2oracle.sh -owner ora-group dba -v -exec Change Ownership Use option 2 setenv SAPDATA_HOME /oracle/SID
9. Change Ownership of Oracle Home
9.1 Detailed Steps for Approach (1) using SAP Note 1983457 Note: if sudo is configured, you can use ‘sudo’ to run the generated scripts from the required OS account (root or oracle). OS> sudo -u root