UNIX:Deleting an NW 7.0/7.01 based SAP System Manually

[] [] [] []

Symptom
***********************************************************************
*
*
* Unix: Deleting an SAP System Based on
* SAP NetWeaver 7.0 / 7.01 Manually
*
*
*
***********************************************************************
Other terms
Unix, SAPinst, delete, SAP instance, Java Add-In, ABAP stack, Java stack, dual-stack system, ABAP system, Java system, ABAP+Java system
Reason and Prerequisites
You want to delete an SAP system based on SAP NetWeaver 7.0 / 7.01 manually
You want to delete a SAP Diagnostics Agent based on SAP NetWeaver 7.0 / 7.01 manually
We strongly recommend that you use the “Uninstall” option of SAPinst to delete an SAP system or SAP system instances. If you decide to uninstall an SAP system or SAP system instances manually, you do this at your own risk.
Solution

=================================================================
Contents of this SAP Note:
================================================================
Deleting a Complete SAP System ManuallyDeleting an SAP InstanceDeleting Installation Files, Directories, and Users on a HostDeleting the Database InstanceDeleting the Java Stack (Java Add-In) of an SAP System Manually (Only valid for dual-stack (ABAP+Java) systems if you want to delete the Java Add-In)Deleting a Diagnostics Agent Instance Manually

==============================================
o Deleting a Complete SAP System Manually:
==============================================
1. You delete the SAP instances in the following sequence:a) Dialog instances, if there are anyb) Central instance
Note (Only valid for ABAP+Java;Java):
The Java stack of an SAP system is deleted automatically when you delete the central instance of the ABAP system.c) Java Central services instance (SCS), if there is oned) ABAP Central services instance (ASCS), if there is one2. You delete the remaining installation files and directories on the host(s) where you deleted your SAP instance(s).3. You delete the database instance.
Note (Only valid for: ABAP+Java)
The Java database schema is automatically deleted together with the database instance.

- Deleting an SAP Instance:
============================

You use this procedure if you want to delete a single SAP instance or all instances of an SAP system.
Note:
Make sure that you delete the instances in the following order:
1. Dialog instance if there are any2. Central instance3. Central services instance if there is one
Procedure
1. Stop the SAP instance that you want to delete as follows:a) Log on as user<sapsid>adm.b) Execute this command:
stopsap r3 <InstanceName>2. Stop the sapstart service with the following command:
sapcontrol -nr <InstanceNumber> -prot NI_HTTP -function StopService3. Stop the saposcol process with the following command:
saposcol -k4. Remove the instance profiles as follows:
rm /usr/sap/<SAPSID>/SYS/profile/<SAPSID>_<InstanceName>_<host_name>
rm /usr/sap/<SAPSID>/SYS/profile/START_<InstanceName>_<host_name>
Example:
rm /usr/sap/C11/SYS/profile/START_D00_h0001
rm /usr/sap/C11/SYS/profile/C11_D00_h00015. Log on as user root and delete the local instance directory:
rm -rf /usr/sap/<SAPSID>/<InstanceName>6. Change to the directory/usr/sap, edit the filesapservices, and delete the line that refers to the instance to be deleted.7. If required, you can delete the directory/usr/sap/transand its content manually. SAPinst does not delete/usr/sap/transbecause it might be shared.8. If you created the directories/usr/sap/<SAPSID>and/<sapmnt>/<SAPSID>as mount points, but not as directories on the local file system, you have to remove them manually.

- Deleting Installation Files, Directories, and Users on a Host:
===============================================================

After you have deleted all SAP instances on a host, you still have to delete the remaining installation
files, directories, and users on this particular host. You have to repeat this procedure for any host
where you previously deleted an SAP instance.
Caution
Only delete files or directories that are used by other SAP instances by means of NFS mounts if you
are deleting the entire SAP system (on all hosts).
Prerequisites:
You must have deleted your SAP instance(s) as described in Deleting an SAP Instance.
Procedure
1. If the following directories are mounted with NFS, unmount them:
/< sapmnt> /<SAPSID>/exe
/<sapmnt>/<SAPSID>/global
/<sapmnt>/<SAPSID>/profile2. To delete directories, execute the following commands:
rm -rf /usr/sap/<SAPSID>
rm -rf /<sapmnt>/<SAPSID>3. Delete the local user<sapsid>adm, its home directory, and all subdirectories of the home directory.
Caution
Do not delete user<sapsid>admif this is a Network Information System (NIS) user and you do not want to delete the SAP system on all hosts.
Recommendation
To delete users, use the administration tools of your operating system if possible.a) Delete user<sapsid>admas described in your operating system documentation.b) If the home directory of the user was not deleted automatically in the previous step, execute the following command to delete the directory:
rm -rf <sapsid_adm_home>
Example:
rm -rf /home/c11adm4. Delete the user<sapsid>admfrom the groups sapsys, oper, and dba, if this was not done automatically in the previous step. If one of these groups is now empty, delete the complete group as described in your operating system documentation.5. Check whether you need to delete entries from the file /etc/services:a) Search for entries starting with sapb) Check whether these entries are still required by other instances with the same or a different <SAPSID> on any server.c) If not, start by generating a backup copy of the services file by entering the following command:
cp /etc/services /etc/services.sapd) Delete superfluous entries from /etc/services.
If you use NIS for the services file, see your operating system documentation for more information on how to delete entries from network-wide service entries.6. Only valid for ABAP:
If there are no other SAP instances running on this host, delete the following files if they exist:/etc/sapconf/usr/sap/trans/.sapconf7. Only valid for Java:
If there are no other SAP instances running on this host, delete the file/etc/sapconfif it exists.
End of: Only valid for Java8. If there are no other SAP instances running on this host, delete the file /usr/sap/sapservices.9. Only valid for ABAP:
If there are no other SAP systems running network-wide, delete the directory/usr/sap/transwith all its subdirectories. Otherwise, adapt the SAP system configuration description.
End of: Only valid for ABAP
- Deleting the Database Instance:
=================================
If your database is Oracle, proceed as described in SAP Note 1229689.
For other databases, refer to the installation guide for your SAP system and database which is available athttp://service.sap.com/instguides.

=====================================================================
o Deleting the Java Stack (Java Add-In) of a Dual-Stack (ABAP+Java) System Manually
=====================================================================
The following sequence describes how to delete the Java stack (Java Add-In) of a dual-stack (ABAP+Java) system.
Note:
If you delete the Java stack, the ABAP stack of the SAP system is not deleted.
Caution:
This description assumes that you installed the SAP system using SAP standard tools according to the installation documentation.
Caution:
If you delete network-wide users, groups, or service entries in an environment with Network Information System (NIS), other SAP installations might also be affected. Make sure that the users, groups, and service entries to be deleted are no longer required.
Note:
Instead of deleting the Java stack of an ABAP+Java system, you can also prevent the Java stack from starting by setting the following parameter in the instance profile:rdisp/j2ee_start = 0
1. Stop the central services instance and all dialog instances as follows :a) Log on to the appropriate instance host as user <sapsid>adm.b) Execute the following commands:To stop the central services instance:
stopsap r3 <SCSinstanceName>To stop a dialog instance:
stopsap r3 <DialogInstanceName>2. Stop the J2EE Engine of the central instance:a) Log on to your SAP system.b) Call transactionSMICM.c) ChooseAdministration -> J2EE Instance (local) -> Send Hard Shutdown.
Note:
You do not need to stop the central instance.3. If lines beginning with the following parameters appear, delete these lines from the default profile,/usr/sap/<SAPSID>/SYS/profile/DEFAULT.PFL:
j2ee/dbname =
j2ee/dbtype =
j2ee/dbhost =
j2ee/dbadminurl =
j2ee/scs/host =
j2ee/scs/system =
j2ee/ms/port =4. If lines beginning with the following parameters appear, delete these lines from the central instance profile and from all dialog instance profiles,/usr/sap/<SAPSID>/SYS/profile/<SAPSID>_<INSTANCE_NAME>_<host_name>:
exe/j2ee =
exe/jlaunch =
rdisp/j2ee_start_control =
rdisp/j2ee_start =
rdisp/j2ee_timeout =
rdisp/j2ee_libpath =
rdisp/frfc_fallback =
jstartup/trimming_properties =
jstartup/instance_properties =
jstartup/protocol =
jstartup/vm/home =
jstartup/max_caches =
jstartup/release =
j2ee/dbdriver =5. Delete the central services instance as described above in “Deleting an SAP Instance” and “Deleting Installation Files, Directories, and Users on a Host”.6. Delete the Java database schema.
If your database ist Oracle, proceed as described in section “Deleting the Oracle Database Java Schema” ofSAP Note 1229689.
For other databases, refer to the installation guide for your SAP system and database which is available athttp://service.sap.com/instguides.7. Delete the following directories (<xx> is the central instance number):/usr/sap/<SAPSID>/DVEBMGS<xx>/SDM/usr/sap/<SAPSID>/DVEBMGS<xx>/j2ee8. Delete the central services instance as described above in “Deleting an SAP Instance” and “Deleting Installation Files, Directories, and Users on a Host”.9. Delete the Java database schema.
If your database ist Oracle, proceed as described in section “Deleting the Oracle Database Java Schema” ofSAP Note 1229689.
For other databases, refer to the installation guide for your SAP system and database which is available athttp://service.sap.com/instguides.10. Delete all existing dual-stack (ABAP+Java) dialog instances completely as described above in “Deleting an SAP Instance”.11. Install new ABAP dialog instances as described in the installation guide for your SAP system and database which is available athttp://service.sap.com/instguides.

======================================================================
o Deleting a Diagnostics Agent Instance Manually
======================================================================
You use this procedure if you want to delete a single Diagnostics Agent.
Procedure:
1. Stop the Diagnostics Agent that you want to delete as follows:a) Log on as user<smdsid>adm.b) Execute this command:
smdstop <SMDSID>
Example
smdstop SMD2. Remove the instance profiles as follows:
rm /usr/sap/<SMDSID>/SYS/profile/<SMDSID>_<InstanceName>_<host_name>
rm /usr/sap/<SMDSID>/SYS/profile/START_<InstanceName>_<host_name>
Example:
rm /usr/sap/SMD/SYS/profile/START_J98_h0001
rm /usr/sap/SMD/SYS/profile/SMD_J98_h00013. Log on as user root and delete the local instance directory using the following commands:
rm -rf /usr/sap/<SMDSID>/<InstanceName>

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Leave a Comment