Hello and welcome to the SAP HANA Academy.
You are watching the video tutorial series: Building Solutions - Live 5.
The topic of this video tutorial is Initial Setup - XSUAA MDC tenant trust
Hi, I am Denys van Kempen.
In this video, we are going to establish a trust between the SAP HANA XS advanced User
Account and Authorization service (XSUAA) and the tenant database SHA we created in
a previous video.
Markus Strehle wrote a blog on the SAP Community where he explains that in the first release
of HANA 2 there is no automatic trust between the UAA (User Account and Authorization service)
and MDC (Multitenant Database Containers).
The installation only creates a trust to the system database.
Apparently, the trust creation will be added with HANA 2 SPS01.
We’ll see.
I will put the link to the blog in the description of this video
and for our release, HANA 2 SPS 0 we are going to establish this trust between the tenant
database SHA and the UAA.
We need to download two files:
xsuaa_hdbtrust.sh
and xsuaa_settings.cfg
So, a shell script file and a configuration file.
The script file, we can leave as-is, we only need to make it executable.
The configuration file, we are going to edit for the correct SID, instance number, and
tenant database name.
The source files are in Github, under Markus’ account.
So let’s open that in our browser.
Open the script file.
Click the “Raw” button.
This will give us plain ASCII text,
we can copy and paste without getting any formatting characters.
Ctrl+A (select all), Ctrl+C (copy to clipboard).
Then, open a terminal session to the HANA host.
Connect as hxeadm, just like before.
Change directories to the home directory: cd
Start the vi editor with the file name: xsuaa_hdbtrust.sh
You can use any name you want here, but using a descriptive name probably is not a bad idea,
so we still remember where it’s for in a couple of weeks time
and later on we are going to use exactly the same name when we are running the script you might want to use this name
Maybe not everybody is familiar with the vi editor, so I will explicitly name the commands.
You could create and edit the files on your Windows desktop, of course, and use Filezilla
to FTP them to the HANA server, as well.
We discussed Filezilla and file transfer in a previous video.
Vi lists the file name in the status bar below.
Switch from command mode to insert mode with [ i ] key, lowercase i from insert.
The status bar now mentions INSERT.
Right-click in the window and
this will copy the contents of the clipboard in the file.
Then with the [Esc] key, exit the insert mode.
The status bar no longer displays INSERT and
then we can execute the command, colon w, w for write.
Hit Enter.
The name of the file, number of lines and characters are displayed.
Then with the command colon q, q for qu it, hit enter and exit vi.
For the seasoned vi veteran, this would be
vi file name [Enter] i [Enter]
right-click [Esc] [:wq] [Enter]
So that’s 6 key strokes to create a file. Awesome.
Now, we have a text file.
We need to have a executable script file.
So, with the command chmod, change mode, user + execute, filename, we can do that.
Just type xs and then hit the [Tab] key for command completion.
Then next we have our configuration file.
So, let’s return to Github.
Now, select the configuration file: xsuaa_settings.cfg
Again, click Raw
[Ctrl+A] [Ctrl+C]
back to PuTTY
arrow up, to get our vi command
couple of back spaces, stop at the underscore and type settings.cfg.
Hit enter.
Same sequence: i for insert, right-click to paste.
[Esc] key, don’t forget, to get into command line mode.
:w to write.
So, now we have our configuration file,
we just need to update it a little bit.
Uppercase H, for home, will get us to the first character.
Lowercase ww, twice, will get use to the second word.
Cursor is now on the X
Command dw, shorthand for delete word, all lowercase, will delete the word
Uppercase A will allows us to append.
Note that we are back in INSERT mode now.
Type the name of our instance: HXE, all uppercase.
We can stay in insert mode and use the arrow down and arrow right buttons to navigate to
the first digit of the instance number.
Insert is not delete.
So hit [Escape] to exit insert mode.
Type r, lowercase, to replace and type 9; this will replace the 0 with a 9.
The instance number should now read 90.
Use the arrow button to navigate two lines down.
Uppercase A to append and type uppercase SHA.
Escape.
Next line is a comment.
So we are going to remove the first character, the pound or hash sign
Type x for remove.
The line should now become visible.
If not, and you see an x appear, you are in insert mode. So make sure, you use the escape key
Lowercase w twice will get us on the u of usr.
We need to remove eight characters.
So enter the number 8 and then x, to remove them.
This will execute the x command eight times.
Then four w, three x, i for insert, then type HXE (all uppercase)
Escape
Then comment out the endpoints.
Type i for insert, then enter the pound sign and repeat this for the next line.
Again, if you don't like vi, you can also edit the file with Notepad on Windows
or TextEdit on the Mac
and then use FileZilla to FTP the file over.
Instead of colon w q, write quit, you can do uppercase ZZ.
Saves you a key stroke and does the same thing.
The file xsuaa_settings.cfg is a configuration file, so we do not have to change the mode.
You can use the command 'cat ' to print out the contents, if you want to verify that
you did not make any typo’s.
OK
It is looking good.
Now we are going to execute the command.
If we return to Github and open the commentary file, XSUAA trust md.
Scroll down a bit.
We can see the command.
It is simple.
Script file, configuration file.
The script creates the trust and executes the test.
So just copy the command.
and then switch to PuTTY
and paste it in.
Enter
We are prompted for the password of the SYSTEM user.
This will be the system user of the tenant database SHA.
In the script we used Password1, if you used another password, use that and if you don’t
remember review the video where we created the tenant database.
Maybe it helps.
We have the expected output, see the description on Github, so we are done.
OK
So much for Initial Setup - XSUAA MDC tenant trust.
You can find more video tutorials on our Youtube channel.
If you would like to be informed about new video tutorials, please subscribe to our channel.
You can connect with us on LinkedIn or follow us on Twitter, as well for updates
and we also have a page on Facebook and Google+.
If you are watching this video on YouTube,
do not hesitate to leave your comments to the video page and,
if you like, give us your vote on his video.
Thank you for watching