Showing posts with label folder. Show all posts
Showing posts with label folder. Show all posts

Thursday, March 29, 2012

Backup File I/o Error

Guys,

Apologies if this is in the wrong section. I have a SQL 2000 database which I backup to a folder on the hard disk using the following command in a Server Agent:

BACKUP DATABASE [Multilog] TO DISK = N'C:\MSSQL7\BACKUP\multilog_backup' WITH INIT , NOUNLOAD , NAME = N'Multilog backup', NOSKIP , STATS = 10, NOFORMAT

Recently it has been failing with the following error message:

Nonrecoverable I/O error occurred on file 'C:\Multilog Database Files\Data\MultiLog_data.MDF'. [SQLSTATE 42000] (Error 3271) Backup or restore operation terminating abnormally. [SQLSTATE 42000] (Error 3013). The step failed.

Any idea what could be causing this?

Any help would be greatly appreciated.

Sean.

Try some of the method(s) in the following kb:

http://support.microsoft.com/default.aspx/kb/904804

Is this an SP4 server? Looks like it may have been upgraded from SQL 7.0, is that correct?

|||

Chad,

Just noticed the following error on the logs:

I/O error 23(Data error (cyclic redundancy check).) detected during read of BUF pointer = 0x14243d80, page ptr = 0x1607c000, pageid = (0x1:0x1ae), dbid = 5, status = 0x801, file = C:\Multilog Database Files\Data\MultiLog_data.MDF..

Would this indicate a fault with the actual database file? Any idea what could be done to check and fix?

|||

Yeah, that would indicate a data integrity issue within your DB file. Try running a DBCC CHECKDB on the database in question and see what you get for output. Depending on the output of that, you could try using the FIX options with the CHECKDB command, rebuilding indexes, etc.

Backup failure

All,
I am receiving the following error when I try to backup to tape from SQL using backup under the Management folder in Enterprise manager. Logged in as administrator. Can backup the pubs, Northwind and master databases with no problem.
The database is approx. 8.5GB and the tape can hold 40GB formatted. Using option to overwrite and initialize.
Microsoft SQL-DMO (ODBC SQLState: 42000)
Write on '\\.\Tape0' failed, status = 1117. See the SQL Server error log for more details, backup database is terminating abnormally.
In the error log;
Internal I/O request 0x075CB728: op: write, pBuffer: 0x07d3000, size: 65536, position: 11141120, UMS: internal: 0xC0000185, internalhigh: 0x10000, offset: 0xAA0000, offsethigh: 0x0, m_buf: 0x07d30000, m_len: 65536, m_actualbytes: 65536, m_errcode: 1117, b
ackupfile: \\.\Tape0
Any thought would be appreciated.
Regards,
Dave
can you back it up to disk instead of to tape?
can you backup a large file from disk to tape?
I will do it this way because backup done faster and eliminating the hassle
of dealing with the tape drive.
my 0.02
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:C1CCFEFC-AD93-4715-919F-C468273BD974@.microsoft.com...
> All,
> I am receiving the following error when I try to backup to tape from SQL
using backup under the Management folder in Enterprise manager. Logged in as
administrator. Can backup the pubs, Northwind and master databases with no
problem.
> The database is approx. 8.5GB and the tape can hold 40GB formatted. Using
option to overwrite and initialize.
> Microsoft SQL-DMO (ODBC SQLState: 42000)
> Write on '\\.\Tape0' failed, status = 1117. See the SQL Server error log
for more details, backup database is terminating abnormally.
> In the error log;
> Internal I/O request 0x075CB728: op: write, pBuffer: 0x07d3000, size:
65536, position: 11141120, UMS: internal: 0xC0000185, internalhigh: 0x10000,
offset: 0xAA0000, offsethigh: 0x0, m_buf: 0x07d30000, m_len: 65536,
m_actualbytes: 65536, m_errcode: 1117, backupfile: \\.\Tape0
> Any thought would be appreciated.
> Regards,
> Dave

Backup failure

All,
I am receiving the following error when I try to backup to tape from SQL usi
ng backup under the Management folder in Enterprise manager. Logged in as ad
ministrator. Can backup the pubs, Northwind and master databases with no pro
blem.
The database is approx. 8.5GB and the tape can hold 40GB formatted. Using op
tion to overwrite and initialize.
Microsoft SQL-DMO (ODBC SQLState: 42000)
Write on '\\.\Tape0' failed, status = 1117. See the SQL Server error log for
more details, backup database is terminating abnormally.
In the error log;
Internal I/O request 0x075CB728: op: write, pBuffer: 0x07d3000, size: 65536,
position: 11141120, UMS: internal: 0xC0000185, internalhigh: 0x10000, offse
t: 0xAA0000, offsethigh: 0x0, m_buf: 0x07d30000, m_len: 65536, m_actualbytes
: 65536, m_errcode: 1117, b
ackupfile: \\.\Tape0
Any thought would be appreciated.
Regards,
Davecan you back it up to disk instead of to tape?
can you backup a large file from disk to tape?
I will do it this way because backup done faster and eliminating the hassle
of dealing with the tape drive.
my 0.02
"David" <anonymous@.discussions.microsoft.com> wrote in message
news:C1CCFEFC-AD93-4715-919F-C468273BD974@.microsoft.com...
> All,
> I am receiving the following error when I try to backup to tape from SQL
using backup under the Management folder in Enterprise manager. Logged in as
administrator. Can backup the pubs, Northwind and master databases with no
problem.
> The database is approx. 8.5GB and the tape can hold 40GB formatted. Using
option to overwrite and initialize.
> Microsoft SQL-DMO (ODBC SQLState: 42000)
> Write on '\\.\Tape0' failed, status = 1117. See the SQL Server error log
for more details, backup database is terminating abnormally.
> In the error log;
> Internal I/O request 0x075CB728: op: write, pBuffer: 0x07d3000, size:
65536, position: 11141120, UMS: internal: 0xC0000185, internalhigh: 0x10000,
offset: 0xAA0000, offsethigh: 0x0, m_buf: 0x07d30000, m_len: 65536,
m_actualbytes: 65536, m_errcode: 1117, backupfile: \\.\Tape0
> Any thought would be appreciated.
> Regards,
> Davesql

Backup fails with Operating system error 33

Backing up a large '78 GB' database to a compressed folder
gives this error: BackupMedium::ReportIoError: write
failure on backup device '*replaced file name here*.BAK'.
Operating system error 33(The process cannot access the
file because another process has locked a portion of the
file.). The BAK file size should be about 66 GB. This
backup works if the target is an uncompressed folder on
the same drive, and it did work the first time it was used
to the compressed drive. The system reports over 100 GB
free space on this drive.Have a look at the KB article:
INF: SQL Server Databases Not Supported on Compressed Volumes
# 231347
http://support.microsoft.com/?id=231347
--
Mike Epprecht, Microsoft SQL Server MVP
Epprecht Consulting (PTY) LTD
Johannesburg, South Africa
Mobile: +27-82-552-0268
IM: mike@.NOSPAMepprecht.net
Specialist SQL Server Solutions and Consulting
"Warren" <bauerwa@.wsdot.wa.gov> wrote in message
news:00ef01c3d947$a43136e0$a601280a@.phx.gbl...
> Backing up a large '78 GB' database to a compressed folder
> gives this error: BackupMedium::ReportIoError: write
> failure on backup device '*replaced file name here*.BAK'.
> Operating system error 33(The process cannot access the
> file because another process has locked a portion of the
> file.). The BAK file size should be about 66 GB. This
> backup works if the target is an uncompressed folder on
> the same drive, and it did work the first time it was used
> to the compressed drive. The system reports over 100 GB
> free space on this drive.sql

Tuesday, March 20, 2012

Backup DB on compressed folder

Hi I have a very strange case here.
Currently our db server is short of space and as a temp solution database is backed up to a compressed folder. OS is W2K advanced Edition and SQL is Enterprise version. Database is 62GB now. every time Db backup fails after backup running for 2hrs and hal
f. the error msg says that "18210 :
BackupMedium::ReportIoError: write failure on backup device 'd:\mssql\backup\DataDMP01.BAK'. Operating system error 33(The process cannot access the file because another process has locked a portion of the file.)."
we have tried another file name or rebooting the server, but none helps.
I doubt that compressed fold causes the problem or exceeds the file size limit, but can not find any clue on it.
Pls help.
thanks for reply.
George
Compressed drives are not supported for sql server databases and to the best
of my knowledge backups either. If you are low on disk space I would
suggest using a product such as SQL LiteSpeed.
Andrew J. Kelly SQL MVP
"george" <georgey@.cryptologic.com> wrote in message
news:D916C3F2-92F3-405C-9951-39D3E1D095CC@.microsoft.com...
> Hi I have a very strange case here.
> Currently our db server is short of space and as a temp solution database
is backed up to a compressed folder. OS is W2K advanced Edition and SQL is
Enterprise version. Database is 62GB now. every time Db backup fails after
backup running for 2hrs and half. the error msg says that "18210 :
> BackupMedium::ReportIoError: write failure on backup device
'd:\mssql\backup\DataDMP01.BAK'. Operating system error 33(The process
cannot access the file because another process has locked a portion of the
file.)."
> we have tried another file name or rebooting the server, but none helps.
> I doubt that compressed fold causes the problem or exceeds the file size
limit, but can not find any clue on it.
> Pls help.
> thanks for reply.
> George

Backup DB on compressed folder

Hi I have a very strange case here.
Currently our db server is short of space and as a temp solution database is
backed up to a compressed folder. OS is W2K advanced Edition and SQL is Ent
erprise version. Database is 62GB now. every time Db backup fails after back
up running for 2hrs and hal
f. the error msg says that "18210 :
BackupMedium::ReportIoError: write failure on backup device 'd:\mssql\backup
\DataDMP01.BAK'. Operating system error 33(The process cannot access the fil
e because another process has locked a portion of the file.)."
we have tried another file name or rebooting the server, but none helps.
I doubt that compressed fold causes the problem or exceeds the file size lim
it, but can not find any clue on it.
Pls help.
thanks for reply.
GeorgeCompressed drives are not supported for sql server databases and to the best
of my knowledge backups either. If you are low on disk space I would
suggest using a product such as SQL LiteSpeed.
Andrew J. Kelly SQL MVP
"george" <georgey@.cryptologic.com> wrote in message
news:D916C3F2-92F3-405C-9951-39D3E1D095CC@.microsoft.com...
> Hi I have a very strange case here.
> Currently our db server is short of space and as a temp solution database
is backed up to a compressed folder. OS is W2K advanced Edition and SQL is
Enterprise version. Database is 62GB now. every time Db backup fails after
backup running for 2hrs and half. the error msg says that "18210 :
> BackupMedium::ReportIoError: write failure on backup device
'd:\mssql\backup\DataDMP01.BAK'. Operating system error 33(The process
cannot access the file because another process has locked a portion of the
file.)."
> we have tried another file name or rebooting the server, but none helps.
> I doubt that compressed fold causes the problem or exceeds the file size
limit, but can not find any clue on it.
> Pls help.
> thanks for reply.
> George

Back-up DB but keep the files for 3 days?

Hi
I have created a job to backup all our database. It works fine and creates .bak files in default folder. I have scheduled the task to run every 4 hours.

My question is how can i modify or program this backup plan to keep the backup files for only last 3 days and delete older backup files?

Mits

That's simple. I assume you are using SQL Server 2000.
If so, in Enterprise Manager, Expand Management node, select Database Maintenance plans.
Right click the maintenance plan and select properties.
Go to the complete backup tab.
Change the "Remove files older than" option to read 3 days and click ok.

Hope that Helps.

|||

A few questions for you to think about if you haven't already:

Are the backups stored on a different physical drive than the databases? If not then they absolutely should be.|||

Yes, it's simple in SQL Server 2000. It's not simple at all in SQL Server 2005. We have just recently set up our first few SQL 2005 systems, and I cannot find any way to do this (remove older backup files) using the Database Maintenance Wizard, or Database Maintenance plans in general. There is a database maintenance task called "Cleanup History," but when looking deeper into this task all it does is called a system stored procedure msdb.dbo.sp_delete_backuphistory. When looking at the code for this stored procedure, it does indeed clean out the history in the msdb tables, but it doesn't reach out to the filesystem where the backup files are created and remove the older ones.

This functionality, which worked so wonderfully in SQL Server 2000 and was so central to plans involving backups staged to disk before moving them to tape, appears to have been removed in SQL Server 2005. I cannot understand why this would be so, and I hope that I am wrong and just missing something here.

I too would like to know if there is a mechanism for automatic removal of older backup files in SQL 2005.

|||

Matt Fraser wrote:

Yes, it's simple in SQL Server 2000. It's not simple at all in SQL Server 2005. We have just recently set up our first few SQL 2005 systems, and I cannot find any way to do this (remove older backup files) using the Database Maintenance Wizard, or Database Maintenance plans in general. There is a database maintenance task called "Cleanup History," but when looking deeper into this task all it does is called a system stored procedure msdb.dbo.sp_delete_backuphistory. When looking at the code for this stored procedure, it does indeed clean out the history in the msdb tables, but it doesn't reach out to the filesystem where the backup files are created and remove the older ones.

This functionality, which worked so wonderfully in SQL Server 2000 and was so central to plans involving backups staged to disk before moving them to tape, appears to have been removed in SQL Server 2005. I cannot understand why this would be so, and I hope that I am wrong and just missing something here.

I too would like to know if there is a mechanism for automatic removal of older backup files in SQL 2005.


Matt,

I discovered this issue as well with SQL 2005, and I am perplexed as to why we have a way to back up databases but no way to manage the retention of old backups which can cause our disks to fill up. As a workaround I found this script on the web and use it to delete backup files older than "x" days, and it has worked flawlessly from the first time I started using it.

There are a few different ways to implement this workaround, but I have found the easiest way to is to copy the code below into a Notepad and save it as a .vbs file in the root of your backup drive, you might name the file something like DeleteOldBackups.vbs. This way you would simply create a Scheduled Task that points to this file and set the task to run either before or after all of your backups complete.

Make sure you set the directory paths and number of days to meet your needs.


Option Explicit
on error resume next
Dim oFSO
Dim sDirectoryPath
Dim oFolder
Dim oFileCollection
Dim oFile
Dim iDaysOld

'Delete database backup files older than 5 days
iDaysOld = 4
Set oFSO = CreateObject("Scripting.FileSystemObject")
sDirectoryPath = ".\databackups"
set oFolder = oFSO.GetFolder(sDirectoryPath)
set oFileCollection = oFolder.Files

'If database backup files are older than 5 days, delete them.
For each oFile in oFileCollection
If oFile.DateLastModified < (Date() - iDaysOld) Then
oFile.Delete(True)
End If
Next

'Delete database log file backups older than 5 days
iDaysOld = 4
Set oFSO = CreateObject("Scripting.FileSystemObject")
sDirectoryPath = ".\logfilebackups"
set oFolder = oFSO.GetFolder(sDirectoryPath)
set oFileCollection = oFolder.Files

'If database log file backups are older than 5 days, delete them.
For each oFile in oFileCollection
If oFile.DateLastModified < (Date() - iDaysOld) Then
oFile.Delete(True)
End If
Next

'Clean up
Set oFSO = Nothing
Set oFolder = Nothing
Set oFileCollection = Nothing
Set oFile = Nothing

This has worked great for me, hopefully it will be useful to you and others as well.

|||Thank you everyone for you responses and i like the idea of script and i honestly agree with Matt Fraser.

I am using SQL Server 2005 Enterprise Edition.

I have had it working on SQL Server 2000 using a batch file using following command and this batch file was scheduled to run on sepecific time of the day. This will backup DB and Log files.

SQLMAINT -D DBName -BkUpDB E:\SQLBKUP -BkUpMedia DISK -DelBkUps 3days -VrfyBackup

The backup is taken on a shared Drive on the DB Server which will be backed up in the overall daily backup plan on tape. So everyday on tape, we will have the backup of last 3 days and we dont have to use hard disk space.

Regarding disaster recovery - we literally cant have any downtime from monday to saturday, but, couple of hours on Sunday could be arranged. Backup time is about 10-15 mins.

Yes I regularly restore the backups to check the validity.

I am quiet sure that this batch file will work for SQL Server 2005, but i not particularly keen on using batch file(and if i have to, i will use it). I want to do it through Maintenance Plan.

Mits

|||

I also use script to achieve this at my customers (WMI/VB Script). It's much more flexible and you can code it to do what you want. I've done a few custom versions, if, for example, they want to keep N number of fulls, and only a certain number of days worth of transaction logs, etc.

It works very well, but as you hint at Mits, it is outside the control of SQL Server.

|||

I did some digging and I found out that there is in fact a way to delete old backup files within the SQL management studio. I was told this functionality was going to be added with SP1 and apparently it was, just not where I expected to find it. I haven't had a chance to test it very much so I'm going to continue running my VB Script, but it is there.

Basically there are two ways to create backup jobs for your databases from within the SQL management studio Maintenence Plan area, manually or by using the wizard. If you choose to create your backup plans manually you will see the functionality to delete old backups right away, but here is how I found it because I always like to use the wizard instead.

In the SQL management studio under maintenence plans, right click maintenence plans and select the wizard. Follow the wizard all the way through to create your backup plan, you will not see any option to delete backup files older than "x" days, at the end save your backup plan.

Once your backup plan is visible under maintenence plans, right click it, and click on modify, this will open your backup plan in what appears to be a development environment window and you will see several boxes connected to each other with either green or blue arrows. Look down in the lower left hand corner and you will see a toolbox with about eight different components in it.

Select the component called Maintenence Cleanup History and drag it onto the page with your other boxes. Right click this new box and click edit, when it opens up you will see options to delete backup files older than x days. You can configure it, and then you will need to connect it to the other boxes and save the plan and then run it to test it. I tried it a couple of times and couldn't get it to work so I will have to keep testing it.

The ability to delete old backup files does exit, just not where I thought I would find it.

|||thank you very much andy
I try adding cleanup history step and see if i can get it working.

Mits
|||

Well done, Andy. It seems that SP1 did in fact add this functionality, but the Wizard hasn't been updated yet to include it. So, the key is to add the step for "Maintenance Cleanup Task," recognizing that it's different from "History Cleanup Task" (which is included in the Wizard).

I've added it to my maintenance plan, and in about a week's time I should know if it's working properly.

|||

This appears to work, but I won't be able to tell until tonight since Microsoft has removed the ability to delete files older than x hours. Only days, weeks, months, and years. I always used hours because of variations in backup duration. If a backup had the time of 8:01 one night and 8:00 the next, I would end up with both on the drive if I picked the 1 day option. I always used 23 hours to avoid the drive filling up. It appears that option is gone. Grrrrr! It is annoying to have a feature that you use and rely on only to have it removed.

Microsoft, please add back the hours option in a service pack.

|||

I think the frustration expressed in this thread is entirely justified and I'll ensure that the tools team here sees this.

As added weight, please go to connect.microsoft.com and give this feedback - this will open issues directly in our bug database and you will get feedback from the relevant teams.

Thanks

|||

Thanks for the suggestion! I didn't know about that site. I see a closed item where the response was that "hours" would come back as a duration in SP2. I voted for that and the open item about the same issue.

I also authored an item to make the cleanup task available through the wizard as it was in SQL2000.

Thanks for taking time to listen to our concerns and point me to the right forum for airing them. Your responsiveness does your employer proud.

|||how can I set the schedule of backup as follows using Maintenance Job.

I want to run the backup plan ever 285 mins or 4.75 hours starting at 8.15 in the morning and finishing at 9.15 at night.

I have tried but it wont let me put anything more then 60 mins or 4.75 hours.

Mits
|||

In sql2005 the retention period comes as common sql server setting.when check properties of sql server in database setting you have option to set retention period

Back-up DB but keep the files for 3 days?

Hi
I have created a job to backup all our database. It works fine and creates .bak files in default folder. I have scheduled the task to run every 4 hours.

My question is how can i modify or program this backup plan to keep the backup files for only last 3 days and delete older backup files?

Mits

That's simple. I assume you are using SQL Server 2000.
If so, in Enterprise Manager, Expand Management node, select Database Maintenance plans.
Right click the maintenance plan and select properties.
Go to the complete backup tab.
Change the "Remove files older than" option to read 3 days and click ok.

Hope that Helps.

|||

A few questions for you to think about if you haven't already:

Are the backups stored on a different physical drive than the databases? If not then they absolutely should be.|||

Yes, it's simple in SQL Server 2000. It's not simple at all in SQL Server 2005. We have just recently set up our first few SQL 2005 systems, and I cannot find any way to do this (remove older backup files) using the Database Maintenance Wizard, or Database Maintenance plans in general. There is a database maintenance task called "Cleanup History," but when looking deeper into this task all it does is called a system stored procedure msdb.dbo.sp_delete_backuphistory. When looking at the code for this stored procedure, it does indeed clean out the history in the msdb tables, but it doesn't reach out to the filesystem where the backup files are created and remove the older ones.

This functionality, which worked so wonderfully in SQL Server 2000 and was so central to plans involving backups staged to disk before moving them to tape, appears to have been removed in SQL Server 2005. I cannot understand why this would be so, and I hope that I am wrong and just missing something here.

I too would like to know if there is a mechanism for automatic removal of older backup files in SQL 2005.

|||

Matt Fraser wrote:

Yes, it's simple in SQL Server 2000. It's not simple at all in SQL Server 2005. We have just recently set up our first few SQL 2005 systems, and I cannot find any way to do this (remove older backup files) using the Database Maintenance Wizard, or Database Maintenance plans in general. There is a database maintenance task called "Cleanup History," but when looking deeper into this task all it does is called a system stored procedure msdb.dbo.sp_delete_backuphistory. When looking at the code for this stored procedure, it does indeed clean out the history in the msdb tables, but it doesn't reach out to the filesystem where the backup files are created and remove the older ones.

This functionality, which worked so wonderfully in SQL Server 2000 and was so central to plans involving backups staged to disk before moving them to tape, appears to have been removed in SQL Server 2005. I cannot understand why this would be so, and I hope that I am wrong and just missing something here.

I too would like to know if there is a mechanism for automatic removal of older backup files in SQL 2005.


Matt,

I discovered this issue as well with SQL 2005, and I am perplexed as to why we have a way to back up databases but no way to manage the retention of old backups which can cause our disks to fill up. As a workaround I found this script on the web and use it to delete backup files older than "x" days, and it has worked flawlessly from the first time I started using it.

There are a few different ways to implement this workaround, but I have found the easiest way to is to copy the code below into a Notepad and save it as a .vbs file in the root of your backup drive, you might name the file something like DeleteOldBackups.vbs. This way you would simply create a Scheduled Task that points to this file and set the task to run either before or after all of your backups complete.

Make sure you set the directory paths and number of days to meet your needs.


Option Explicit
on error resume next
Dim oFSO
Dim sDirectoryPath
Dim oFolder
Dim oFileCollection
Dim oFile
Dim iDaysOld

'Delete database backup files older than 5 days
iDaysOld = 4
Set oFSO = CreateObject("Scripting.FileSystemObject")
sDirectoryPath = ".\databackups"
set oFolder = oFSO.GetFolder(sDirectoryPath)
set oFileCollection = oFolder.Files

'If database backup files are older than 5 days, delete them.
For each oFile in oFileCollection
If oFile.DateLastModified < (Date() - iDaysOld) Then
oFile.Delete(True)
End If
Next

'Delete database log file backups older than 5 days
iDaysOld = 4
Set oFSO = CreateObject("Scripting.FileSystemObject")
sDirectoryPath = ".\logfilebackups"
set oFolder = oFSO.GetFolder(sDirectoryPath)
set oFileCollection = oFolder.Files

'If database log file backups are older than 5 days, delete them.
For each oFile in oFileCollection
If oFile.DateLastModified < (Date() - iDaysOld) Then
oFile.Delete(True)
End If
Next

'Clean up
Set oFSO = Nothing
Set oFolder = Nothing
Set oFileCollection = Nothing
Set oFile = Nothing

This has worked great for me, hopefully it will be useful to you and others as well.

|||Thank you everyone for you responses and i like the idea of script and i honestly agree with Matt Fraser.

I am using SQL Server 2005 Enterprise Edition.

I have had it working on SQL Server 2000 using a batch file using following command and this batch file was scheduled to run on sepecific time of the day. This will backup DB and Log files.

SQLMAINT -D DBName -BkUpDB E:\SQLBKUP -BkUpMedia DISK -DelBkUps 3days -VrfyBackup

The backup is taken on a shared Drive on the DB Server which will be backed up in the overall daily backup plan on tape. So everyday on tape, we will have the backup of last 3 days and we dont have to use hard disk space.

Regarding disaster recovery - we literally cant have any downtime from monday to saturday, but, couple of hours on Sunday could be arranged. Backup time is about 10-15 mins.

Yes I regularly restore the backups to check the validity.

I am quiet sure that this batch file will work for SQL Server 2005, but i not particularly keen on using batch file(and if i have to, i will use it). I want to do it through Maintenance Plan.

Mits

|||

I also use script to achieve this at my customers (WMI/VB Script). It's much more flexible and you can code it to do what you want. I've done a few custom versions, if, for example, they want to keep N number of fulls, and only a certain number of days worth of transaction logs, etc.

It works very well, but as you hint at Mits, it is outside the control of SQL Server.

|||

I did some digging and I found out that there is in fact a way to delete old backup files within the SQL management studio. I was told this functionality was going to be added with SP1 and apparently it was, just not where I expected to find it. I haven't had a chance to test it very much so I'm going to continue running my VB Script, but it is there.

Basically there are two ways to create backup jobs for your databases from within the SQL management studio Maintenence Plan area, manually or by using the wizard. If you choose to create your backup plans manually you will see the functionality to delete old backups right away, but here is how I found it because I always like to use the wizard instead.

In the SQL management studio under maintenence plans, right click maintenence plans and select the wizard. Follow the wizard all the way through to create your backup plan, you will not see any option to delete backup files older than "x" days, at the end save your backup plan.

Once your backup plan is visible under maintenence plans, right click it, and click on modify, this will open your backup plan in what appears to be a development environment window and you will see several boxes connected to each other with either green or blue arrows. Look down in the lower left hand corner and you will see a toolbox with about eight different components in it.

Select the component called Maintenence Cleanup History and drag it onto the page with your other boxes. Right click this new box and click edit, when it opens up you will see options to delete backup files older than x days. You can configure it, and then you will need to connect it to the other boxes and save the plan and then run it to test it. I tried it a couple of times and couldn't get it to work so I will have to keep testing it.

The ability to delete old backup files does exit, just not where I thought I would find it.

|||thank you very much andy
I try adding cleanup history step and see if i can get it working.

Mits
|||

Well done, Andy. It seems that SP1 did in fact add this functionality, but the Wizard hasn't been updated yet to include it. So, the key is to add the step for "Maintenance Cleanup Task," recognizing that it's different from "History Cleanup Task" (which is included in the Wizard).

I've added it to my maintenance plan, and in about a week's time I should know if it's working properly.

|||

This appears to work, but I won't be able to tell until tonight since Microsoft has removed the ability to delete files older than x hours. Only days, weeks, months, and years. I always used hours because of variations in backup duration. If a backup had the time of 8:01 one night and 8:00 the next, I would end up with both on the drive if I picked the 1 day option. I always used 23 hours to avoid the drive filling up. It appears that option is gone. Grrrrr! It is annoying to have a feature that you use and rely on only to have it removed.

Microsoft, please add back the hours option in a service pack.

|||

I think the frustration expressed in this thread is entirely justified and I'll ensure that the tools team here sees this.

As added weight, please go to connect.microsoft.com and give this feedback - this will open issues directly in our bug database and you will get feedback from the relevant teams.

Thanks

|||

Thanks for the suggestion! I didn't know about that site. I see a closed item where the response was that "hours" would come back as a duration in SP2. I voted for that and the open item about the same issue.

I also authored an item to make the cleanup task available through the wizard as it was in SQL2000.

Thanks for taking time to listen to our concerns and point me to the right forum for airing them. Your responsiveness does your employer proud.

|||how can I set the schedule of backup as follows using Maintenance Job.

I want to run the backup plan ever 285 mins or 4.75 hours starting at 8.15 in the morning and finishing at 9.15 at night.

I have tried but it wont let me put anything more then 60 mins or 4.75 hours.

Mits
|||

In sql2005 the retention period comes as common sql server setting.when check properties of sql server in database setting you have option to set retention period

sql

Back-up DB but keep the files for 3 days?

Hi
I

have created a job to backup all our database. It works fine and

creates .bak files in default folder. I have scheduled the task to run

every 4 hours.

My question is how can i modify or program this

backup plan to keep the backup files for only last 3 days and delete

older backup files?

Mits

That's simple. I assume you are using SQL Server 2000.
If so, in Enterprise Manager, Expand Management node, select Database Maintenance plans.
Right click the maintenance plan and select properties.
Go to the complete backup tab.
Change the "Remove files older than" option to read 3 days and click ok.

Hope that Helps.

|||

A few questions for you to think about if you haven't already:

Are the backups stored on a different physical drive than the databases? If not then they absolutely should be.|||

Yes, it's simple in SQL Server 2000. It's not simple at all in SQL Server 2005. We have just recently set up our first few SQL 2005 systems, and I cannot find any way to do this (remove older backup files) using the Database Maintenance Wizard, or Database Maintenance plans in general. There is a database maintenance task called "Cleanup History," but when looking deeper into this task all it does is called a system stored procedure msdb.dbo.sp_delete_backuphistory. When looking at the code for this stored procedure, it does indeed clean out the history in the msdb tables, but it doesn't reach out to the filesystem where the backup files are created and remove the older ones.

This functionality, which worked so wonderfully in SQL Server 2000 and was so central to plans involving backups staged to disk before moving them to tape, appears to have been removed in SQL Server 2005. I cannot understand why this would be so, and I hope that I am wrong and just missing something here.

I too would like to know if there is a mechanism for automatic removal of older backup files in SQL 2005.

|||

Matt Fraser wrote:

Yes, it's simple in SQL Server 2000. It's not simple at all in SQL Server 2005. We have just recently set up our first few SQL 2005 systems, and I cannot find any way to do this (remove older backup files) using the Database Maintenance Wizard, or Database Maintenance plans in general. There is a database maintenance task called "Cleanup History," but when looking deeper into this task all it does is called a system stored procedure msdb.dbo.sp_delete_backuphistory. When looking at the code for this stored procedure, it does indeed clean out the history in the msdb tables, but it doesn't reach out to the filesystem where the backup files are created and remove the older ones.

This functionality, which worked so wonderfully in SQL Server 2000 and was so central to plans involving backups staged to disk before moving them to tape, appears to have been removed in SQL Server 2005. I cannot understand why this would be so, and I hope that I am wrong and just missing something here.

I too would like to know if there is a mechanism for automatic removal of older backup files in SQL 2005.


Matt,

I discovered this issue as well with SQL 2005, and I am perplexed as to why we have a way to back up databases but no way to manage the retention of old backups which can cause our disks to fill up. As a workaround I found this script on the web and use it to delete backup files older than "x" days, and it has worked flawlessly from the first time I started using it.

There are a few different ways to implement this workaround, but I have found the easiest way to is to copy the code below into a Notepad and save it as a .vbs file in the root of your backup drive, you might name the file something like DeleteOldBackups.vbs. This way you would simply create a Scheduled Task that points to this file and set the task to run either before or after all of your backups complete.

Make sure you set the directory paths and number of days to meet your needs.


Option Explicit
on error resume next
Dim oFSO
Dim sDirectoryPath
Dim oFolder
Dim oFileCollection
Dim oFile
Dim iDaysOld

'Delete database backup files older than 5 days
iDaysOld = 4
Set oFSO = CreateObject("Scripting.FileSystemObject")
sDirectoryPath = ".\databackups"
set oFolder = oFSO.GetFolder(sDirectoryPath)
set oFileCollection = oFolder.Files

'If database backup files are older than 5 days, delete them.
For each oFile in oFileCollection
If oFile.DateLastModified < (Date() - iDaysOld) Then
oFile.Delete(True)
End If
Next

'Delete database log file backups older than 5 days
iDaysOld = 4
Set oFSO = CreateObject("Scripting.FileSystemObject")
sDirectoryPath = ".\logfilebackups"
set oFolder = oFSO.GetFolder(sDirectoryPath)
set oFileCollection = oFolder.Files

'If database log file backups are older than 5 days, delete them.
For each oFile in oFileCollection
If oFile.DateLastModified < (Date() - iDaysOld) Then
oFile.Delete(True)
End If
Next

'Clean up
Set oFSO = Nothing
Set oFolder = Nothing
Set oFileCollection = Nothing
Set oFile = Nothing

This has worked great for me, hopefully it will be useful to you and others as well.

|||Thank you everyone for you responses and i like the idea of script and i honestly agree with Matt Fraser.

I am using SQL Server 2005 Enterprise Edition.

I have had it working on SQL Server 2000 using a batch file using following command and this batch file was scheduled to run on sepecific time of the day. This will backup DB and Log files.

SQLMAINT -D DBName -BkUpDB E:\SQLBKUP -BkUpMedia DISK -DelBkUps

3days -VrfyBackup

The backup is taken on a shared Drive on the DB Server which will be backed up in the overall daily backup plan on tape. So everyday on tape, we will have the backup of last 3 days and we dont have to use hard disk space.

Regarding disaster recovery - we literally cant have any downtime from monday to saturday, but, couple of hours on Sunday could be arranged. Backup time is about 10-15 mins.

Yes I regularly restore the backups to check the validity.

I am quiet sure that this batch file will work for SQL Server 2005, but i not particularly keen on using batch file(and if i have to, i will use it). I want to do it through Maintenance Plan.

Mits|||

I also use script to achieve this at my customers (WMI/VB Script). It's much more flexible and you can code it to do what you want. I've done a few custom versions, if, for example, they want to keep N number of fulls, and only a certain number of days worth of transaction logs, etc.

It works very well, but as you hint at Mits, it is outside the control of SQL Server.

|||

I did some digging and I found out that there is in fact a way to delete old backup files within the SQL management studio. I was told this functionality was going to be added with SP1 and apparently it was, just not where I expected to find it. I haven't had a chance to test it very much so I'm going to continue running my VB Script, but it is there.

Basically there are two ways to create backup jobs for your databases from within the SQL management studio Maintenence Plan area, manually or by using the wizard. If you choose to create your backup plans manually you will see the functionality to delete old backups right away, but here is how I found it because I always like to use the wizard instead.

In the SQL management studio under maintenence plans, right click maintenence plans and select the wizard. Follow the wizard all the way through to create your backup plan, you will not see any option to delete backup files older than "x" days, at the end save your backup plan.

Once your backup plan is visible under maintenence plans, right click it, and click on modify, this will open your backup plan in what appears to be a development environment window and you will see several boxes connected to each other with either green or blue arrows. Look down in the lower left hand corner and you will see a toolbox with about eight different components in it.

Select the component called Maintenence Cleanup History and drag it onto the page with your other boxes. Right click this new box and click edit, when it opens up you will see options to delete backup files older than x days. You can configure it, and then you will need to connect it to the other boxes and save the plan and then run it to test it. I tried it a couple of times and couldn't get it to work so I will have to keep testing it.

The ability to delete old backup files does exit, just not where I thought I would find it.

|||thank you very much andy
I try adding cleanup history step and see if i can get it working.

Mits|||

Well done, Andy. It seems that SP1 did in fact add this functionality, but the Wizard hasn't been updated yet to include it. So, the key is to add the step for "Maintenance Cleanup Task," recognizing that it's different from "History Cleanup Task" (which is included in the Wizard).

I've added it to my maintenance plan, and in about a week's time I should know if it's working properly.

|||

This appears to work, but I won't be able to tell until tonight since Microsoft has removed the ability to delete files older than x hours. Only days, weeks, months, and years. I always used hours because of variations in backup duration. If a backup had the time of 8:01 one night and 8:00 the next, I would end up with both on the drive if I picked the 1 day option. I always used 23 hours to avoid the drive filling up. It appears that option is gone. Grrrrr! It is annoying to have a feature that you use and rely on only to have it removed.

Microsoft, please add back the hours option in a service pack.

|||

I think the frustration expressed in this thread is entirely justified and I'll ensure that the tools team here sees this.

As added weight, please go to connect.microsoft.com and give this feedback - this will open issues directly in our bug database and you will get feedback from the relevant teams.

Thanks

|||

Thanks for the suggestion! I didn't know about that site. I see a closed item where the response was that "hours" would come back as a duration in SP2. I voted for that and the open item about the same issue.

I also authored an item to make the cleanup task available through the wizard as it was in SQL2000.

Thanks for taking time to listen to our concerns and point me to the right forum for airing them. Your responsiveness does your employer proud.

|||how can I set the schedule of backup as follows using Maintenance Job.

I want to run the backup plan ever 285 mins or 4.75 hours starting at 8.15 in the morning and finishing at 9.15 at night.

I have tried but it wont let me put anything more then 60 mins or 4.75 hours.

Mits|||

In sql2005 the retention period comes as common sql server setting.when check properties of sql server in database setting you have option to set retention period

Back-up DB but keep the files for 3 days?

Hi
I

have created a job to backup all our database. It works fine and

creates .bak files in default folder. I have scheduled the task to run

every 4 hours.

My question is how can i modify or program this

backup plan to keep the backup files for only last 3 days and delete

older backup files?

Mits

That's simple. I assume you are using SQL Server 2000.
If so, in Enterprise Manager, Expand Management node, select Database Maintenance plans.
Right click the maintenance plan and select properties.
Go to the complete backup tab.
Change the "Remove files older than" option to read 3 days and click ok.

Hope that Helps.

|||

A few questions for you to think about if you haven't already:

Are the backups stored on a different physical drive than the databases? If not then they absolutely should be.|||

Yes, it's simple in SQL Server 2000. It's not simple at all in SQL Server 2005. We have just recently set up our first few SQL 2005 systems, and I cannot find any way to do this (remove older backup files) using the Database Maintenance Wizard, or Database Maintenance plans in general. There is a database maintenance task called "Cleanup History," but when looking deeper into this task all it does is called a system stored procedure msdb.dbo.sp_delete_backuphistory. When looking at the code for this stored procedure, it does indeed clean out the history in the msdb tables, but it doesn't reach out to the filesystem where the backup files are created and remove the older ones.

This functionality, which worked so wonderfully in SQL Server 2000 and was so central to plans involving backups staged to disk before moving them to tape, appears to have been removed in SQL Server 2005. I cannot understand why this would be so, and I hope that I am wrong and just missing something here.

I too would like to know if there is a mechanism for automatic removal of older backup files in SQL 2005.

|||

Matt Fraser wrote:

Yes, it's simple in SQL Server 2000. It's not simple at all in SQL Server 2005. We have just recently set up our first few SQL 2005 systems, and I cannot find any way to do this (remove older backup files) using the Database Maintenance Wizard, or Database Maintenance plans in general. There is a database maintenance task called "Cleanup History," but when looking deeper into this task all it does is called a system stored procedure msdb.dbo.sp_delete_backuphistory. When looking at the code for this stored procedure, it does indeed clean out the history in the msdb tables, but it doesn't reach out to the filesystem where the backup files are created and remove the older ones.

This functionality, which worked so wonderfully in SQL Server 2000 and was so central to plans involving backups staged to disk before moving them to tape, appears to have been removed in SQL Server 2005. I cannot understand why this would be so, and I hope that I am wrong and just missing something here.

I too would like to know if there is a mechanism for automatic removal of older backup files in SQL 2005.


Matt,

I discovered this issue as well with SQL 2005, and I am perplexed as to why we have a way to back up databases but no way to manage the retention of old backups which can cause our disks to fill up. As a workaround I found this script on the web and use it to delete backup files older than "x" days, and it has worked flawlessly from the first time I started using it.

There are a few different ways to implement this workaround, but I have found the easiest way to is to copy the code below into a Notepad and save it as a .vbs file in the root of your backup drive, you might name the file something like DeleteOldBackups.vbs. This way you would simply create a Scheduled Task that points to this file and set the task to run either before or after all of your backups complete.

Make sure you set the directory paths and number of days to meet your needs.


Option Explicit
on error resume next
Dim oFSO
Dim sDirectoryPath
Dim oFolder
Dim oFileCollection
Dim oFile
Dim iDaysOld

'Delete database backup files older than 5 days
iDaysOld = 4
Set oFSO = CreateObject("Scripting.FileSystemObject")
sDirectoryPath = ".\databackups"
set oFolder = oFSO.GetFolder(sDirectoryPath)
set oFileCollection = oFolder.Files

'If database backup files are older than 5 days, delete them.
For each oFile in oFileCollection
If oFile.DateLastModified < (Date() - iDaysOld) Then
oFile.Delete(True)
End If
Next

'Delete database log file backups older than 5 days
iDaysOld = 4
Set oFSO = CreateObject("Scripting.FileSystemObject")
sDirectoryPath = ".\logfilebackups"
set oFolder = oFSO.GetFolder(sDirectoryPath)
set oFileCollection = oFolder.Files

'If database log file backups are older than 5 days, delete them.
For each oFile in oFileCollection
If oFile.DateLastModified < (Date() - iDaysOld) Then
oFile.Delete(True)
End If
Next

'Clean up
Set oFSO = Nothing
Set oFolder = Nothing
Set oFileCollection = Nothing
Set oFile = Nothing

This has worked great for me, hopefully it will be useful to you and others as well.

|||Thank you everyone for you responses and i like the idea of script and i honestly agree with Matt Fraser.

I am using SQL Server 2005 Enterprise Edition.

I have had it working on SQL Server 2000 using a batch file using following command and this batch file was scheduled to run on sepecific time of the day. This will backup DB and Log files.

SQLMAINT -D DBName -BkUpDB E:\SQLBKUP -BkUpMedia DISK -DelBkUps

3days -VrfyBackup

The backup is taken on a shared Drive on the DB Server which will be backed up in the overall daily backup plan on tape. So everyday on tape, we will have the backup of last 3 days and we dont have to use hard disk space.

Regarding disaster recovery - we literally cant have any downtime from monday to saturday, but, couple of hours on Sunday could be arranged. Backup time is about 10-15 mins.

Yes I regularly restore the backups to check the validity.

I am quiet sure that this batch file will work for SQL Server 2005, but i not particularly keen on using batch file(and if i have to, i will use it). I want to do it through Maintenance Plan.

Mits|||

I also use script to achieve this at my customers (WMI/VB Script). It's much more flexible and you can code it to do what you want. I've done a few custom versions, if, for example, they want to keep N number of fulls, and only a certain number of days worth of transaction logs, etc.

It works very well, but as you hint at Mits, it is outside the control of SQL Server.

|||

I did some digging and I found out that there is in fact a way to delete old backup files within the SQL management studio. I was told this functionality was going to be added with SP1 and apparently it was, just not where I expected to find it. I haven't had a chance to test it very much so I'm going to continue running my VB Script, but it is there.

Basically there are two ways to create backup jobs for your databases from within the SQL management studio Maintenence Plan area, manually or by using the wizard. If you choose to create your backup plans manually you will see the functionality to delete old backups right away, but here is how I found it because I always like to use the wizard instead.

In the SQL management studio under maintenence plans, right click maintenence plans and select the wizard. Follow the wizard all the way through to create your backup plan, you will not see any option to delete backup files older than "x" days, at the end save your backup plan.

Once your backup plan is visible under maintenence plans, right click it, and click on modify, this will open your backup plan in what appears to be a development environment window and you will see several boxes connected to each other with either green or blue arrows. Look down in the lower left hand corner and you will see a toolbox with about eight different components in it.

Select the component called Maintenence Cleanup History and drag it onto the page with your other boxes. Right click this new box and click edit, when it opens up you will see options to delete backup files older than x days. You can configure it, and then you will need to connect it to the other boxes and save the plan and then run it to test it. I tried it a couple of times and couldn't get it to work so I will have to keep testing it.

The ability to delete old backup files does exit, just not where I thought I would find it.

|||thank you very much andy
I try adding cleanup history step and see if i can get it working.

Mits|||

Well done, Andy. It seems that SP1 did in fact add this functionality, but the Wizard hasn't been updated yet to include it. So, the key is to add the step for "Maintenance Cleanup Task," recognizing that it's different from "History Cleanup Task" (which is included in the Wizard).

I've added it to my maintenance plan, and in about a week's time I should know if it's working properly.

|||

This appears to work, but I won't be able to tell until tonight since Microsoft has removed the ability to delete files older than x hours. Only days, weeks, months, and years. I always used hours because of variations in backup duration. If a backup had the time of 8:01 one night and 8:00 the next, I would end up with both on the drive if I picked the 1 day option. I always used 23 hours to avoid the drive filling up. It appears that option is gone. Grrrrr! It is annoying to have a feature that you use and rely on only to have it removed.

Microsoft, please add back the hours option in a service pack.

|||

I think the frustration expressed in this thread is entirely justified and I'll ensure that the tools team here sees this.

As added weight, please go to connect.microsoft.com and give this feedback - this will open issues directly in our bug database and you will get feedback from the relevant teams.

Thanks

|||

Thanks for the suggestion! I didn't know about that site. I see a closed item where the response was that "hours" would come back as a duration in SP2. I voted for that and the open item about the same issue.

I also authored an item to make the cleanup task available through the wizard as it was in SQL2000.

Thanks for taking time to listen to our concerns and point me to the right forum for airing them. Your responsiveness does your employer proud.

|||how can I set the schedule of backup as follows using Maintenance Job.

I want to run the backup plan ever 285 mins or 4.75 hours starting at 8.15 in the morning and finishing at 9.15 at night.

I have tried but it wont let me put anything more then 60 mins or 4.75 hours.

Mits|||

In sql2005 the retention period comes as common sql server setting.when check properties of sql server in database setting you have option to set retention period

Monday, March 19, 2012

Backup database over network not working.

The database server is on computer P4.
Computer P3 has a shared folder with full access.
Computer P5 on which I have my Backup Device and will execute the Backup Database Command using Query Analyzer.

On P5 I created the Backup Device:

USE master
EXEC sp_addumpdevice 'disk', 'myDevice',
'\\P3\temp\test.bak'

Then I executed the following on P5 Query Analyzer:

Backup Database myDatabase TO myDevice

But I get this error:

Server: Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'myDevice'. Device error or device off-line. See the SQL Server error log for more details.
Server: Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.

Any idea? Thanks and regards.Originally posted by juniper
The database server is on computer P4.
Computer P3 has a shared folder with full access.
Computer P5 on which I have my Backup Device and will execute the Backup Database Command using Query Analyzer.

On P5 I created the Backup Device:

USE master
EXEC sp_addumpdevice 'disk', 'myDevice',
'\\P3\temp\test.bak'

Then I executed the following on P5 Query Analyzer:

Backup Database myDatabase TO myDevice

But I get this error:

Server: Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'myDevice'. Device error or device off-line. See the SQL Server error log for more details.
Server: Msg 3013, Level 16, State 1, Line 1
BACKUP DATABASE is terminating abnormally.

Any idea? Thanks and regards.

yeah, go into Enterprise Manager, right click on the db you are trying to backup and all tasks - bring online|||Better yet...don't dump across a network...

It'll be much slower and be at risk for blips in the network...

Dump local then copy...|||Hi guys, thanks for your advice. Brett, I am doing it the way you suggested. However, it would mean that the computer running the database server would have to have a folder permanently shared for my program to copy the file across the network.

Any workaround so that I do not need to share folders? The user might inadvertently unshare the folder and would create problems.

Thanks and regards.|||Ensure the account used to execute this task does have required privileges to access the share specified.

If you're scheduling this task then ensure SQLAgent account used does have admin privileges or a domain account to access so.

Friday, February 10, 2012

Backing up to a server on another domain ?

Hi,
I'm trying to get a SQL 2005 server to backup it's databases to a
shared folder on a server on another domain. It used to work with
older versions of SQL by setting up a null session share on the
destination server, but something's changed in 2005 and it won't play
anymore. No matter what I do re null sessions, it still gives me the
'Cannot open backup device (OS error 1326, error not found)' message
in the log.
Any ideas ? I don't want to setup a trust between the two domains.
Cheers.
I suspect the account that SQL Server is running under does not have the
correct permissions to access this share. I have no idea what a NULL session
share is but the account needs to be able to read and write to the share.
Don't use a mapped drive.
Andrew J. Kelly SQL MVP
Solid Quality Mentors
<pcmangler@.googlemail.com> wrote in message
news:4639622a-56de-41e9-b0ad-68ee2b52eeec@.c30g2000hsa.googlegroups.com...
> Hi,
> I'm trying to get a SQL 2005 server to backup it's databases to a
> shared folder on a server on another domain. It used to work with
> older versions of SQL by setting up a null session share on the
> destination server, but something's changed in 2005 and it won't play
> anymore. No matter what I do re null sessions, it still gives me the
> 'Cannot open backup device (OS error 1326, error not found)' message
> in the log.
> Any ideas ? I don't want to setup a trust between the two domains.
> Cheers.
|||I'm not entirely sure why you're using a null share anyway. If it's a
different domain and you want to save a backup to it, then they need to
provide the acct with permissions on that drive. Even a simple one-way trust
would solve your problem. However, that being said, and the obvious security
risks involved with such a venture, here's a KB article that has some things
to check to make sure you've got everything setup right.
http://support.microsoft.com/default.aspx/kb/289655
"pcmangler@.googlemail.com" wrote:

> Hi,
> I'm trying to get a SQL 2005 server to backup it's databases to a
> shared folder on a server on another domain. It used to work with
> older versions of SQL by setting up a null session share on the
> destination server, but something's changed in 2005 and it won't play
> anymore. No matter what I do re null sessions, it still gives me the
> 'Cannot open backup device (OS error 1326, error not found)' message
> in the log.
> Any ideas ? I don't want to setup a trust between the two domains.
> Cheers.
>

Backing up to a server on another domain ?

Hi,
I'm trying to get a SQL 2005 server to backup it's databases to a
shared folder on a server on another domain. It used to work with
older versions of SQL by setting up a null session share on the
destination server, but something's changed in 2005 and it won't play
anymore. No matter what I do re null sessions, it still gives me the
'Cannot open backup device (OS error 1326, error not found)' message
in the log.
Any ideas ? I don't want to setup a trust between the two domains.
Cheers.I suspect the account that SQL Server is running under does not have the
correct permissions to access this share. I have no idea what a NULL session
share is but the account needs to be able to read and write to the share.
Don't use a mapped drive.
Andrew J. Kelly SQL MVP
Solid Quality Mentors
<pcmangler@.googlemail.com> wrote in message
news:4639622a-56de-41e9-b0ad-68ee2b52eeec@.c30g2000hsa.googlegroups.com...
> Hi,
> I'm trying to get a SQL 2005 server to backup it's databases to a
> shared folder on a server on another domain. It used to work with
> older versions of SQL by setting up a null session share on the
> destination server, but something's changed in 2005 and it won't play
> anymore. No matter what I do re null sessions, it still gives me the
> 'Cannot open backup device (OS error 1326, error not found)' message
> in the log.
> Any ideas ? I don't want to setup a trust between the two domains.
> Cheers.|||I'm not entirely sure why you're using a null share anyway. If it's a
different domain and you want to save a backup to it, then they need to
provide the acct with permissions on that drive. Even a simple one-way trus
t
would solve your problem. However, that being said, and the obvious securit
y
risks involved with such a venture, here's a KB article that has some things
to check to make sure you've got everything setup right.
http://support.microsoft.com/default.aspx/kb/289655
"pcmangler@.googlemail.com" wrote:

> Hi,
> I'm trying to get a SQL 2005 server to backup it's databases to a
> shared folder on a server on another domain. It used to work with
> older versions of SQL by setting up a null session share on the
> destination server, but something's changed in 2005 and it won't play
> anymore. No matter what I do re null sessions, it still gives me the
> 'Cannot open backup device (OS error 1326, error not found)' message
> in the log.
> Any ideas ? I don't want to setup a trust between the two domains.
> Cheers.
>

Backing up to a server on another domain ?

Hi,
I'm trying to get a SQL 2005 server to backup it's databases to a
shared folder on a server on another domain. It used to work with
older versions of SQL by setting up a null session share on the
destination server, but something's changed in 2005 and it won't play
anymore. No matter what I do re null sessions, it still gives me the
'Cannot open backup device (OS error 1326, error not found)' message
in the log.
Any ideas ? I don't want to setup a trust between the two domains.
Cheers.I suspect the account that SQL Server is running under does not have the
correct permissions to access this share. I have no idea what a NULL session
share is but the account needs to be able to read and write to the share.
Don't use a mapped drive.
--
Andrew J. Kelly SQL MVP
Solid Quality Mentors
<pcmangler@.googlemail.com> wrote in message
news:4639622a-56de-41e9-b0ad-68ee2b52eeec@.c30g2000hsa.googlegroups.com...
> Hi,
> I'm trying to get a SQL 2005 server to backup it's databases to a
> shared folder on a server on another domain. It used to work with
> older versions of SQL by setting up a null session share on the
> destination server, but something's changed in 2005 and it won't play
> anymore. No matter what I do re null sessions, it still gives me the
> 'Cannot open backup device (OS error 1326, error not found)' message
> in the log.
> Any ideas ? I don't want to setup a trust between the two domains.
> Cheers.|||I'm not entirely sure why you're using a null share anyway. If it's a
different domain and you want to save a backup to it, then they need to
provide the acct with permissions on that drive. Even a simple one-way trust
would solve your problem. However, that being said, and the obvious security
risks involved with such a venture, here's a KB article that has some things
to check to make sure you've got everything setup right.
http://support.microsoft.com/default.aspx/kb/289655
"pcmangler@.googlemail.com" wrote:
> Hi,
> I'm trying to get a SQL 2005 server to backup it's databases to a
> shared folder on a server on another domain. It used to work with
> older versions of SQL by setting up a null session share on the
> destination server, but something's changed in 2005 and it won't play
> anymore. No matter what I do re null sessions, it still gives me the
> 'Cannot open backup device (OS error 1326, error not found)' message
> in the log.
> Any ideas ? I don't want to setup a trust between the two domains.
> Cheers.
>