Monday, March 19, 2012
Backup Database! this is really interesting!
I run this in query analyzer
dump database MYDB to disk = 'c:\temp.dat' with init
sql server fails to back up and returns
Server: Msg 3202, Level 16, State 1, Line 1
Write on 'c:\temp.dat' failed, status = 64. See the SQL Server Error Log For
More details.
Server: Msg 3013, Level 16, State 1, Line 1
Backup Database is terminating abnormally
and these are the diagnostics and computer configurations i
performed(computerA):
1. There is 25.5 GB of free space available on C drive.
2. The computer has two RAIDSone SCSI drive. It generates same error on all
of them. This leads me to believe that this is not hardware problem.
3. It generates for all three databases on the server. so not dependent on
database either.
4. Tested on another computer with same hardware but got the databases from
computerA. It fails on that computer too.
5. tested on yet another computer with older versions of the same databases
,(not restored from computerA). It succeeds.
My thoughts are inclined towards virus or sth in the database. but here
comes the kicker. asked the services guy to send me the database backups.
Restored dbs on my machine to the backup copies. It all works fine.
So not the DBs, Not the SQL Server, not the Hardware. what is it?
Or am i totally on the wrong track?
Please someone put some suggestions. I am burning saturday to do this.
A couple things to note. One is that DUMP is the old 6.5 command and you
should be using BACKUP DATABASE instead. But I suspect the error is due to
incorrect permissions but without more details it's hard to say for sure.
Did you check the SQL Error log as it stated? The backup command is always
done under the account SQL Server is running under. So make sure that
account has write permissions on that directory and file. Make sure the file
is not locked by some other application such as a tape backup process.
Andrew J. Kelly SQL MVP
"venAdder" <venAdder@.discussions.microsoft.com> wrote in message
news:F7183062-C942-4B7C-8DD3-A0FAC0228CC8@.microsoft.com...
> Hi,
> I run this in query analyzer
> dump database MYDB to disk = 'c:\temp.dat' with init
> sql server fails to back up and returns
> Server: Msg 3202, Level 16, State 1, Line 1
> Write on 'c:\temp.dat' failed, status = 64. See the SQL Server Error Log
> For
> More details.
> Server: Msg 3013, Level 16, State 1, Line 1
> Backup Database is terminating abnormally
>
> and these are the diagnostics and computer configurations i
> performed(computerA):
> 1. There is 25.5 GB of free space available on C drive.
> 2. The computer has two RAIDSone SCSI drive. It generates same error on
> all
> of them. This leads me to believe that this is not hardware problem.
> 3. It generates for all three databases on the server. so not dependent on
> database either.
> 4. Tested on another computer with same hardware but got the databases
> from
> computerA. It fails on that computer too.
> 5. tested on yet another computer with older versions of the same
> databases
> ,(not restored from computerA). It succeeds.
> My thoughts are inclined towards virus or sth in the database. but here
> comes the kicker. asked the services guy to send me the database backups.
> Restored dbs on my machine to the backup copies. It all works fine.
> So not the DBs, Not the SQL Server, not the Hardware. what is it?
> Or am i totally on the wrong track?
> Please someone put some suggestions. I am burning saturday to do this.
|||I am sorry c:\temp.dat is wrong.
it is \\myserver\c$\temp.dat
Ok I think I know what the problem is. The path is actually
'\\myserver\c$\temp.dat'. The status = 64 means The specified network name
is no longer available ( ERROR_NETNAME_DELETED ). But the myserver is the
name of the computer on which sql server runs. I mean sql server is installed
on myserver. So it should be same as saying c:\temp.dat.
So the query becomes
dump database MYDB to disk = '\\myserver\c$\temp.dat' with init
But in case of c:\temp.dat it succeeds and in case of \\myserver\c$\temp.dat
it fails ( it used to work, but has been failing recently).
Now i tried following.
1. I am able to access c drive on myserver by typing \\myserver\c$ in
windows explorer from another computer on LAN.
2. I am able to access c drive by typing \\myserver\c$ in the windows
explorer on myserver.
3. ping 127.0.0.1 return normal results on myserver.
So why does windows generates ERROR_NETNAME_DELETED when i run
dump database MYDB to disk = '\\myserver\c$\temp.dat' with init
in query analyzer?
|||If this is duplicate sorry, for some reason i don't see my posts on the forum
Ok I think I know what the problem is. Sorry for the 'c:\temp.dat'. The path
is actually
'\\myserver\c$\temp.dat'. The status = 64 means The specified network name
is no longer available ( ERROR_NETNAME_DELETED ). But the myserver is the
name of the computer on which sql server runs. I mean sql server is installed
on myserver. So it should be same as saying c:\temp.dat.
So the query becomes
dump database MYDB to disk = '\\myserver\c$\temp.dat' with init
But in case of c:\temp.dat it succeeds and in case of \\myserver\c$\temp.dat
it fails ( it used to work, but ahs been failing recently).
Now i tried following.
1. I am able to access c drive on myserver by typing \\myserver\c$ in
windows explorer from another computer on LAN.
2. I am able to access c drive by typing \\myserver\c$ in the windows
explorer on myserver.
3. ping 127.0.0.1 return normal results on myserver.
So why does windows generates ERROR_NETNAME_DELETED when i run
dump database MYDB to disk = '\\myserver\c$\temp.dat' with init
in query analyzer?
|||I think Andrew is correct that it is a permissions issue. It works fine
locally on my machine.
Try this from Query Analyzer:
exec master..xp_cmdshell 'dir \\myserver\c$\temp.dat'
You should see the output of the dir command in the results pane.
Ron
Ron Talmage
SQL Server MVP
"venAdder" <venAdder@.discussions.microsoft.com> wrote in message
news:4AFC6143-1BC2-483C-AB63-DB4AFD398EE6@.microsoft.com...
> If this is duplicate sorry, for some reason i don't see my posts on the
forum
> Ok I think I know what the problem is. Sorry for the 'c:\temp.dat'. The
path
> is actually
> '\\myserver\c$\temp.dat'. The status = 64 means The specified network name
> is no longer available ( ERROR_NETNAME_DELETED ). But the myserver is the
> name of the computer on which sql server runs. I mean sql server is
installed
> on myserver. So it should be same as saying c:\temp.dat.
> So the query becomes
> dump database MYDB to disk = '\\myserver\c$\temp.dat' with init
> But in case of c:\temp.dat it succeeds and in case of
\\myserver\c$\temp.dat
> it fails ( it used to work, but ahs been failing recently).
> Now i tried following.
> 1. I am able to access c drive on myserver by typing \\myserver\c$ in
> windows explorer from another computer on LAN.
> 2. I am able to access c drive by typing \\myserver\c$ in the windows
> explorer on myserver.
> 3. ping 127.0.0.1 return normal results on myserver.
>
> So why does windows generates ERROR_NETNAME_DELETED when i run
> dump database MYDB to disk = '\\myserver\c$\temp.dat' with init
> in query analyzer?
>
|||I still think it is permissions. Log on to the server with the account that
SQL Server is running under and see if you can access that share.
Andrew J. Kelly SQL MVP
"venAdder" <venAdder@.discussions.microsoft.com> wrote in message
news:B3D7FA16-1D79-48BF-8D64-90319A6A9B7C@.microsoft.com...
>I am sorry c:\temp.dat is wrong.
> it is \\myserver\c$\temp.dat
> Ok I think I know what the problem is. The path is actually
> '\\myserver\c$\temp.dat'. The status = 64 means The specified network name
> is no longer available ( ERROR_NETNAME_DELETED ). But the myserver is the
> name of the computer on which sql server runs. I mean sql server is
> installed
> on myserver. So it should be same as saying c:\temp.dat.
> So the query becomes
> dump database MYDB to disk = '\\myserver\c$\temp.dat' with init
> But in case of c:\temp.dat it succeeds and in case of
> \\myserver\c$\temp.dat
> it fails ( it used to work, but has been failing recently).
> Now i tried following.
> 1. I am able to access c drive on myserver by typing \\myserver\c$ in
> windows explorer from another computer on LAN.
> 2. I am able to access c drive by typing \\myserver\c$ in the windows
> explorer on myserver.
> 3. ping 127.0.0.1 return normal results on myserver.
>
> So why does windows generates ERROR_NETNAME_DELETED when i run
> dump database MYDB to disk = '\\myserver\c$\temp.dat' with init
> in query analyzer?
>
>
|||No it's not a permissions issue. The reason is when that query executes i can
see the file in explorer for a few seconds. Then it gets deleted when query
fails. Here is what happened:
The issue turned out to be network redirector cahing related.
The precise article corressponding to this is
http://support.microsoft.com/default...EN-US;q285997.
The reason I am sure this is it because the articles describes that using
c:\ should
be fine, which is actually the case. It works fine if no unc is used. and
the windows reports this failed to write to
\device\lanmanredirector\........... it's exactly the error described in
that article.
the solution to this is here
http://support.microsoft.com/default...b;en-us;163401
Now this article explains how to turn off network redirector disabling in
winnt not in win 2000. I opened win registry. The keys are diff.
does anyone know how to do the same thing in win2000professional?
and also it's still a mystry what could ahve caused this problem on that
particular computer. The file size might be one of the causes, but I don't
think so because I have tried on computers configured in exactly the same
way(hardware and software) with much larger files and it all works fine.
|||Make sure your WORKSTATION has the Server Service and the RPC Service
running.
Sincerely,
Anthony Thomas
"venAdder" <venAdder@.discussions.microsoft.com> wrote in message
news:057130BB-486B-4092-AED3-5B24680AD800@.microsoft.com...
No it's not a permissions issue. The reason is when that query executes i
can
see the file in explorer for a few seconds. Then it gets deleted when query
fails. Here is what happened:
The issue turned out to be network redirector cahing related.
The precise article corressponding to this is
http://support.microsoft.com/default...EN-US;q285997.
The reason I am sure this is it because the articles describes that using
c:\ should
be fine, which is actually the case. It works fine if no unc is used. and
the windows reports this failed to write to
\device\lanmanredirector\........... it's exactly the error described in
that article.
the solution to this is here
http://support.microsoft.com/default...b;en-us;163401
Now this article explains how to turn off network redirector disabling in
winnt not in win 2000. I opened win registry. The keys are diff.
does anyone know how to do the same thing in win2000professional?
and also it's still a mystry what could ahve caused this problem on that
particular computer. The file size might be one of the causes, but I don't
think so because I have tried on computers configured in exactly the same
way(hardware and software) with much larger files and it all works fine.
Sunday, March 11, 2012
backup database by maintenance plan
1. create new MaintenancePlan to get a full backup of myDb by Wizzard,... the message is:
create failed for JobStep 'Subplan' ... the specified '@.subsystem' is invalid .. Error 14234
2. create new MaintenancePlan without the Wizzard, by drag and drop "Back Up Database Task" and configured to full backup myDb scheduled daily the message is: create failed for Job 'MaintenancePlan'
the plan exists without scheduling, after modifying get the message
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-...).
? can I get help ? - Thanks
There is a KB article to resolve the above error.
http://support.microsoft.com/?kbid=922651
backup database by maintenance plan
1. create new MaintenancePlan to get a full backup of myDb by Wizzard,... the message is:
create failed for JobStep 'Subplan' ... the specified '@.subsystem' is invalid .. Error 14234
2. create new MaintenancePlan without the Wizzard, by drag and drop "Back Up Database Task" and configured to full backup myDb scheduled daily the message is: create failed for Job 'MaintenancePlan'
the plan exists without scheduling, after modifying get the message
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-...).
? can I get help ? - Thanks
There is a KB article to resolve the above error.
http://support.microsoft.com/?kbid=922651
backup database by maintenance plan
1. create new MaintenancePlan to get a full backup of myDb by Wizzard,... the message is:
create failed for JobStep 'Subplan' ... the specified '@.subsystem' is invalid .. Error 14234
2. create new MaintenancePlan without the Wizzard, by drag and drop "Back Up Database Task" and configured to full backup myDb scheduled daily the message is: create failed for Job 'MaintenancePlan'
the plan exists without scheduling, after modifying get the message
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-...).
? can I get help ? - Thanks
There is a KB article to resolve the above error.
http://support.microsoft.com/?kbid=922651
Tuesday, February 14, 2012
backup
A. Everyday midnight
Step 1.
USE myDB
BACKUP LOG myDB WITH TRUNCATE_ONLY
DBCC SHRINKFILE(myDB_Log, 1)
Step 2.
USE myDB
SET @.db_backup_path = @.db_backup_path + 'myDB'+ '.bak'
BACKUP DATABASE myDB TO DISK = @.db_backup_path WITH INIT
B. Every 2 hours
USE myDB
SET @.db_myDBlog = @.db_backup_path + 'myDB_log_'+ x + '.trn'
BACKUP LOG myDB TO DISK = @.db_myDBlog
Can I move Step 1 after Step 2( backup database first then shrinkthe dblog)?
Any suggestions about this plan? Thanks.Hi,
No need to shrink the file daily. To restrict the LDF growth you could
perform the transaction log backup every 30 minutes.
This will ensure the LDF will not grow heavily.
So :-
1. Do a full database backup daily once at midnight
2. Do a transaction log every 30 minutes.
Thanks
Hari
SQL Server MVP
"js" <js@.someone@.hotmail.com> wrote in message
news:eUOSH6irFHA.3476@.TK2MSFTNGP10.phx.gbl...
> Hello, I have a backup plan as below:
> A. Everyday midnight
> Step 1.
> USE myDB
> BACKUP LOG myDB WITH TRUNCATE_ONLY
> DBCC SHRINKFILE(myDB_Log, 1)
> Step 2.
> USE myDB
> SET @.db_backup_path = @.db_backup_path + 'myDB'+ '.bak'
> BACKUP DATABASE myDB TO DISK = @.db_backup_path WITH INIT
> B. Every 2 hours
> USE myDB
> SET @.db_myDBlog = @.db_backup_path + 'myDB_log_'+ x + '.trn'
> BACKUP LOG myDB TO DISK = @.db_myDBlog
> Can I move Step 1 after Step 2( backup database first then shrinkthe
> dblog)?
> Any suggestions about this plan? Thanks.
>
>
>|||Thanks for the quick response.
"Hari Pra
> No need to shrink the file daily. To restrict the LDF growth you could
> perform the transaction log backup every 30 minutes.
> This will ensure the LDF will not grow heavily.
is it shrink file a bad thing? what situation shrink file is good?
> So :-
> 1. Do a full database backup daily once at midnight
> 2. Do a transaction log every 30 minutes.
What's diff between 30 minutes and 2 hours(except the Frequency)?
Please advice.|||> is it shrink file a bad thing? what situation shrink file is good?
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
> What's diff between 30 minutes and 2 hours(except the Frequency)?
You do more modification during two hours compared to 30 minutes. I.e., you
produce more log records
during a longer time period. Also, more frequent backups allow you to lose l
ess data in the unlikely
event...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"js" <js@.someone@.hotmail.com> wrote in message news:e$Sm8IjrFHA.3884@.TK2MSFTNGP11.phx.gbl..
.
> Thanks for the quick response.
> "Hari Pra
> is it shrink file a bad thing? what situation shrink file is good?
>
> What's diff between 30 minutes and 2 hours(except the Frequency)?
> Please advice.
>
>
>
>|||Thanks Tibor,
> You do more modification during two hours compared to 30 minutes. I.e.,
> you produce more log records during a longer time period. Also, more
> frequent backups allow you to lose less data in the unlikely event...
>
Is it use lot of resource (for the end user, they will fell access sql is
slow when backing up log)?|||Whether a log backup will be noticable to users depends on the load of the s
erver and also your disk
layout (if you separated the tlog file, RAID config etc). But if you do log
backup every two hours,
it will take 4 times as long time as if you do it every 30 minutes.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"js" <js@.someone@.hotmail.com> wrote in message news:eevedBnrFHA.3444@.TK2MSFTNGP12.phx.gbl..
.
> Thanks Tibor,
>
> Is it use lot of resource (for the end user, they will fell access sql is
slow when backing up
> log)?
>
>
>|||Thanks Tibor.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:empQRttrFHA.3556@.TK2MSFTNGP10.phx.gbl...
> Whether a log backup will be noticable to users depends on the load of the
> server and also your disk layout (if you separated the tlog file, RAID
> config etc). But if you do log backup every two hours, it will take 4
> times as long time as if you do it every 30 minutes.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "js" <js@.someone@.hotmail.com> wrote in message
> news:eevedBnrFHA.3444@.TK2MSFTNGP12.phx.gbl...
>