SAP HANA Performance monitoring with Python or SQL scripts?

Office Productivity | SAP
Description
SAP HANA Performance monitoring with python or sql scripts? Any idea how to monitoring SAP HANA...? 
Attachments
No attachments
Info
Description
Use SAP HANA Python Client.

- Install via pip install hdbcli or install manually via the HANA Client Install

Quick Start
from hdbcli import dbapi
conn = dbapi.connect(
    address="<hostname>",
    port=3<NN>MM,
    user="<username>",
    password="<password>"
)
cursor = conn.cursor()

Execute a single statement that does not return a result set:

cursor.execute("CREATE TABLE T1 (ID INTEGER PRIMARY KEY, C2 VARCHAR(255))")
cursor.close()

Use question mark parameter binding to insert values into the T1 table created above. The parameter values are supplied as a Python sequence and can be literal values or variable names. This example uses literal values:

sql = 'INSERT INTO T1 (ID, C2) VALUES (?, ?)'
cursor = conn.cursor()
cursor.execute(sql, (1, 'hello'))
# returns True
cursor.execute(sql, (2, 'hello again'))
# returns True
cursor.close()

Use named parameter binding to insert values into the T1 table. The values are supplied as a Python dictionary, and this example uses variable names.

sql = 'INSERT INTO T1 (ID, C2) VALUES (:id, :c2)'
cursor = conn.cursor()
id = 3
c2 = "goodbye"
cursor.execute(sql, {"id": id, "c2": c2})
# returns True
cursor.close()

Loop over the rows of the result set.
sql = 'SELECT * FROM T1'
cursor = conn.cursor()
cursor.execute(sql)
for row in cursor:
    print(row)


on February 06th, 2020 (9:00 pm)
Description
Other python scripts? Thanks.
on February 16th, 2020 (3:24 pm)
All coments
This job has not been commented yet.


We use cookies to give you the best possible experience on our site. By continuing to use the site you agree to our use of cookies. Find out more Accept