If you are not doing this on your HANA DB, then you are not maintaining it well - Download this Now !
How well are you maintaining your database ?
As a database administrator its your job to maintain the database, ensure its cleaned up on periodic basis, but what tools can you use to do this, are u still listing them on your mind ..
Have you heard of Hanacleaner ?
Hanacleaner is a python script database administrator its your job to maintain the database, it can be used to do the following activities.
- Cleanup of backup log entries.
- Cleanup of backups
- Cleanup of trace files
- Cleanup of audit logs
- Cleanup of Free log segments
- Cleanup of Data file fragmentation
- Cleanup of HANA Cleaner logs
- Optimze Compression of tables not compressed
- Optimize compression of tables with columns not compressed
- Cleanup of multiple row store containers
- Optimize compression of tables with large UDIV overhead
- Cleanup of object lock history for '(unknown)' objects
Where Can I download this ?
Setup Steps Overview
- Create a SAP HANA user (for example, DBCLEANER, but you can use a different name) and assign the CATALOG READ privilege.
- Create a user key (for example, SYSTEMKEY, but you can use a different name) in the hdbuserstore.
- Download the hanacleaner.py script from above link.
- Store the script in, for example, the python_support directory.
- As < sid>adm, change to the python_support directory with the command cdpy
a. "python hanacleaner.py -be 20" - Clean up backup catalog entries hat don't be long to the ten newest backups
b."python hanacleaner.py -be 10 -bd 30 -td true" - Clean up backup catalog entries and backups that are older than 30 days and that don't be long to the ten newest backups
c."python hanacleaner.py -tc 42 -tf 42 -ar 42 -bd 42 -zb 50 -eh 2 -eu 42" - Clean up statistics server alerts, traces and backup catalog entries older than 42 days, rename and compress backup.log and backint.log when size exceeds 50 MB, handle / acknowledge events after 2 / 42 days
d."python hanacleaner.py" - No execution of Action
e. "python hanacleaner.py -help" - Help
Lets look it in Action
Hanacleaner needs to connect to database, when you run without providing the key, it will throw error as below
Create the key as below
Command : hdbuserstore SET SYSTEMKEY <hostname>:<sqlport> <user> <password>
List the Key
Command : hdbuserstore LIST
command : python hanacleaner.py -help - The above command list all arguments
Want to Practice this Live ?
Click here to enrol in our HANA Admin course with Live exercises
Try our Simulation Exercise for Free
Click here for a free simulation (Please use chrome / Firefox)
Join our Linkedin Group for Tech and Job update