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: 
AJAYTR_ATR66
Participant

#ATR(15)

Informative Note:

  • Consider, we are having Old SAP S/4 HANA 1709 System which no longer required for business purposes. Our requirement is to reuse SAP S/4 HANA Server for SAP ECC Installation (Oracle database). This blog created to provide information on how to uninstall SAP S/4 HANA System using SWPM (Both ABAP and DB) and make system ready for ECC installation (Oracle Database). Instead of decommissioning/reinitializing server from scratch OR requesting new server for SAP installation, we can uninstall SAP if no longer used and reuse same server for our current business requirements. This method will also benefit clients to have lesser billability.
  • Steps will be similar for any kind of SAP System Uninstallation.

Prerequisites: Knowledge on SWPM

SWPM Extraction:

  • Download SWPM 2.0 and extract on your server.

AJAYTR_ATR66_0-1709652674997.png

AJAYTR_ATR66_1-1709652675004.png

  • Start SWPM as usual. I’m using SAPINST with GUI_HOSTNAME (IP address).

AJAYTR_ATR66_0-1709653581972.png

  • Login SWPM.

AJAYTR_ATR66_3-1709652675009.png

  • Make sure to stop all APP and DB services before running SWPM. We can start services if SWPM needs during execution.

AJAYTR_ATR66_4-1709652675012.png

  • Select “Uninstall – SAP Systems or Single Instances”

AJAYTR_ATR66_5-1709652675017.png

DEFINE PARAMETER:

AJAYTR_ATR66_6-1709652675020.png

  • SWPM will automatically detect and fetch SAP Profile Path.

AJAYTR_ATR66_7-1709652675025.png

  • In my case, I don’t need SAP System as well as OS users.

AJAYTR_ATR66_8-1709652675032.png

  • I’m using SWPM to remove database as well in single turn.
  • Another method: We can also use hdblcm to unregister and remove database from OS level itself.

AJAYTR_ATR66_9-1709652675034.png

  • We can continue our SWPM with “Remove database” option selected.

AJAYTR_ATR66_10-1709652675040.png

AJAYTR_ATR66_11-1709652675042.png

………………………..

Error 1: DB host is undefined.

AJAYTR_ATR66_12-1709652675048.png

  • We can see clearly in SWPM logs that NW.DBHost() returns nothing and no hostname assigned.

.AJAYTR_ATR66_13-1709652675051.png

  • SWPM will pick all details via ABAP Profile path only which we provided. We could see SAPDBHOST already provided in Default profile.

AJAYTR_ATR66_14-1709652675052.png

  • I have started system to check OS01 transaction and found out DB server details not fetched by ABAP system.

AJAYTR_ATR66_15-1709652675053.png

  • While checking RZ10 profile, Incorrect entry maintained for SAPDBHOST even though OS level entry maintained separately. RZ10 – Default profile also have latest profile version only.

AJAYTR_ATR66_16-1709652675059.png

  • Edited parameter and restarted system. After restart, I could see DB server details fetched successfully in OS01 transaction as well.

AJAYTR_ATR66_17-1709652675060.png

AJAYTR_ATR66_18-1709652675061.png

  • Relaunch SWPM after stopping all APP and DB services. You can continue with existing SWPM process itself instead of starting new run.

……………………….

AJAYTR_ATR66_19-1709652675064.png

  • No errors popped up now.

……………………………….

  • I’m removing HANA Client as well.

AJAYTR_ATR66_20-1709652675068.png

AJAYTR_ATR66_21-1709652675070.png

  • No need to keep database content/data in my scenario since entire SAP system needs to be deleted.

AJAYTR_ATR66_22-1709652675077.png

……………………………….

Error 2:

AJAYTR_ATR66_23-1709652675080.png

  • Start system and retry step once.

………………………………

Error 3:

AJAYTR_ATR66_24-1709652675081.png

  • Check with hana client hdbsql command whether connection to port 30213/30215 possible.

AJAYTR_ATR66_25-1709652675081.png

AJAYTR_ATR66_26-1709652675083.png

AJAYTR_ATR66_27-1709652675084.png

  • Connectivity checks done via 30213 SYSTEM DB port to ensure database online or not. But SWPM seeks TENANT SYSTEM User password only to connect tenant database via port 30215. Hence, provide Tenant SYSTEM user password. I have provided the same and crossed error step successfully.

AJAYTR_ATR66_28-1709652675087.png

……………………………….

  • Provide password for the SYSTEM DB SYSTEM user now.

AJAYTR_ATR66_29-1709652675091.png

  • Define parameter completed.

REVIEW PARAMETER:

  • Review parameters just show summary of our selected parameters.

AJAYTR_ATR66_30-1709652675096.png

AJAYTR_ATR66_31-1709652675099.png

EXECUTE SERVICE

  • Started executing service.

AJAYTR_ATR66_32-1709652675124.png

  • You can find all process/steps in Tasklist as usual.

AJAYTR_ATR66_33-1709652675133.png

AJAYTR_ATR66_34-1709652675138.png

AJAYTR_ATR66_35-1709652675141.png

  • Uninstallation completed successfully.

SAP Host Agent Uninstallation:

  • Host Agent uninstallation should be automatically done by SWPM.

AJAYTR_ATR66_36-1709652675144.png

  • It might be missed since we have stopped hostagent services before running SWPM. Hostagent not detected by SWPM.
  • We can uninstall hostagent manually using command “saphostexec -uninstall command”

AJAYTR_ATR66_37-1709652675145.png

AJAYTR_ATR66_38-1709652675157.png

  • Remove sapadm user as well.

AJAYTR_ATR66_39-1709652675158.png

Uninstallation checks:

1) Check SAP User/Directories deletion:

  • /hana/shared
  • /usr/sap
  • /sapmnt/

AJAYTR_ATR66_40-1709652675160.png

  • User - SIDADM, SAPADM (Already deleted after hostagent uninstallation)

AJAYTR_ATR66_41-1709652675161.png

  • All SAP users/Directories were deleted by SWPM successfully.

Recreating /oracle volume:

  • We need to delete /hana volume and create new volume with /oracle path since our requirement is to reuse server for SAP ECC with Oracle database.
  • Delete /hana files/folder

AJAYTR_ATR66_42-1709652675162.png

  • We can crosscheck Logical and Physical volume details via lvs, pvs and vgs command. I’m just showing with vgs to avoid confusion.
  • Viewers -> Please comment if you need detailed LVM blog separately from my end, I will post it.

AJAYTR_ATR66_43-1709652675163.png

AJAYTR_ATR66_44-1709652675163.png

  • Currently, Only 20 GB free. We just need to delete /hana (498 GB) and recreate same LVM volume size with /oracle (500 GB). VG free should be ~18 GB post LVM operation.

AJAYTR_ATR66_45-1709652675165.png

  • Vi /etc/fstab -> Comment rhel-hana before unmounting.

AJAYTR_ATR66_46-1709652675166.png

  • Once lvm hana deleted, do the below steps for creating oracle lvm and mounting /oracle directory.

AJAYTR_ATR66_47-1709652675168.png

  • Add new line in FS entry – vi /etc/fstab

AJAYTR_ATR66_48-1709652675169.png

  • Check using df -kh command. We can see /oracle directory mounted with our oracle LVM with 500 GB. VG free - ~18 GB as expected.

AJAYTR_ATR66_49-1709652675169.png

  • We have reused our SAP server to install new SAP System with Oracle Database.

Additional:

  • Remove System from SAP Solution Manager/FRUN if connected
  • Remove licenses and SAP System Entries from our SAP Support Portal/SAP for Me
  • Remove RFC Connection if configured in other system.
  • Remove system from CUA if configured

 

Thanks for Visiting !

Please do connect and follow my Linked In Profile - https://www.linkedin.com/in/ajaytr66/

AJAY TR - ATR - SAP BASIS ADMINISTRATOR

Labels in this area