Skip to content

Instantly share code, notes, and snippets.

View shaheerxt's full-sized avatar
🎯
Focusing

Shaheer shaheerxt

🎯
Focusing
View GitHub Profile
@shaheerxt
shaheerxt / resettopology.sh
Created February 23, 2021 20:41
reset hana topology data
abcadm@node1:/usr/sap/ABC/HDB01> cdpy
abcadm@node1:/usr/sap/ABC/HDB01/exe/python_support> python landscapeHostConfiguration.py
nameserver node1:30101 not responding.
nameserver node1:30101,node3:30101,node2:30101 not responding.
| Host | Host | Host | Failover | Remove | Storage | Storage | Failover | Failover | NameServer | NameServer | IndexServer | IndexServer | Host | Host | Worker | Worker |
| | Active | Status | Status | Status | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual | Config | Actual |
| | | | | | Partition | Partition | Group | Group | Role | Role | Role | Role | Roles | Roles | Groups | Groups |
| ------| ------ | ------ | -------- | ------ | --------- | --------- | -------- | -------- | ---------- | ---------- | ----------- | ----------- | ------- | ------ | ------- | ------ |
| node1 | no | error | ? | ? | ?
@shaheerxt
shaheerxt / hanaupgradeIssue1.sh
Created February 25, 2021 09:43
HANA Upgrade got stuck?
Installation of version 1.00.122.27.1574236503 is pending (since 2020-09-30T11:50:23+0000) at step 'Starting System'
@shaheerxt
shaheerxt / hanaupgradeIssue1s.sh
Created February 25, 2021 09:45
HANA Upgrade got stuck?
node1:/hana/shared/ABC # ls -alrt
total 40
drwxr-xr-x 3 root root 4096 Sep 30 11:01 ..
dr-xr-x--- 3 abcadm sapsys 4096 Sep 30 11:46 exe
drwxr-xr-x 2 abcadm sapsys 4096 Sep 30 11:49 profile
-rw-r--r-- 1 root root 226 Sep 30 11:50 ABC.hdbinstall
drwxr-x--- 5 abcadm sapsys 4096 Sep 30 11:50 global
drwxr-xr-x 7 root root 4096 Sep 30 11:53 hdblcm
drwxr-xr-x 2 abcadm sapsys 4096 Sep 30 12:17 lm_structure
drwxr-x--- 6 abcadm sapsys 4096 Oct 13 07:15 HDB00
1. CHECK DB VERSION
select * from m_database;
2. CHECK DB SIZE
select now(), current_database() SID, to_decimal(sum(allocated_page_size/1024/1024/1024),10,0) DB_SIZE_GB from M_CONVERTER_STATISTICS;
3. CHECK FOR ORPHANED PERSISTENCE FILES
select vf.* from sys.m_table_virtual_files_ vf where vf.name like 'attribute\_%' escape '\' and vf.COLUMN_NAME='';
--SHOULD RETURN 0 ROWS
--IF ISSUES, PLEASE EXECUTE THE BELOW AS sidADM USER
@shaheerxt
shaheerxt / hanaPluginVersionCheck.sql
Created March 15, 2021 05:20
check sap hana installed plugin details
hdbsql SYSTEMDB=> select plugin_name,value from m_plugin_manifests where KEY = 'fullversion';
| PLUGIN | VALUE |
| ------ | ----------------------------------- |
| AFL | 2.00.054.0000 Build 1611928859-1530 |
| EPMMDS | 1.00.202102.02.1611928859 |
2 rows selected (overall time 9207 usec; server time 2876 usec)
@shaheerxt
shaheerxt / hanaPluginUninstall.sql
Created March 15, 2021 05:34
Uninstall SAP HANA plugin (or) component
/*
make sure you're in resident lcm directory, usually this is under installed shared path
for eg:
/hana/shared/ABC/hdblcm/
for help, execute
./hdblcm --uninstall --components --help
--components=all|<comp1>[,<comp2>]... Specifies the components (afl, client, eml, es, ets, hlm, lcapps, rdsync, rme, rtl,
sca, server, smartda, sop, streaming, studio, trp, xs and others) to be uninstalled
@shaheerxt
shaheerxt / 1_backupUserSetup.sql
Last active March 22, 2021 12:44
Prepare cron scheduled script for HANA backups
--sql commands
//setup user (named backupuser, for backup operations)
//login to SYSTEMDB-> SYSTEM user
create user backupuser password BackupUser1234;
alter user backupuser disable password lifetime;
grant Database backup admin,backup admin, catalog read to backupuser;
alter user backupuser activate;
--bash terminal
#setup userstore key (backupuser as user for backup operations)
--test if private gist can be moved to public
@shaheerxt
shaheerxt / hana_backups_schedule.sql
Created April 6, 2021 19:58
HANA backup scheduling via XS job table
-- query using below command
select * from _SYS_XS.JOB_SCHEDULES;
--Generate insert command from Studio as mentioned in above screenshot.
-- You will have to enter something like below for the FULL backup- happening every saturday 09:21 PM UTC for the database ABC
insert
into "_SYS_XS"."JOB_SCHEDULES" values(3,
'Scheduled_Backup::DataBackup',
'* * * sat 21 19 0',
'SCHEDULE-FULL-BACKUP-ABC',
@shaheerxt
shaheerxt / hana_hsr_setup.sh
Last active November 11, 2021 10:44
SAP HANA HSR Setup
DB name:
ABC
DB Instance No:
01
Site 1 hosts:
site1node1abc.somedomain.com
site1node2abc.somedomain.com
Site 2 hosts:
site2node1abc.somedomain.com
site2node2abc.somedomain.com