Linux challenged? We are a Windows shop and run SQL Server and Oracle on Windows, so getting used to Lunix has been a challenge for us. What's worse is we are GUI oriented, so even the command line on Windows Server is foreign - but no matter. To help the team get up to speed on Linux and running HANA on AWS, I've compiled a list of "essential" commands that we are using to keep tabs on the system .Use of # means that this is what is typed in at the Linux command line. Commands are shown in Courier font with specific objects shown in italics.
For quick help for commands, type in --help after the command name. Example:
# ls --help
For detailed help on a command, type in man (for manual) before the command. Example:
# man ps
Note, for man pages, type q to quit.
For the command tables below, Linux commands are is case sensitive.
File system commands
ls | List files - like the DOS DIR command -l option shows detail list -al option shows list with hidden items -lS option shows files orders by file size in descending order |
tail | Output the last 10 lines of the file -f option outputs the contents of the file as it grows |
head | Output the first 10 lines of the file |
more | Outputs a file - one page at a time |
cat | Outputs a file with no paging |
rm | Deletes a file or more -r option deletes a directory |
cp | Copies a file to another, example cp file1 file2 |
Process Management
ps | Display user's currently active processes |
top | Displays all running processes - like Windows task manager |
kill pid | Kills the process id pid that is displayed in top |
System Info
su | Switch user - for performing operations on HANA, you need to run # su -l hdbadm This will set up all the environment information and paths to HANA binaries |
df | Shows disk information along with free space -h option displays values in readable format. Developer HANA on AWS uses /dev/md0 - mounted on /sap - make sure this doesn't get above 80% |
free | Shows memory and swap usage |
cat /proc/cpuinfo | Shows CPU information for each processor |
cat /proc/meminfo | Shows memory information |
cat /proc/mdstat | Shows information about the make-up of RAID drives. For the HANA developer on AWS, you'll see that the six EBS drives are configured as RAID0. |
mdadm | Manage MD devices - aka RAID drives. Use the following command to display the status of the main HANA drive. You'll need to run this as the root user. # mdadm --detail /dev/md0 |
Quick and Dirty SAP HANA commands
# su -l hdmadm # ./HDB stop # ./HDB start | Stops and starts the HANA instance. See my blog on why you should stop the HANA instance before stopping the HANA machine on AWS - http://scn.sap.com/community/developer-center/hana/blog/2012/11/26/stop-and-start-rules-for-hana-on-... |
# hdbsql | HANA SQL command line - this is just like SQL Server's SQLCMD. Documentation is located in Chapter 18 of the hana_admin_en.pdf - http://help.sap.com/hana/hana_admin_en.pdf |
# cd $SAP_RETRIEVAL_PATH/trace # ls -ltc | more | Change directory to the HANA instance trace directory and list the trace files in descending changed date order with a pause using the more command. |
# cd $DIR_INSTANCE/exe/python_support # python fullSystemInfoDump.py | Collect the HANA instance diagnostic trace files so that you can analyze them on your Windows machine 🙂 See chapter 16.6 in hana_admin_en.pdf - http://help.sap.com/hana/hana_admin_en.pdf This is useful when we are running workloads that end up crashing the HANA instance. |
Now, for my minor annoyances with SAP HANA. SAP - please create man pages for HANA commands. For example, there is no man page for the hdbsql command, and I find myself having to refer back to the hana_admin_en.pdf file all the time. :sad:
Next time - how to use grep for looking for problems in the trace files with HANA Studio can't connect to the instance.
Also, if you have favorite Linux commands that you find useful for working with HANA, please suggest them via a comment to this blog and I'll update this post to track them.
If you like this blog post and would like to see more - please rate and like the article. :wink: Also, feel free to follow me on Twitter @billramo
Have a Happy New Year!
Bill Ramos
Database Architect
Advaiya Inc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
10 | |
6 | |
4 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 |