Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Replication (2005)
 basic design of replication

Author  Topic 

osupratt
Posting Yak Master

238 Posts

Posted - 2008-12-22 : 13:14:34
I'm trying to gather information from some of the pro's within this forum for my basic understanding of replication. A brief background on my situation. I work in a satellite location from where my companies main IT department is located. The main IT is in Houston, TX. I am a data analyst / report writer who needs for lack of a better term 'more access' to the data. I don't want to infringe on any security issues or possibly blow something up. Is there a way for the location that I'm at to Replicate or have working copies of databases? How does Linked Server work? Do I need to get snapshots of these databases and then use Linked Server? I want to be able to process reports and pull data ad-hoc and currently my boss (president of our division) is having issues with the time it takes to get anything done. Right now I have to sent in a Helpdesk ticket to get any script loaded, etc. I would like to have a working copy of the databases that I can have control of the SQL Management to load and do whatever. I don't want to have to get a .bak file and then do a restore. Is there something that I can do? Thanks for any help you might offer. I need to get a grasp on this. Thanks again.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-22 : 13:51:32
You should use backup/restore for this. It can be fully automated.

Why don't you want to use backup/restore?

Linked servers is not a good idea. Althoug replication would work, it doesn't seem to be what you need here and thus you shouldn't add these extra resources to the production database.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

osupratt
Posting Yak Master

238 Posts

Posted - 2008-12-22 : 14:28:55
Thanks for your response. Could you explain this process in more detail? I currently use the restore process. This can be a pain when I am constantly creating scripts and then the .bak file that I get from my IT group is a day or two behind the current production database. I have more than database and it seems like I spend allot of time doing this restore process; plus the fact I have to do this after business hours because the IT group complains of the load it puts on the servers when I'm trying to copy this .bak file over from where they place it on network folder.

How can this be automated? I appreciate your knowledge on this matter. Thanks.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-22 : 14:43:48
Here are the steps to automate it:

1. Create job on production to grab the last full backup and compress it into a zip file
2. Create job on your server
a. Copy the zip file down to your server
b. Unzip the file
c. Restore the file using RESTORE DATABASE (and possibly using WITH MOVE option)
d. Perhaps modify permissions or do other things that are required after the restore

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

osupratt
Posting Yak Master

238 Posts

Posted - 2008-12-22 : 15:16:43
This really isn't any different from what I'm doing currently. I have a 'test' server which is really another computer that I have as my E drive. The IT department puts a compressed .bak file in a network folder that I will copy over to my E drive and then run a restore.

By automate I thought it would automatically do the .bak file, copy it to my E drive, and then restore it.

The whole '.bak file is 1-2 days old' thing is what is causing me the issues. I would really like to find a solution that I can have almost real time data pushed to me somehow on a server that I have full access with. Know of any type process like this?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-22 : 15:21:12
The entire process can be automated. Someone has to write some code to do the steps I outlined above.

For real-time data, you'll need transactional replication.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

osupratt
Posting Yak Master

238 Posts

Posted - 2008-12-22 : 15:32:28
Thanks again. Would you know of some place I could find some example code for this automation process?

On the transactional replication idea; is this all software related or code? Any hardware concerns since I am in a satellite location? Thanks for your help and expertise on this.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-22 : 15:36:32
I don't have any sample code to provide regarding the automated refresh.

Transactional replication comes with SQL Server.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hey001us
Posting Yak Master

185 Posts

Posted - 2008-12-22 : 15:44:06
To Backup
http://weblogs.sqlteam.com/tarad/archive/2008/05/21/60606.aspx
http://weblogs.sqlteam.com/tarad/archive/2008/05/21/60606.aspx
To Restore
USE MASTER
RESTORE DATABASE
[XXXX]
FROM
DISK = 'D:\XXX\XXX.bak'
WITH
MOVE 'XXX_Data' TO 'X:\SQLData\Logs\XXX_Data.MDF',
MOVE 'XXX_Log' TO 'X:\SQLData\Logs\XXX_Log.LDF'
GO

hey
Go to Top of Page
   

- Advertisement -