cancel
Showing results for 
Search instead for 
Did you mean: 

"how to delete or truncate logs"

0 Kudos

HI

I need to delete or truncate my logs in my HANA One system, as they are full and the HANA instance will no long start.  Can anyone offer any advice on how I would do this please.

thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Lewis,

As per my view, Still are you not able to login to the SAP HANA Studio.

If yes, please you try to move the file using scripts - i.e Cron or putty.


Caution: Do not delete log segments on operating system level, as the log area will become unusable and the database may stop working immediately.


You can release free log segments explicitly using the SQL command ALTER SYSTEM RECLAIM LOG. The ALTER SYSTEM RECLAIM LOG command physically deletes all log segments that are no longer needed.

Follow below steps:

1. Stop the database:
HDB stop

2. Change into the folder mnt00001 of the logvolume (Default: /usr/sap/<SID>/global/hdb/log):
cd /usr/sap/<SID>/global/hdb/log/mnt00001

3. You have to move one of the logvolumes temporarily to another volume where enough space is available. You should free at least 2 GB of space to ensure that the database has enough space to start. To find out the space consumption of each volume execute:
du -sh *

4. Move a volume which consumes at least 2 GB of space (e.g. hdb00003) to a volume with enough free space, e.g. to the data volume (Default: /usr/sap/<SID>/global/hdb/data):
mv hdb00003 /usr/sap/<SID>/global/hdb/data

5. Create a symbolic link to the new folder in the old location:
ln -s /usr/sap/<SID>/global/hdb/data/hdb00003 /usr/sap/<SID>/global/hdb/log/mnt00001/hdb00003

6. Start the database (HDB start) and perform a backup.


7. Wait until log backups are performed.

8. Use the following SQL-Statement to clean up the logvolume:
ALTER SYSTEM RECLAIM LOG;

9. Stop the database again and remove the symbolic link:
rm -f /usr/sap/<SID>/global/hdb/log/mnt00001/hdb00003

11. Move the log volume back to its original location:
mv /usr/sap/<SID>/global/hdb/data/hdb00003 /usr/sap/<SID>/global/hdb/log/mnt00001

12. Start the database (HDB start)

Please let me know if is there any concerns.

Thanks

Earesh

Former Member
0 Kudos

Hi Earesh,

I try to clean up logvolume by ALTER SYSTEM RECLAM LOG;

but these log /usr/sap/<SID>/global/hdb/log/mnt00001 still there, how to delete these logs and free hard drive space.

Thanks,

Jack

Former Member
0 Kudos

Hi Lewis,

Check out this note.  I'm assuming that you are talking about logsegments and not log backups.

1679938 - Log Volume is full

You can use the note for log mode normal as well as legacy.  Hope it helps.

Thanks

Suresh

Former Member
0 Kudos

If you can use studio and connect, please go to Backup section and go to backup (log backups) and delete the backups there.

Or, please follow the sections in HANA Administrative guide for "Backup and Restore section". The steps and the options for the backups are given there.

Former Member
0 Kudos

Also, based on the version etc following link may be very useful. Especially, the section where it says how the logs can grow.

SAP HANA Backup Notes | SCN

0 Kudos

we are not able to connect the HANA studio as the box is now complete  full so HANA will not longer start,  We are planning on adding a new volume to the HANA instance and move file the files  the new location. we this work or this is a bad idea?

Former Member
0 Kudos

If done correctly, the method might work. In the note link I copied in my last reply, there is a small script IF DONE CAREFULLY, can remove old log backups.

But, the settings on Log backups must be changed or proper cleanup of the logs must be done after your instance recovers. We give Bar Chart On the Cosole status page for easy detection of the disk conditions.

On the volume side, please don't modify the volumes of the existing disks. These are MD arrays.