Skip to Content

How to recovery database logs only with the source backup logs ?

We have two hana 2.0 system hosts:

1) source host for backup: BK1

2) target host for recovery: BK2

Everytime we need to use all the backup (data & logs) on BK1 to recovery on BK2 for test, thus there would be a problem on BK2 itself, that is, BK2 would also generate its own local logs....

So how to recovery database logs on BK2 only with the source BK1 logs ?

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=> RECOVER DATABASE FOR BK2 UNTIL TIMESTAMP '2020-07-02 08:26:59' USING DATA PATH ('/hana/BK1_bakdata/') USING LOG PATH ('/hana/BK1_baklog/');

* 448: recovery could not be completed: [2000004] Cannot open file ""<root>/log_backup_2_0_7992832_7992960.1593633407981" ((closed, mode= R, access= rw-r-----, flags= ASYNC|DIRECT|MUST_EXIST|UNALIGNED_SIZE), factory= (root= "/hana/BK1_baklog" (access= rw-r-----, flags= AUTOCREATE_PATH|DISKFULL_ERROR, usage= LOG_BACKUP, fs= UNSUPPORTED (btrfs), config= (async_write_submit_active=on,async_write_submit_blocks=all,async_read_submit=on,num_submit_queues=1,num_completion_queues=1, size_kernel_io_queue=512,max_parallel_io_requests=64,min_submit_batch_size=16,max_submit_batch_size=64))", rc=2: No such file or directory SQLSTATE: HY000

hdbsql SYSTEMDB=>

hdbsql SYSTEMDB=>

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Jul 03 at 05:47 AM

    Hello,

    Firstly from error message :
    * 448: recovery could not be completed: [2000004] Cannot open file ""<root>/log_backup_2_0_7992832_7992960.1593633407981" ((closed, mode= R, access= rw-r-----, flags= ASYNC|DIRECT|MUST_EXIST|UNALIGNED_SIZE), factory= (root= "/hana/BK1_baklog" (access= rw-r-----, flags= AUTOCREATE_PATH|DISKFULL_ERROR, usage= LOG_BACKUP, fs= UNSUPPORTED (btrfs), config= (async_write_submit_active=on,async_write_submit_blocks=all,async_read_submit=on,num_submit_queues=1,num_completion_queues=1, size_kernel_io_queue=512,max_parallel_io_requests=64,min_submit_batch_size=16,max_submit_batch_size=64))", rc=2: No such file or directory SQLSTATE: HY000

    Please check, if you have above mentioned log files present or not. If present check for permissions on this log file, and also into the path if it has access or not.

    Secondly, you mentioned that : "thus there would be a problem on BK2 itself, that is, BK2 would also generate its own local logs....",
    So, BK2 will generate it's own logs during recovery (into online log directory /hana/log/BK2) and that can be adjusted via sufficing "CLEAR LOG" into your recovery command. Like below :
    hdbsql SYSTEMDB=> RECOVER DATABASE FOR BK2 UNTIL TIMESTAMP '2020-07-02 08:26:59' CLEAR LOG CHANGE ALL DATA USING PATH ('/hana/BK1_bakdata/') CHANGE ALL LOG USING PATH ('/hana/BK1_baklog/'');

    Try above corrections and your recovery shall work fine.

    Add a comment
    10|10000 characters needed characters exceeded

    • Hello,

      fs= UNSUPPORTED (btrfs)

      I think, you have mounted shares from BK1 server to BK2 and somehow it is now allowing to read the log files of BK1.
      For safe side, I would recommend if you can copy the log files locally in BK2 server to some location where you do not have any space constraints. Give them permission of 775, including the directory and try recover again.

      Best Regards,
      Vivek Sahu

  • Posted on Jul 03 at 05:28 AM

    Could you confirm the availability of the files at /hana/BK1_baklog/ and their permission to access from BK2. Give the permission 775 to them and try again.

    Could you please rephrase the query on recovery " there would be a problem on BK2 itself, that is, BK2 would also generate its own local logs...."

    Add a comment
    10|10000 characters needed characters exceeded

    • " But why the recovery of the source backup data can work fine with the same local FS(/hana) on BK2 ?"

      Didn't get the question. Do you mean recovery should not work from (/hana/...) i.e. any location other than /usr/...? The recovery can work from any path you mention in your RECOVER DATABASE query provided :

      • The files are available in the path. (/hana/BK1_baklog/)
      • The path is reachable from the logged in user (bk2adm)
      • The entire path (including the sub directories) have proper permission to access the files.( What's the permission for BK1_baklog and the files within?)
  • Posted on Jul 03 at 11:30 AM

    Also, BTRFS is not the official supported file system for HANA systems. Supported file systems for HANA:

    • XFS
    • EXT3
    • GPFS
    • NFS
    • OCFS2

    SAP Note 405827 and 2714556 are already providing the information for unsupported BTRFS.

    Kindly improve your HANA servers with above mentioned FS types.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 06 at 02:58 AM

    I sunddenly realize that there should be a big important problem for the recovery database commands!

    Everytime the timestamps of the local logs on BK2 to be required would obviously be later than the timestamp specified by until time with recovery database!

    RECOVER DATABASE FOR BK2 UNTIL TIMESTAMP '2020-07-03 11:25:59' CLEAR LOG CHANGE ALL DATA USING PATH ('/hana/BK1_bakdata/') CHANGE ALL LOG USING PATH ('/hana/BK1_baklog/');

    * 448: recovery could not be completed: [2000004] Cannot open file ""<root>/log_backup_3_0_229636160_229636288.1593761050973" ((closed, mode= R, access= rw-r-----, flags= ASYNC|DIRECT|MUST_EXIST|UNALIGNED_SIZE),

    ls -ltr /usr/sap/BK2/HDB20/backup/log/DB_BK2/log_backup_3_0_229636160_229*

    -rw-r----- 1 bk2adm sapsys 20480 Jul 3 15:24 /usr/sap/BK2/HDB20/backup/log/DB_BK2/log_backup_3_0_229636160_229636288.1593761050973

    So it seems that such recovery database could not be supported in the different system hosts .... ?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.