Skip to content

Instantly share code, notes, and snippets.

@sapddic
sapddic / ZBASISSEC.sql
Last active March 28, 2024 23:22
HANA Cust_User_admin
CREATE USER CUST_USER_ADMIN PASSWORD "Welcome@Welcome2023" NO FORCE_FIRST_PASSWORD_CHANGE;
ALTER USER CUST_USER_ADMIN DISABLE PASSWORD LIFETIME;
CREATE ROLE ZROLE_NS2_ADMIN_USER_ADMIN_ROLE;
CREATE AUDIT POLICY ZAUDIT_NS2_CUST_USER_ADMIN AUDITING ALL ACTIONS FOR CUST_USER_ADMIN LEVEL INFO;
ALTER AUDIT POLICY ZAUDIT_NS2_CUST_USER_ADMIN ENABLE;
GRANT ZROLE_NS2_ADMIN_USER_ADMIN_ROLE TO CUST_USER_ADMIN;
GRANT USER ADMIN TO ZROLE_NS2_ADMIN_USER_ADMIN_ROLE with ADMIN option;
@sapddic
sapddic / SNC.sh
Last active March 28, 2024 22:55
SNC setup[object Object]
cd $SECUDIR
sapgenpse get_my_name -p SAPSSLS.pse
sapgenpse get_pse -p $SECUDIR/cert.pse -r $SECUDIR/cert.req -a sha256WithRsaEncryption -s 2048 -k GN-dNSName:ns2hsgdb.domain.com "CN=ns2hsgdb.domain.com, O=LMC, OU=Hosting, L=AWS, C=US"
************************************
CN=ACD_SNC.domain.com, OU=Hosting, O=LMC, L = AWS, C=US
p/sapsso:CN=ACD_SNC.domain.com, OU=Hosting, O=LMC, L=AWS, C=US
************************************
# Set below SNC parameters in the Default Profile
@sapddic
sapddic / hostAgentStuff.sh
Created May 13, 2023 06:41 — forked from wuftymerguftyguff/hostAgentStuff.sh
Useful SAP HostAgent commands
#GET A LIST OF INSTANCES
#/usr/sap/hostctrl/exe/saphostctrl -function Listinstances -format Script
#GET A LIST of databases
saphostctrl -nr 99 -function Listdatabases
# manage a db with the host agent
# /usr/sap/hostctrl/exe/saphostctrl -nr 99 -function StopDatabase -dbname NPL -dbtype ada -user sapadm passwd
#query a db with the host agent