SAP HANA Restore Guide A2040d RHEL

Transcription

SAP HANA Restore Guide(for A2040d RHEL)23rd of January 2017NEC SAP Global 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 Technical Operations Manual (TOM)・SAP HANA Database Administration GuideThe above documents are available from the following site, be sure to checkhttp://help.sap.com/hana appliance2. 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 (up to 1TB)HDDsRAIDInternal2 x 300GB( 1 spare)1JBOD24 x 600GB12.3.SizeLDLD SizeFSext3vfat279 GBLD#1279 GBext3swapLD#1 12 3.120 GB xfsLD#13 24 1.044 GB xfsxfs12 x 558GBLD#25 3xfs2.532 GB6xfsHDDsRAIDSizeLDLD Size2 x 900GB1838GBLD#1838 GB4190GBLD#2LD#3LD#41.024 GB2.048 GB1,118 GB6 x 900GB 5(5 P)2FS size1 GB1 GB267 GB10 GB3.120 GB1.044 GB1.024 GB50 GB1.024 GB434 GBDevicesda2sda1lv rootlv swaplv datalv loglv sharedlv backuplv dumpAppliances with 8 internal HDDs (up to 2TB)InternalJBODmount hared/backup/var/crash(free)24 x600GB112 x558GB NEC Corporation 2017LD#1 12 12 x 558GBFSext3vfatext3swapxfsmount og/hana/shared/var/crash/hana/data(free)FS size1 GB1 GB776 GB10 GB50 v rootlv swaplv backuplv loglv sharedlv dumplv data

2.4.Appliances with 8 internal HDDs (up to 4TB)HDDsRAIDSizeLD2 x 1.2TB11,117 GBLD#1FSext3vfatext31.117 GBswapxfsmount point/boot/boot/efi/swap/backup6 x 1.2TB5(5 P)5,585 GBLD#2LD#31.024 GB4.096 GBxfsxfsLD#1 12 12x1,024 GBLD#13 2412x93 GBxfsxfs/hana/log1.024/hana/shared 4.096(free)465/hana/data 12.288/var/crash1,11624 x 1.2TB112x1,117GBInternalJBOD2.5.LD SizeFS size1 GB1 GB955 GB10 GB150 GBGBGBGBGBGBDevicesda2sda1lv rootlv swaplv backuplv loglv sharedlv datalv dumpRestore 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 2017

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 2017

⑤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 them in the next step. Use the command:blkid grep –v SUB5 NEC Corporation 2017

Screenshot from appliance with 8 internal disks⑫Format partitionsFor appliances with 3 internal disks only:Format the following partitions uEFI Boot (/dev/sda2), Boot (/dev/sda1), OS/AP (lv root),HANA data (lv data), HANA log (lv log) and HANA shared (lv shared) with the appropriatefilesystem 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 12,agcount 51 \–L HANA LOGmkfs.xfs –f /dev/mapper/vg shared-lv shared –d \su 256k,sw 12,agcount 49 –L HANA SHAREDmkfs.xfs –f /dev/mapper/vg dump-lv dump –d \su 256k,sw 12,agcount 49 –L KDUMPxfs 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 sharedxfs admin –U UUID of /dev/mapper/vg dump-lv dump \/dev/mapper/vg dump-lv dump6 NEC Corporation 2017

For appliances with 8 internal disks only:Format the following partitions uEFI Boot (/dev/sda2), Boot (/dev/sda1), OS/AP (lv root),HANA data (lv data), HANA log (lv log) and HANA shared (lv shared) with the appropriatefilesystem 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 sharedAttention: For a 2TB appliance change sw 12 to sw 5 in the following command(sw 12 fits for a 4TB appliance):mkfs.xfs –f /dev/mapper/vg dump-lv dump –d \su 256k,sw 12,agcount 51 –L KDUMPxfs admin –U UUID of /dev/mapper/vg dump-lv dump \/dev/mapper/vg dump-lv dump⑬Mount all devices to relevant mount points:mountmountmountmountmountmount⑭/dev/sda1 /tmp/bootefimount/dev/sda2 /tmp/bootmount/dev/mapper/vg root-lv root /tmp/osmount/dev/md127 /tmp/datamount/dev/mapper/vg log-lv log /tmp/logmount/dev/mapper/vg shared-lv shared /tmp/sharedmountChange 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 ?⑯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 ?7 NEC Corporation 2017

⑰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 GetProcessList8 NEC Corporation 2017

Insert 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: HDDs RAID Size LD LD Size FS mount point FS size Device ext3 /boot 1 GBsda2 vfat /boot/efi 1 GBsda1 ext3 / 955 GB