SAPDB on DebianIntroduction: This Howto is meant to get you up to speed quickly with SAPDB on Linux. It is not a replacement for other more detailed howtos or the reference documentation. I tested this with the tgz package of SAPDB version 7.3.0.18 on Debian Linux (Potato and Woody). Important note: I haven't been using SAPDB for a while, so I did not keep up with recent changes. Here's an improved version of my script with fixes for SAPDB 7.4 sent to me by Bastian Mathes. I don't know how all this applies to the the successor MaxDB. Another note: There is an unofficial Debian package, as well. This will be easier to install. The information on this page might still be helpfull, especially the administration script. A note for RPM people: You can use the information and scripts on this page with the rpm packages (e.g. on RedHat or SuSE) as well. You will need to choose the block of path variables in the headers of the supplied scripts that is commented out. To install just download the rpm packages and do the usual rpm -i sapdb*.rpm and continue with the command line section. Preliminaries: On the Woody release of Debian you need to install the old version of the C++ libraries with apt-get install libstdc++2.9-glibc2.1. Installation:
What the script basically does is to create a group called sapdb and a user called sapdb. Most files are installed unter /usr/sapdb, some configuration files are in /usr/spool/sql. The file /etc/services has new entries for the SAPDB ports (sql6 7210/tcp and sql30 7200/tcp). If you want to know more about all the folders and files, see this howto. You can also install everything under /usr/local/sapdb: It's a little bit more typing during the install and you have to adjust the paths in the script below. Command line: The most important command line tools for SAPDB are dbmcli and repmcli. You should always run them as the user sapdb. To have easy access, add /usr/sapdb/indep_prog/bin:/usr/sapdb/depend/bin to your PATH. Call them with -h to view the main options. sapdbadmin.sh: To simplify many common actions and demonstrate the capabilities of the command line tools I wrote a script called sapdbadmin.sh which is based on the create_demo_db.sh script usually included in SAPDB. Raimund Jacob contributed some enhancements. If you have more improvements I would be glad if you send me a patch so others can profit from it. The top section of the script contains many options that you can edit for your preferences, the most importants options are the database name, the database size, the directories for the database files and the database user names and passwords. All size parameters can be specified in pages (p), KB (k), MB (m) and GB (g). You can also place these options in the file ~/.sapdbadminrc if you don't want to edit the original script. You can then call the script with these options:
The load/save options use DATALOAD and DATAEXTRACT commands of repmcli. This is definitely worth looking up in the docs because repmcli can do far more powerful things.
Here the TABLELOAD, TABLEEXTRACT, CATALOGLOAD and CATALOGEXTRACT commands are used.
These two options are mostly for showing how it is done. In real life you should definitely read the documentation and find out what kind of backup is best for you. If anybody has some ideas how to make this more flexible, especially with incremental backups, please mail me. The script writes a very detailed logfile in the current directory that you should consult first if something goes wrong. Startup: Once you have created a database to play around with you may want to start it up automatically. Here's an init script. On Debian you have to
It can also start up the webtools described next: Webtools: The SAPDB webtools are a very nice webinterfaces for database administration. Installation:
the webtools are installed into /usr/sapdb/web. In the configuration file /usr/spool/sql/ini/WebAgent73.ini you can change the port, the number of threads and the names of the log files. To get them working I also had to add /usr/sapdb/web/lib to /etc/ld.so.conf and call ldconfig. You can now start the webtools with wahttp in /usr/sapdb/web/pgm. Point your browser at localhost:9999/webdbm and log in as the dbm user or at localhost:9999/websql as the database user. The browser needs to accept cookies. DbVisualizer: Another nice way to access the database is the Java program DbVisualizer. You need a Java 2 VM, I had to edit the file dbvis.lax after installation to tell it where it is, because it was using the 1.1.x version. If you have it running you need to tell it where the JDBC driver is. Add /usr/sapdb/depend/misc/sapdbc.jar and click on Find JDBC driver. Finally you need to add a database connection. For the driver URL you can choose the MySQL template and replace the mysql with sapdb. Troubleshooting: In case of problems you should take a look into the directory /usr/sapdb/indep_data/wrk especially the files repserver.log and vserver.log. In the subdirectories for the database instances you should look at knldiag.* and knltrace. What you may find will be helpful when asking questions to the mailinglist. Sometimes I was stuck because I couldn't delete a database but couldn't create it either because the software said it existed. In this case it helps to delete everything starting with the database name in /usr/sapdb/indep_data/config/ and /usr/local/sapdb/indep_data/wrk/ and delete the para for the database in /usr/spool/sql/ini/SAP_DBTech.ini in the section [Databases]. Programming: To get started with programming, take a look at the first steps documentation usually included with SAPDB. It has examples for Java, Perl and PHP. You can also use Python, C, C++. More information: If you want to get deeper into SAPDB, the documentation at sapdb.org is a good companion. Also very helpful might be the glossary. The HTML documentation can also be downloaded as a tar archive from the FTP server. For the purpose of having a printout there are many PDFs available. | |||||||||||||||||||||||||