SAP HANA Restore Guide (for A2040e RHEL)

Transcription

SAP HANA Restore Guide(for A2040e RHEL)7th of August 2018NEC SAP Competence Center

1. Introduction1.1. PurposeThis manual describes a restore procedure of a HANA system from a full backup media.1.2. Scope・SAP HANA single node appliance・OS is RHEL 71.3. Reference documents・SAP HANA Database Administration GuideThe above documents are available from the following site, be sure to checkhttps://help.sap.com/viewer/p/SAP HANA PLATFORM2. Planning2.1.SAP HANA data allocationThis chapter describes the disk and filesystem layout. Use the commands lsblk and blkid toget details about existing block devices and their usage.All data except swap, /var/crash and /backup in the following tables will be restored.2.2.Appliances with 3 internal HDDs and 1 JBODHANA memory: Up to 1,152 GBHDDsRAIDInternalJBOD2.3.2 x 300GBSAS HDD10000rpm24 x 600GBSAS HDD10000rpm11JBOD2LDLD Size279 GBLD#1279 GB6,696 GBLD#1 12LD#13 243,456 GB1,032 GBLD#25 362,208 GBFSext3vfatext3swapxfsxfsxfsxfsxfsxfsmount hana/shared/backup/var/crash(free)FS size1 GB1 GB267 GB10 GB0 GB3,456 GB1,024 GB1,152 GB50 GB1,006 GB0 GBmount a/shared(free)/hana/data/var/crash(free)FS size1 GB1 GB267 GB10 GB50 GB509 GB1,024 GB3,166 GB0 GB9,216 GB4,188 GB0 GBAppliances with 8 internal HDDs and 1 JBODHANA memory: Up to 3,072 GBHDDsRAIDInternalSize2 x 900GBSAS HDD10000rpm6 x 900GBSAS HDD10000rpm24 x 1.2TBSAS HDD10000rpmSizeLD1838 GBLD#15(5 P)4,190 GBLD#2LD#31,024 GB3,166 GBxfsxfs113,404 GBLD#1 129,216 GBLD#13 244,188 GBxfsxfs NEC Corporation 2018LD SizeFSext3vfatext3838 GBswapxfs

2.4.Appliances with 3 internal HDDs and 2 JBODsHANA memory: Up to 6,144 GBHDDsRAIDInternalJBOD2.5.2 x 300GBSAS HDD10000rpm1SizeLD279 GBLD#18 x 1.2TBSAS HDD10000rpm5(7 P)7,819 GB40 x 1.2TBSAS HDD10000rpm1&SW RAID 022,340 GBLD SizeFSext3vfat279 GB ext3swapLD#11,024 GBLD#26,795 GBxfsxfsxfs18,440 GB3,900 GBxfsxfsLD#1 20LD#21 40mount d/backup(free)/hana/data/var/crash(free)FS size1 GB1 GB267 GB10 GB0 GB1,024 GB6,144 GB50 GB601 GB18,432 GB3,892 GB0 GBRestore procedure overviewThe restore procedure exists of the following 3 phases: Boot up to the rescue mode.Restore each volume with the tar command.Reboot server and start SAP HANA.3. Restore procedureIn this chapter a procedure to restore the NEC SAP HANA appliance from an initial backup kepton external USB media is shown.3.1.Boot to rescue modeInsert the RHEL 7 Installation Media and boot from DVD.As soon as the system starts from the DVD the boot menu is displayed. Select the“Troubleshooting” option here:3 NEC Corporation 2018

On the next screen select rescue system:Select option 3) to proceed to the rescue system:Now you will be dropped into a shell.3.2.RestoreIn this chapter you will restore every partition. All commands are valid for all appliance sizes.①Connect the USB device with the initial backup to the NEC SAP HANA appliance.②Check how the device has been identified within the rescue system by typingdmesg tailIn this example the USB memory has been detected as “sdab”.③Create a temporary mount point to attach the USB memory:mkdir /tmp/usbdevice④Mount the USB memory to the mount point created before:mount /dev/sdab1 /tmp/usbdevice4 NEC Corporation 2018

⑤Create a temporary mount point to store the backup data:mkdir /tmp/backup⑥Initialize software raid and lvm:mdadm --assemble --scan –vcat /proc/mdstatThis should activate one software raid:lvm vgscan –vlvm vgchange –a ylvsYou will find the following lvs:⑦Mount backup partition in writeable modemount -o rw –L SYS BACKUP /tmp/backup⑧Verify that the backup data files exist in the correct directoryls -l /tmp/usbdevice efi.tgzhana-shared.tgzhana-data.tgzCopy all tar files to the backup data device to speed up the restore process:cp /tmp/usbdevice/hana-*.tgz /tmp/backup/⑩Create a temporary mount point for every /datamount/tmp/sharedmountTake a note of the UUIDs. You will need them in the next step. Use the command:blkid grep –v SUB5 NEC Corporation 2018

Screenshot from appliance with 8 internal disks⑫ Format partitionsFor appliances with 3 internal disks and 1 JBOD only:Format the following partitions:uEFI Boot(/dev/sda1)Boot(/dev/sda2)OS/AP(/dev/mapper/vg root-lv root)Swap(/dev/mapper/vg root-lv swap)HANA data(/dev/md127)HANA log(/dev/md126)HANA shared (/dev/mapper/vg shared-lv shared)Dump(/dev/mapper/vg shared-lv dump)with the appropriate filesystem and use the previous UUIDs.Attention: You must use the UUIDs you found in the previous step, otherwise yourrecovered system won’t boot correctly!mkfs.vfat /dev/sda1 –i UUID of /dev/sda1 without “-” like 11428CC3 mkfs.ext3 /dev/sda2 –U UUID of /dev/sda2 mkfs.ext3 /dev/mapper/vg root-lv root -L HANA ROOT \–U UUID of /dev/mapper/vg root-lv root mkswap /dev/mapper/vg root-lv swap –L HANA SWAP –U \ UUID of /dev/mapper/vg root-lv swap mkfs.xfs –f /dev/md127 –d su 128k,sw 12,agcount 51 –L HANA DATAmkfs.xfs –f /dev/md126 –d su 64k,sw 12,agcount 51 –L HANA LOGmkfs.xfs -f -d su 256k,sw 12,agcount 49 -L HANA SHARED \/dev/mapper/vg shared-lv sharedmkfs.xfs -f -d su 256k,sw 12,agcount 49 -L KDUMP \/dev/mapper/vg shared-lv dumpxfs admin –U UUID of /dev/md127 /dev/md127xfs admin –U UUID of /dev/md126 /dev/md1266 NEC Corporation 2018

xfs admin –U UUID of /dev/mapper/vg shared-lv shared \/dev/mapper/vg shared-lv sharedxfs admin –U UUID of /dev/mapper/vg dump-lv dump \/dev/mapper/vg shared-lv dumpFor appliances with 8 internal disks and 1 JBOD only:Format the following partitionsuEFI Boot(/dev/sda1)Boot(/dev/sda2)OS/AP(/dev/mapper/vg root-lv root)Swap(/dev/mapper/vg root-lv swap)HANA data(/dev/md127)HANA log(/dev/mapper/vg log-lv log)HANA shared /dev/mapper/vg shared-lv shared)with the appropriate filesystem and use the previous UUIDs.Attention: You must use the UUIDs you found in the previous step, otherwise yourrecovered system won’t boot correctly!mkfs.vfat /dev/sda1 –i UUID of /dev/sda1 without “-” like 11428CC3 mkfs.ext3 /dev/sda2 –U UUID of /dev/sda2 mkfs.ext3 /dev/mapper/vg root-lv root -L HANA ROOT \–U UUID of /dev/mapper/vg root-lv root mkswap /dev/mapper/vg root-lv swap –L HANA SWAP –U \ UUID of /dev/mapper/vg root-lv swap mkfs.xfs –f /dev/md127 –d su 128k,sw 12,agcount 51 –L HANA DATAmkfs.xfs –f /dev/mapper/vg log-lv log –d su 64k,sw 5,agcount 51 \–L HANA LOGmkfs.xfs –f /dev/mapper/vg shared-lv shared –d \su 256k,sw 5,agcount 49 –L HANA SHAREDxfs admin –U UUID of /dev/md127 /dev/md127xfs admin –U UUID of /dev/mapper/vg log-lv log \/dev/mapper/vg log-lv logxfs admin –U UUID of /dev/mapper/vg shared-lv shared \/dev/mapper/vg shared-lv sharedFor appliances with 3 internal disks and 2 JBODs only:Format the following partitions:uEFI Boot(/dev/sda1)Boot(/dev/sda2)OS/AP(/dev/mapper/vg root-lv root)Swap(/dev/mapper/vg root-lv swap)HANA data(/dev/md127)HANA log(/dev/mapper/vg log-lv log)HANA shared (/dev/mapper/vg shared-lv shared)Dump(/dev/mapper/vg dump-lv dump)with the appropriate filesystem and use the previous UUIDs.Attention: You must use the UUIDs you found in the previous step, otherwise yourrecovered system won’t boot correctly!7 NEC Corporation 2018

mkfs.vfat /dev/sda1 –i UUID of /dev/sda1 without “-” like 11428CC3 mkfs.ext3 /dev/sda2 –U UUID of /dev/sda2 mkfs.ext3 /dev/mapper/vg root-lv root -L HANA ROOT \–U UUID of /dev/mapper/vg root-lv root mkswap /dev/mapper/vg root-lv swap –L HANA SWAP –U \ UUID of /dev/mapper/vg root-lv swap mkfs.xfs –f /dev/md127 –d su 128k,sw 20,agcount 51 –L HANA DATAmkfs.xfs –f /dev/mapper/vg log-lv log –d su 64k,sw 7,agcount 51 \–L HANA LOGmkfs.xfs -f -d su 256k,sw 7,agcount 49 -L HANA SHARED \/dev/mapper/vg shared-lv sharedmkfs.xfs -f -d su 256k,sw 20,agcount 51 -L KDUMP \/dev/mapper/vg shared-lv dumpxfs admin –U UUID of /dev/md127 /dev/md127xfs admin –U UUID of /dev/md126 /dev/md126xfs admin –U UUID of /dev/mapper/vg shared-lv shared \/dev/mapper/vg shared-lv sharedxfs admin –U UUID of /dev/mapper/vg dump-lv dump \/dev/mapper/vg shared-lv dump⑬Mount all devices to relevant mount points:mountmountmountmount/dev/sda1 /tmp/bootefimount/dev/sda2 /tmp/bootmount/dev/mapper/vg root-lv root /tmp/osmount/dev/md127 /tmp/datamountmount /dev/mapper/vg log-lv log /tmp/logmountormount /dev/md126 /tmp/logmountmount /dev/mapper/vg shared-lv shared /tmp/sharedmount⑭Change the current directory to “/tmp/bootefimount” and restore the uEFI boot partition:cd /tmp/bootefimounttar -zxvf /tmp/backup/hana-bootefi.tgzVerify if the last operation was successful. The following command should give you a “0”.echo ?⑮Change the current directory to “/tmp/bootmount” and restore the boot partition:cd /tmp/bootmounttar -zxvf /tmp/backup/hana-boot.tgzVerify if the last operation was successful. The following command should give you a “0”.echo ?8 NEC Corporation 2018

⑯Change the current directory to “/tmp/osmount” and restore the OS / AP partition:cd /tmp/osmounttar -zxvf /tmp/backup/hana-root.tgzVerify if the last operation was successful. The following command should give you a “0”.echo ?⑰Change the current directory to “/tmp/datamount” and restore the partition for HANA data:cd /tmp/datamounttar -zxvf /tmp/backup/hana-data.tgzVerify if the last operation was successful. The following command should give you a “0”.echo ?⑱Change the current directory to “/tmp/sharedmount” and restore the partition for HANAshared:cd /tmp/sharedmounttar -zxvf /tmp/backup/hana-shared.tgzVerify if the last operation was successful. The following command should give you a “0”.echo ?⑲Change the current directory to “/tmp/logmount” and restore the HANA log partition:cd /tmp/logmounttar -zxvf /tmp/backup/hana-log.tgzVerify if the last operation was successful. The following command should give you a “0”.echo ?3.3.Reboot and HANA startupAfter the restore finished restart your NEC HANA appliance and start HANA① Reboot your server by typingshutdown –r now②Remove the DVD media before the system boot starts.③Login to the OS, open a terminal and and enter the following commands to start HANA:su - sid admHDB start④Run this command and check its output says “OK” and all listed processes have thestatus ”Green”. If some are still “Initializing”, wait a while and issue the same commandagain:sapcontrol –nr instance no -function GetProcessList9 NEC Corporation 2018

10 NEC Corporation 2018

SAP HANA Restore Guide (for A2040e RH