Skip to end of metadata
Go to start of metadata

SAP MaxDB Network Guide


This section describes tools for checking, whether a proper network connection to a remote SAP MaxDB server can be established.

Before you think about to open a service ticket for the SAP MaxDB Development Support, please make sure, that the network setup meets the requirements for SAP MaxDB as following. See SAP note 1694323 - FAQ: SAP MaxDB Remote SQL Server and DBM Server, Question 6 and 7. In any case, port 7210 must not be blocked.

Often, there are some network restrictions either in corporate intranets or in public cloud offerings. E.g. firewalls or restricted port ranges might be configured in a way to prevent connections to SAP MaxDB databases.

The most important test below is 5. x_ping
Make sure, that
x_ping -n <remote_host>
and
x_ping -n <remote_host> -d <my_database>
both works.

Before a SAP MaxDB can be accessed from a remote host, following conditions should be checked on the database host:

Is sdbgloballistener running?

sdbgloballistener is a SAP MaxDB component, that is mandatory for remote access to SAP MaxDB.

> sdbgloballistener start

should return

<timestamp> 17465 83136 INF 12903 [sdbgloballistener|XServer] on port 7210 started

or

<timestamp> 17477 6976 INF 12916 Found running [sdbgloballistener|XServer] on port 7210


Does a service listen on port 7210?

> netstat -a -n -o | [grep|findstr] 7210

should return

tcp 0 0 0.0.0.0:7210 0.0.0.0:* LISTEN

back to top

General Tools for Accessibility:

1. nslookup <remote_host>

If nslookup cannot resolve the host name, then the remote host cannot be addressed by it's name but only by it's IP address.
Example:

> nslookup <remote_host>
:
Non-authoritative answer:
Name: <remote_host>
Address: 10.126.49.35


2. ping

If ping does not work, it is likely, but not necessary, that a database connect may fail. Sometimes servers are configured to ignore ping packets.

Example:
> ping <remote_host>
Pinging <remote_host> [10.126.49.35] with 32 bytes of data:
Reply from 10.126.49.35: bytes=32 time=26ms TTL=46

3. telnet or ssh to the remote host

> telnet <remote_host>
> ssh <user>@<remote_host>

Nowadays, telnet is often disabled due to security issues. ssh might not be configured.

With telnet, there is an additional option to check the sdbgloballistener on the remote host, where the SAP MaxDB database is running.

> telnet <remote_host> 7210

<input_a_lot_of_characters_with_return>

should return

> telnet <remote_host> 7210
Trying <remote_host>...
Connected to <remote_host>
Escape character is '^]'.
<typed_characters>
.. Connection closed by foreign host.

4. trace route to remote host

> tracert <remote_host> # Windows
> traceroute <remote_host> # Linux/Unix

Example:
traceroute <remote_host>
traceroute to <remote_host> (10.126.49.35), 30 hops max, 60 byte packets
1 some.server.sap.corp (10.19.41.1) 0.648 ms 0.735 ms 0.838 ms
:
18 10.126.49.35 (10.126.49.35) 23.531 ms 25.443 ms 23.398 ms


back to top

SAP MaxDB Specific Tools for Network Checking

The previous tools are general network or remote access tools in order to check some network functionality.
SAP MaxDB contains additional tools for checking the database specific requirements as well:

5. x_ping

With x_ping you can check the connectivity to a host and to a specific database on this host:

Example:
> x_ping -n <remote_host>

Checking connection to '<remote_host>' ... ok.
:


Example:
> x_ping -n <remote_host> -d <my_database>

Pinging <my_database> on <remote_host> with 512 bytes of data over a maximum of 10 hops.

Hop Server
0 XServer
1 <my_database>

<my_database>: reply time=18 ms
:
Approximate round trip times:
Minimum = 18ms, Maximum = 18ms, Average = 18ms


Note: If x_ping with remote host only works as expected, but returns with a database:

> x_ping -n <remote_host> -d <my_database>
Error - 'database not running'

Then some of the needed ports might be blocked. Please check above mentioned note 1694323, Question 6 and 7. In any case, port 7210 must not be blocked.


6. sqlcli

With sqlcli, you can send SQL statements and receive result sets. Therefore, a successful connection with sqlcli guarantees not only a connection to a specific database, but also access to it and the rights to execute SQL. Furthermore, the SQLDBC trace configuration can be tested with sqlcli, as it is based on SAP MaxDB's SQLDBC interface.

Example:

> sqlcli -n <remote_host> -d <my_database> -u <user>,<password>
select now() from dual

If you receive a current timestamp, then all is prepared to use the database for your application.


7. JDBC

It is possible to do a connect test with user and password with the SAP MaxDB JDBC driver:

> java -jar sapdbc.jar -n <remote_host> -d <database> -u <user>,<password
| connect test |
--------------------------
| successfully connected |

Furthermore, the JDBC trace configuration can be tested with above connect test.


8. odbcreg

Under certain circumstances, it might be sensible to establish a connection via SAP MaxDB ODBC.
For Microsoft Windows, odbcreg is the tool needed to register the SAP MaxDB ODBC driver, but can also be used for a test with an SQL statement:
> odbcreg -t <name_of_registered_SAP_MaxDB_ODBC_driver> -q "select now() from dual"

The ODBC connect dialog will pop up. If you fill out server name, database, user and password, the SQL statement will be sent to the database and the result set is printed to the shell.

For Linux/Unix, odbcreg is not needed in order to register a driver. It is statically linked to the SAP MaxDB ODBC driver. The usage is similar:

> odbcreg <remote_host> <database> <user> <password> "select now() from dual"

ODBC Driver test.

Connect string: 'tracefilename=odbcreg.log;SERVERNODE=<remote_host>;SERVERDB=<database>;UID=<user>;PWD=<password>'.
retcode: 0
outString(88): SERVERNODE=10.29.14.78;SERVERNODE=<remote_host>;SERVERDB=<database>;UID=<user>;PWD=<password>;
Driver version 7.9.11.00.
Execute:
select now() from dual
resCols: 1 rowCount: 1
Result set in csv:
EXPRESSION1;

2021-01-28 17:30:34.444671;

Furthermore, the ODBC trace configuration can be tested with above test.


9. isql from unixODBC

Under Linux/Unix, often the ODBC driver manager unixODBC is available. If you want to test the SAP MaxDB ODBC driver, you can use isql. Like before, the ODBC trace set can be checked as in 8.

E.g. in the home directory of the executing user add a DSN to the file .odbc.ini:

[SDB]
Driver=<full_path_to>/libsdbodbcw.so
Description=MaxDB
ServerDB=<database>
ServerNode=<remote_host>


Then you can call
> isql SDB <user> <password>
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> select now() from dual
:

back to top

  • No labels

1 Comment

  1. Muchas gracias, excelente información, en especial para los estamos iniciando con MAXDB.