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
 General SQL Server Forums
 New to SQL Server Programming
 snapshot problem

Author  Topic 

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2008-06-05 : 10:35:47
Hello everyone

I am learning about snapshots at the moment and i dont know how to incorporate the filegroup within the sytax


at the moment i use

create snapshot snapshotName
on (
Name='Filename_data',
Filename=@'osFIlePath')

as snapshot of DatabaseName


i get an error for filegroup, can someone tell me what im doing wrong please.

Regards

Rob Dineen

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-05 : 10:40:56
http://support.microsoft.com/kb/938086



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2008-06-05 : 10:44:06
Sorry Peso this does not help me

Regards

Rob Dineen
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-05 : 10:47:20
[code]CREATE DATABASE WSS_Backup1
ON
(
NAME=WSS_Content,
FILENAME = 'c:\WSS_Backup1.ss')
AS SNAPSHOT OF <WSS_Content>;[/code]


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-05 : 10:50:23
Database snapshot can't be incorporated in specific FG.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-06-05 : 10:50:27
quote:
SQL Server 2005 Books Online

Working with Database Snapshots

First you need to create a database snapshot. There are two ways of creating database snapshot.

CREATE DATABASE ssAdventureWorks_dbss2230 ON
( NAME = AdventureWorks_Data, FILENAME =
'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_data_2230.ss' )
AS SNAPSHOT OF AdventureWorks;
GO

In the above example, AdventureWork_data_2230.ss is the sparse file. The extension ss is just an arbitrary value and it is not a default or required.

Accessing this database snapshot is as same as any other database.

SELECT *
FROM [ssAdventureWorks_dbss2230].dbo.Employees

Like accessing a database, dropping the database snapshot is the same as a normal database drop.

DROP DATABASE [ssAdventureWorks_dbss2230]

You have the option of restoring a database snapshot into the current database. In that case, database snapshots can be treated as a database backup.

RESTORE DATABASE AdventureWorks from
DATABASE_SNAPSHOT = 'ssAdventureWorks_dbss2230';
GO

These are the only database options that are available with database snapshots. This means that you cannot take backups of database snapshot or restore them to database snapshot.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2008-06-05 : 10:50:42
should the filename be the location of the filegroup
Go to Top of Page

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2008-06-05 : 10:52:55
ok so before you can create a snapshot do you need to create a filegroup for the source database first
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-05 : 11:00:26
Nope, you don't have to.Specify all data files of source database in Name and specify path for Filename.
Go to Top of Page

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2008-06-05 : 15:59:01
could you just show me an example please. then i shall try out

thank you very much

Regards Rob
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-05 : 16:22:14
Watch this video to get clear picture so you don't have further issue:
http://www.jumpstarttv.com/Media.aspx?vid=41
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-06-05 : 23:12:44
>> could you just show me an example please.

peso gave you code already, and books online has sample code for that also.
Go to Top of Page

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2008-06-06 : 03:12:57
thank you very much for that video

just to make sure, You can create snapshots within developer edition

Regards

Rob
Go to Top of Page

aparnav19
Starting Member

5 Posts

Posted - 2008-06-06 : 14:59:16
Check these links

http://www.simple-talk.com/sql/database-administration/sql-server-2005-snapshots/ - Very clear explanation of Database Snapshots

http://msdn.microsoft.com/en-us/library/ms143761.aspx - Database Snapshots supported in Developer and Enterprise Edition only.
Go to Top of Page
   

- Advertisement -