Home SQL Server 2012 on Windows 2012 - Monitor directory for overwritten files (based on file dates, not being present or for name)
Reply: 0

SQL Server 2012 on Windows 2012 - Monitor directory for overwritten files (based on file dates, not being present or for name)

Ben Roberts
1#
Ben Roberts Published in 2018-02-12 21:15:57Z

Environment:

  • MS SQL 2012 (see below for more granular data)

  • Windows Server 2012

WHAT I WANT:

I’m looking for a way to monitor the directory (maybe with dbo.fc_fileexists?) and when all six of the new files have finished copying over the job will execute. I am looking for a way to do this within SQL.

WHAT I HAVE:

I have a job with 18 steps (verify .bak, restore .bak to DB, shrink log) that uses six SQL .bak files from another server to update existing databases on my server. Each month six new .bak files come into a directory and overwrite the existing files, keeping the same name, only the file date changes. The copy process starts on the last day of the month and runs for about 20-25 hours, depending on network traffic. (There’s nothing I can do about this part, it’s just a preexisting codition.)

SPECIAL CONDITIONS:

  • I can’t delete or rename the files after I’m done because another group uses them as well.
  • My experience is OS, not SQL, I'm learning, so please explain as if to a noob. :)

MY SERVER'S SPECS:

Microsoft SQL Server Management Studio 11.0.7001.0

Microsoft Analysis Services Client Tools 11.0.7001.0

Microsoft Data Access Components (MDAC) 6.3.9600.17415

Microsoft MSXML 3.0 6.0

Microsoft Internet Explorer 9.11.9600.18895

Microsoft .NET Framework 4.0.30319.34209

Operating System 6.3.9600

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.313595 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO