| |

VerySource

 Forgot password?
 Register
Search
View: 923|Reply: 7

Questions about how to check for backups using stored procedures

[Copy link]

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-3-17 16:00:01
| Show all posts |Read mode
I encountered a problem, how to check the existence of backups using stored procedures.
1.Do not check the content of the backup, just check if it exists (check according to the time of the backup)
2.It is said that SQL has a similar information display function in the stored procedures, but I don't know which one
3.After checking whether it exists, how to return the results and the storage of the results


I don't think I have any ideas. I hope you can help me more. If anything is unclear, I will add it again, thank you all.
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-6-19 19:00:01
| Show all posts
SELECT a.backup_set_id,a.database_name,a.backup_finish_Date,b.physical_device_name
FROM msdb.dbo.backupset a
Left Join msdb.dbo.backupmediafamily b on a.Media_set_id = b.Media_set_id
order by backup_finish_Date Desc
Reply

Use magic Report

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-6-20 18:15:01
| Show all posts
Thank you very much for your help, can you briefly talk about the purpose and general idea of ​​the call, thank you
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-6-22 22:15:01
| Show all posts
Online books Check the backupset and backupmediafamily, there are detailed explanations of the various fields of these two tables, look at it and understand.
Reply

Use magic Report

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-7-22 23:00:01
| Show all posts
I'm very sorry, there is an important detail that is not explained:
That is, the data packages we backed up are all placed on the hard disk with specific paths. There is no existing database or table for operation.
So, I beg you for your help, it seems to use stored procedures, thank you
Reply

Use magic Report

0

Threads

3

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-23 05:30:01
| Show all posts
View Files:

master..xp_cmdshell'dir d:\xxx'

hint!
Reply

Use magic Report

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-7-26 19:00:01
| Show all posts
I still have some questions I want to ask
1. Since we have not established a database for backing up compressed packages, everyone thinks it is necessary to directly query the results or to build a database first
2. After checking whether it exists, how to return the result and store the result

How to solve these problems, I hope everyone can help me, thank you
Reply

Use magic Report

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-7-30 13:45:01
| Show all posts
Switch to DOS operation through xp_cmdshell
Can it be done under DOS: After checking whether it exists, return the result and store the result?
In addition, since we have not established a database for backing up compressed packages, everyone thinks it is necessary to directly query the results or it is necessary to build a database first

Due to the tight time, I hope you can give me some help. Thank you all for your previous suggestions and help.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list