January 22, 2018 at 11:13 am
desiboy102493 - Monday, January 22, 2018 8:44 AMSue_H - Monday, January 22, 2018 8:29 AMdesiboy102493 - Monday, January 22, 2018 8:17 AMSorry for the late response.
when I query the system tables the group id is always 0 for log files
FROM
SYS.Databases S
INNER JOIN dbo.LSDBList LDB
ON S.[name] = LDB.[database]
INNER JOIN sys.sysaltfiles SF
ON S.[database_id] = SF.[dbid]
WHERE SF.groupid <>0 and SF.dbid = @dbid
open cDBFilesSo it would be just 0 for the group id?
Yes. You should look at modifying that script to use sys.master_files since it is the replacement for sys.sysaltfiles.
Sue
Getting this error saying invalid object LSDBlist, however, i created the table already on the MSDB
Thanks
When you get an error like that, it generally means you are not in the correct database or you need to fully qualify the object.
Sue
January 22, 2018 at 12:10 pm
Sue_H - Monday, January 22, 2018 11:13 AMdesiboy102493 - Monday, January 22, 2018 8:44 AMSue_H - Monday, January 22, 2018 8:29 AMdesiboy102493 - Monday, January 22, 2018 8:17 AMSorry for the late response.
when I query the system tables the group id is always 0 for log files
FROM
SYS.Databases S
INNER JOIN dbo.LSDBList LDB
ON S.[name] = LDB.[database]
INNER JOIN sys.sysaltfiles SF
ON S.[database_id] = SF.[dbid]
WHERE SF.groupid <>0 and SF.dbid = @dbid
open cDBFilesSo it would be just 0 for the group id?
Yes. You should look at modifying that script to use sys.master_files since it is the replacement for sys.sysaltfiles.
Sue
Getting this error saying invalid object LSDBlist, however, i created the table already on the MSDB
ThanksWhen you get an error like that, it generally means you are not in the correct database or you need to fully qualify the object.
Sue
I am on the MSDB db that's where I created the table. Not sure what you mean by qualify the object
Thanks.
January 22, 2018 at 12:26 pm
desiboy102493 - Monday, January 22, 2018 12:10 PMSue_H - Monday, January 22, 2018 11:13 AMdesiboy102493 - Monday, January 22, 2018 8:44 AMSue_H - Monday, January 22, 2018 8:29 AMdesiboy102493 - Monday, January 22, 2018 8:17 AMSorry for the late response.
when I query the system tables the group id is always 0 for log files
FROM
SYS.Databases S
INNER JOIN dbo.LSDBList LDB
ON S.[name] = LDB.[database]
INNER JOIN sys.sysaltfiles SF
ON S.[database_id] = SF.[dbid]
WHERE SF.groupid <>0 and SF.dbid = @dbid
open cDBFilesSo it would be just 0 for the group id?
Yes. You should look at modifying that script to use sys.master_files since it is the replacement for sys.sysaltfiles.
Sue
Getting this error saying invalid object LSDBlist, however, i created the table already on the MSDB
ThanksWhen you get an error like that, it generally means you are not in the correct database or you need to fully qualify the object.
Sue
I am on the MSDB db that's where I created the table. Not sure what you mean by qualify the object
Thanks.
Then it does not exist if you are in the correct database and on the correct server where the table was created.
Please note that the table needs to be created on both the primary and secondary.
Make sure you are on the correct server.
Sue
January 22, 2018 at 1:11 pm
Sue_H - Monday, January 22, 2018 12:26 PMdesiboy102493 - Monday, January 22, 2018 12:10 PMSue_H - Monday, January 22, 2018 11:13 AMdesiboy102493 - Monday, January 22, 2018 8:44 AMSue_H - Monday, January 22, 2018 8:29 AMdesiboy102493 - Monday, January 22, 2018 8:17 AMSorry for the late response.
when I query the system tables the group id is always 0 for log files
FROM
SYS.Databases S
INNER JOIN dbo.LSDBList LDB
ON S.[name] = LDB.[database]
INNER JOIN sys.sysaltfiles SF
ON S.[database_id] = SF.[dbid]
WHERE SF.groupid <>0 and SF.dbid = @dbid
open cDBFilesSo it would be just 0 for the group id?
Yes. You should look at modifying that script to use sys.master_files since it is the replacement for sys.sysaltfiles.
Sue
Getting this error saying invalid object LSDBlist, however, i created the table already on the MSDB
ThanksWhen you get an error like that, it generally means you are not in the correct database or you need to fully qualify the object.
Sue
I am on the MSDB db that's where I created the table. Not sure what you mean by qualify the object
Thanks.Then it does not exist if you are in the correct database and on the correct server where the table was created.
Please note that the table needs to be created on both the primary and secondary.
Make sure you are on the correct server.Sue
The table is there
on both servers. Not sure what I am missing.
Thanks.
January 22, 2018 at 1:21 pm
desiboy102493 - Monday, January 22, 2018 1:11 PMThe table is there
on both servers. Not sure what I am missing.
Thanks.
A screenshot doesn't mean anything - you could have however many servers in SSMS so it doesn't mean you are on the correct server. And it doesn't mean you are in the correct database. If the table is there, it's your query. You need to be in the correct server and in the correct database.
If you run this exactly then and you get Invalid Object name, check what server you are connected to. It's not the same as your screenshot:USE msdb
go
SELECT * FROM dbo.LSDBList
Sue
January 22, 2018 at 1:28 pm
Sue_H - Monday, January 22, 2018 1:21 PMdesiboy102493 - Monday, January 22, 2018 1:11 PMThe table is there
on both servers. Not sure what I am missing.
Thanks.A screenshot doesn't mean anything - you could have however many servers in SSMS so it doesn't mean you are on the correct server. And it doesn't mean you are in the correct database. If the table is there, it's your query. You need to be in the correct server and in the correct database.
If you run this exactly then and you get Invalid Object name, check what server you are connected to. It's not the same as your screenshot:USE msdb
go
SELECT * FROM dbo.LSDBListSue
When I run this, i get the following
USE msdb
go
SELECT * FROM dbo.LSDBList
January 22, 2018 at 1:32 pm
desiboy102493 - Monday, January 22, 2018 1:28 PMSue_H - Monday, January 22, 2018 1:21 PMdesiboy102493 - Monday, January 22, 2018 1:11 PMThe table is there
on both servers. Not sure what I am missing.
Thanks.A screenshot doesn't mean anything - you could have however many servers in SSMS so it doesn't mean you are on the correct server. And it doesn't mean you are in the correct database. If the table is there, it's your query. You need to be in the correct server and in the correct database.
If you run this exactly then and you get Invalid Object name, check what server you are connected to. It's not the same as your screenshot:USE msdb
go
SELECT * FROM dbo.LSDBListSue
When I run this, i get the following
USE msdb
go
SELECT * FROM dbo.LSDBList
Then you were NOT running that other query in msdb.
Sue
January 22, 2018 at 1:59 pm
Sue_H - Monday, January 22, 2018 1:32 PMdesiboy102493 - Monday, January 22, 2018 1:28 PMSue_H - Monday, January 22, 2018 1:21 PMdesiboy102493 - Monday, January 22, 2018 1:11 PMThe table is there
on both servers. Not sure what I am missing.
Thanks.A screenshot doesn't mean anything - you could have however many servers in SSMS so it doesn't mean you are on the correct server. And it doesn't mean you are in the correct database. If the table is there, it's your query. You need to be in the correct server and in the correct database.
If you run this exactly then and you get Invalid Object name, check what server you are connected to. It's not the same as your screenshot:USE msdb
go
SELECT * FROM dbo.LSDBListSue
When I run this, i get the following
USE msdb
go
SELECT * FROM dbo.LSDBListThen you were NOT running that other query in msdb.
Sue
u mean this restore script?
January 22, 2018 at 2:25 pm
Sue_H - Monday, January 22, 2018 2:21 PMdesiboy102493 - Monday, January 22, 2018 1:59 PMu mean this restore script?You should go figure it out from the error you reported in your post here:
Post
hmm...it was run under msdb . Have it ob both server (primary and secondary)
and running the restore command on the primary. The error still showing as invalid object 🙁
Thanks
February 4, 2018 at 2:22 am
At my previous job I created a process to logship over 300 prod databases to DR. I don't have scripts handy as it has been a while back. But here are few points.
We were running log dumps every 15 mins. Every 30 mins we kick a job(s) which run on each prod Server(roughly about 20-30 Databases of various sizes on each of the prod Server), which goes thru each tran log dump folder in Prod and copy latest log files to DR, logging each log copy to the table. Few times a day we were restoring logs on about 30 of DR servers by going thru the table( that table was located on DBA monitoring server and was accessible by both Prod and DR Servers), checking what was copied and restoring logs in the proper order....
February 5, 2018 at 9:09 am
barsuk - Sunday, February 4, 2018 2:22 AMAt my previous job I created a process to logship over 300 prod databases to DR. I don't have scripts handy as it has been a while back. But here are few points.
We were running log dumps every 15 mins. Every 30 mins we kick a job(s) which run on each prod Server(roughly about 20-30 Databases of various sizes on each of the prod Server), which goes thru each tran log dump folder in Prod and copy latest log files to DR, logging each log copy to the table. Few times a day we were restoring logs on about 30 of DR servers by going thru the table( that table was located on DBA monitoring server and was accessible by both Prod and DR Servers), checking what was copied and restoring logs in the proper order....
Hey Barsuk, This is exactly what I need to do. Right now I just have a script which generates restore command n then manually run it on the secondary server.
It will be so nice if you can find the script you used and share.
Thanks for your help.
February 7, 2018 at 2:44 am
Those restore commands you need generate and insert into the table at the time of the copy to the secondary. And then instead of running restore commands manually on the secondary server, all you need to do is to loop thru the table by the backup time and execute line by line restore command...
February 7, 2018 at 8:06 am
barsuk - Wednesday, February 7, 2018 2:44 AMThose restore commands you need generate and insert into the table at the time of the copy to the secondary. And then instead of running restore commands manually on the secondary server, all you need to do is to loop thru the table by the backup time and execute line by line restore command...
So I would have to create a custom table on both servers and insert the restore commands?
February 8, 2018 at 12:56 pm
No, there are few ways to do that, but the most easiest way is to created only 1 table on a linked server ( which is accessible by both Prod and DR) so at the time of the copy you will need to create the following columns: Database name, Tran Log Name, Backup Time, Restore Time, Status, Tran Log File name... You can also add from Server Name , To Server Name if necessary. Once again that was the approach I used a while back. You need the Column status which should have the following values: like in progress, success, failed.... Tran Log File name is restore command you can create at the time of the copy dynamically ( we used LiteSpeed at that time) which starts with:
EXEC master.dbo.xp_restore_log......
Viewing 15 posts - 16 through 29 (of 29 total)
You must be logged in to reply to this topic. Login to reply