on 07-03-2020 5:36 AM
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=>
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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 .... ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 ?
" 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 :
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.