Problem with restore database on secondary replica - Always On

Miloš Cvjetković 1 Reputation point
2023-01-24T23:09:46.6966667+00:00

Hi,

I have problem with restoring database on secondary replica . I added successfully one database without any problem but with another one, I made full and transaction log backup on primary replica as well. After that I recover those two backups on secondary replica and MS SQL. When I tried to join database to AG, MSSQL refused me with error:

Msg 1412, Level 16, State 211, Line 11

The remote copy of database "****" has not been rolled forward to a point in time that is encompassed in the local copy of the database log.

I followed next procedure:

  1. Remove database from AG on secondary replica.
  2. Delete the removed secondary database from secondary replica;
  3. .Take full and log backup on primary replica;
  4. Restore full backup and log backup with No Recovery on secondary replica. This database is in restoring state.
  5. Add the secondary database to SQL AG;

On first try with one database everything works very well, but when I tried to repeat process with another one I got mentioned error.

Could you give me any hint what I am doing wrong. I was already re-join one database without any problem?

SQL Server Other
{count} votes

1 answer

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,586 Reputation points
    2023-01-25T03:15:10.7066667+00:00

    Hi Miloš Cvjetković,

    You can check this with below query:

    select name, log_reuse_wait_desc from sys.databases
    

    You can post the result of this.

    In order for us to communicate efficiently, you can refer to this article:

    https://omkarclouddba.tech/microsoft-sql-server-error-1412-always-on/

    Best regards,

    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.