Solved

SQL Server 2000 Backup on a XP machine in the network.

Posted on 2010-08-13
10
337 Views
Last Modified: 2012-05-10
Hi Experts,

We have a Windows 2003 Enterprise Server SP 2 with Sql server 2000 SP3 installed on it. Requirement is to schedule automatic backups of databases on to a XP computer in the network. Which method is best to achieve this?

Ketan.
0
Comment
Question by:shaileshmonani
  • 5
  • 4
10 Comments
 
LVL 9

Expert Comment

by:Tom
Comment Utility
run this type of script:
DECLARE @name VARCHAR(50) -- database name  
DECLARE @path VARCHAR(256) -- path for backup files  
DECLARE @fileName VARCHAR(256) -- filename for backup  
DECLARE @fileDate VARCHAR(20) -- used for file name

SET @path = 'yourXP PC on server\Backup\'  

SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)

DECLARE db_cursor CURSOR FOR  
SELECT name
FROM master.dbo.sysdatabases
WHERE name NOT IN ('master','model','msdb','tempdb')  

OPEN db_cursor  
FETCH NEXT FROM db_cursor INTO @name  

WHILE @@FETCH_STATUS = 0  
BEGIN  
       SET @fileName = @path + @name + '_' + @fileDate + '.BAK'  
       BACKUP DATABASE @name TO DISK = @fileName  

       FETCH NEXT FROM db_cursor INTO @name  
END  

CLOSE db_cursor  
DEALLOCATE db_cursor


________________________________

Change this into a stored procedure and pass in a database name or if left NULL it backups all databases.  Any way you choose to use it, this script gives you the starting point to simply backup all of your databases.
0
 
LVL 1

Expert Comment

by:frfr177
Comment Utility
Hi,

Check out the Maintanace Plan Stuff - it's the easiest way to create a backup:

http://www.databasejournal.com/features/mssql/article.php/3530486/Working-with-the-SQL-Server-2000-Maintenance-Plan-Wizard.htm

frfr177
0
 

Author Comment

by:shaileshmonani
Comment Utility
tru3533

I get the bleow msg on execution of the script from QM

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

Ketan.
0
 
LVL 9

Expert Comment

by:Tom
Comment Utility
Try first to save the backup locally, to elimate the script that is the problem.
If it is working ok on your server, then ivestigate write access and user rights for the \\switin\sksqlbackup\ASCFABS_20100813.BAK'  folder
0
 

Author Comment

by:shaileshmonani
Comment Utility
The script works locally,  We have created a specific user on machine switin which has full rights to the shared folder. how do i pass the authentication info through sql ?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Expert Comment

by:Tom
Comment Utility
it is the logged in user in sql who must have the rights on the xp PC. Check your AD on the server what for rights the user have. Do you use windows autentication?
0
 

Author Comment

by:shaileshmonani
Comment Utility
We use Mixed Mode Authentication on SQL Server.

I dont see any way to grant rights to the user (SERVER\Administrator) on the machine SWITIN. Please help me out here.

Ketan.
0
 
LVL 9

Expert Comment

by:Tom
Comment Utility
Right click the backup folder on the SWITIN PC - properties - click the security tab
Add the "SERVER\Administrator" in  "Group or user names"
give the rights needed in the Permissions
0
 

Author Comment

by:shaileshmonani
Comment Utility
Tried to add the Server\Administrator but this is not successful - error - Location Server not found.
SWITIN machine is part of the domain still SERVER\ADMINISTRATOR cannot be added.

0
 
LVL 9

Accepted Solution

by:
Tom earned 125 total points
Comment Utility
sounds like something basic is missing here.
have a look  at this instuction how to add a computer to a domain
http://www.visualwin.com/AD-XP/
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now