cancel
Showing results for 
Search instead for 
Did you mean: 

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

former_member635540
Participant
0 Kudos

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=>

VivekSahu
Advisor
Advisor

You asked a question. Don't forget to mark the answer that helped you most as correct. Thanks!

For the readers, before you leave, don't forget to up/down vote the answers. You can vote on the question too.
Thanks!

Accepted Solutions (0)

Answers (4)

Answers (4)

VivekSahu
Advisor
Advisor

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.

former_member635540
Participant
0 Kudos

Hi, Sahu

I have already done your solution, but still with the same error.

That is to say, the recovery always looks for the default local backup logs regardless of specifying only the source backup logs!

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/');

* 448: recovery could not be completed: [2000004] Cannot open file ""<root>/log_backup_2_0_7992832_7992960.1593676030237" ((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

# ls -l /usr/sap/BK2/HDB20/backup/log/DB_BK2/log_backup_2_0_7992832_7992960.1593676030237

-rw-r----- 1 bk2adm sapsys 20480 Jul 2 15:47 /usr/sap/BK2/HDB20/backup/log/DB_BK2/log_backup_2_0_7992832_7992960.1593676030237

VivekSahu
Advisor
Advisor
0 Kudos

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

former_member635540
Participant
0 Kudos

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 .... ?

VivekSahu
Advisor
Advisor
0 Kudos

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.

sumitjais
Active Contributor
0 Kudos

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...."

former_member635540
Participant
0 Kudos

The /usr/sap/BK2/HDB20/backup/log/DB_BK2 is just the default local backup logs on BK2.

And the /hana/BK1_baklog/ is also the local FS on BK2 where the source backup logs on BK1 have also been copied.

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

sumitjais
Active Contributor
0 Kudos

" 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?)