Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sap_swpm: hdbuserstore default connection should use sap_swpm_db_schema_abap_password #748

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

rob0d
Copy link
Contributor

@rob0d rob0d commented Jun 5, 2024

issue #747

@sean-freeman sean-freeman changed the title hdbuserstore default connection should use sap_swpm_db_schema_abap_pssword sap_swpm: hdbuserstore default connection should use sap_swpm_db_schema_abap_password Jun 14, 2024
@berndfinger berndfinger self-requested a review June 18, 2024 09:16
Copy link
Member

@berndfinger berndfinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sean-freeman sean-freeman self-requested a review June 24, 2024 11:44
@sean-freeman
Copy link
Member

Requires regression test

@rob0d
Copy link
Contributor Author

rob0d commented Jun 25, 2024

@sean-freeman I tested this on two S/4 installations. Third one will be done this week.
Is this enough or do you want to do your separate regression test?

@berndfinger
Copy link
Member

@rob0d I also just tested this code and the S/4HANA installation went through, as expected. Can you think of, or do you know, an easy way to verify the success? For example, by running hdbuserstore with certain options?

@sean-freeman
Copy link
Member

sean-freeman commented Jul 6, 2024

We should probably add a comment that indicates the @{{ sap_swpm_db_sid }} means this code is only applicable for SAP HANA MDC architecture setup (which is defacto), which should perhaps be a restriction for the sap_swpm Ansible Role when the target installation scenario is using SAP HANA as the RDBMS?

I do not want to slow this PR down any further, as I am very confident @rob0d is correct - running a regression test was for my own sanity. I will test the dev branch in the near future, which will test this PR too.


@berndfinger To answer your validation question, quickly formulated the following from my own debugging notes - it might be useful and @rob0d should confirm

At end of sap_hana_install Ansible Role, could login to <sap_hana_install_sid>adm and run....

/usr/sap/{{ sap_hana_install_sid | upper }}/HDB{{ sap_hana_install_number }}/exe/hdbsql -quiet \
-i {{ sap_hana_install_number }} \
-d SYSTEMDB \ # line added for database name, aka MDC Tenant 'SYSTEMDB'
-u SYSTEM \
-p {{ sap_hana_install_db_system_password | d(sap_hana_install_master_password) }} \
-m <<EOF
SELECT * from M_DATABASES;
EOF

The MDC Tenant (e.g. H01) would not have yet been created by SAP SWPM, so you could not run the following at the end of sap_hana_install Ansible Role but could run at the end of sap_swpm Ansible Role....

/usr/sap/{{ sap_hana_install_sid | upper }}/HDB{{ sap_hana_install_number }}/exe/hdbsql -quiet \
-i {{ sap_hana_install_number }} \
-d {{ sap_hana_install_sid }} \ # line added for database name, aka MDC Tenant Name
-u SYSTEM \
-p {{ sap_hana_install_db_system_password | d(sap_hana_install_master_password) }} \
-m <<EOF
SELECT * from SCHEMAS WHERE SCHEMA_NAME='{{ sap_swpm_db_schema_abap }}';
EOF

At end of sap_swpm Ansible Role, could perhaps login to <sap_swpm_sid>adm and test connection...

# hdbsql test hdbuserstore credentials
hdbsql -U DEFAULT

# SAP Transport binary to test connection to Database
R3trans -d

# ODBC Driver test should not contain "outString(0)L <no out string received from driver>"
# ODBC Driver test should not state "message(....): .... General error;10 authentication failed"
/usr/sap/{{ sap_swpm_sid | upper }}/hdbclient/odbcreg \
{{ sap_swpm_db_host }}:3{{ sap_swpm_db_instance_nr }}13 \
SYSTEMDB \
SYSTEM '{{ sap_swpm_db_systemdb_password }}'

/usr/sap/{{ sap_swpm_sid | upper }}/hdbclient/odbcreg \
{{ sap_swpm_db_host }}:3{{ sap_swpm_db_instance_nr }}13 \
{{ sap_swpm_db_sid }} \
SYSTEM '{{ sap_swpm_db_systemdb_password }}'

/usr/sap/{{ sap_swpm_sid | upper }}/hdbclient/odbcreg \
{{ sap_swpm_db_host }}:3{{ sap_swpm_db_instance_nr }}15 \
SYSTEMDB \
{{ sap_swpm_db_schema_abap }} '{{ sap_swpm_db_schema_abap_password }}'

/usr/sap/{{ sap_swpm_sid | upper }}/hdbclient/odbcreg \
{{ sap_swpm_db_host }}:3{{ sap_swpm_db_instance_nr }}15 \
{{ sap_swpm_db_sid }} \
{{ sap_swpm_db_schema_abap }} '{{ sap_swpm_db_schema_abap_password }}'

@berndfinger
Copy link
Member

I am going to merge this PR despite the alternative approach in #802, and continue the discussion there.

@berndfinger berndfinger merged commit b153be1 into sap-linuxlab:dev Jul 16, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants