Showing posts with label snapshot. Show all posts
Showing posts with label snapshot. Show all posts

Tuesday, March 27, 2012

Database Snapshots, Mirroring, and Log Shipping

Can someone explain to me how/why you can create a database snapshot
against a mirrored database, but not a log shipped database?Some extra logic is required to keep the snapshot active during recovery.
This is built into the mirroring logic. Log shipping just uses normal log
restore logic.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<jalbenberg@.yahoo.com> wrote in message
news:1169249796.950379.163120@.q2g2000cwa.googlegroups.com...
> Can someone explain to me how/why you can create a database snapshot
> against a mirrored database, but not a log shipped database?
>

Database Snapshots vs Snaphot replication

In the enterprise version of SQL there is the facility to do snapshot
replication which I have not tried.
How does this differ from snapshot replication?
What this does is capture a point in time image of a database which you can
connect to as a different database.
Database snapshots are local to the database and uses up considerable disk
space. Snapshot replication can replicate locally and/or remote. It can
replicate to multiple subscribers.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"PromisedOyster" <PromisedOyster@.hotmail.com> wrote in message
news:1170891510.578187.22220@.v33g2000cwv.googlegro ups.com...
> In the enterprise version of SQL there is the facility to do snapshot
> replication which I have not tried.
> How does this differ from snapshot replication?
>
|||Thanks Hilary
My client is considering using mirroring for fault tolerance under SQL
Server 2005 but they also require a version of the database that is
reasonably up to date for reporting purposes. They dont have the
Enterprise version of SQL, so I was wondering if mirroring and then
doing snapshot replication (from the mirror) would be a viable
solution. I suspect not as the database would be unavailable for too
long. In addition, I am not even sure if this is an available option.
NB: They are unable to use transactional or merge replication due to
the tables not having primary keys.
I know that snapshot replication can be extremely slow but I am not
sure how much faster database snapshots are? In addition, when you do
them, can you simply overwrite the previous one as you dont want the
clients to have to access a different database?
Bottom line, is it a viable solution to make multiple database
snapshots during the course of a production day (from the mirror)?
I dont want to propose going to Enterprise version if it isnt going to
work.
On Feb 8, 12:29 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
> What this does is capture a point in time image of a database which you can
> connect to as a different database.
> Database snapshots are local to the database and uses up considerable disk
> space. Snapshot replication can replicate locally and/or remote. It can
> replicate to multiple subscribers.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTShttp://www.indexserverfaq.com
> "PromisedOyster" <PromisedOys...@.hotmail.com> wrote in message
> news:1170891510.578187.22220@.v33g2000cwv.googlegro ups.com...
>
>
> - Show quoted text -
|||One problem, you can't do snapshot replication off a mirror.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"PromisedOyster" <PromisedOyster@.hotmail.com> wrote in message
news:1170908921.373111.263690@.v33g2000cwv.googlegr oups.com...
> Thanks Hilary
> My client is considering using mirroring for fault tolerance under SQL
> Server 2005 but they also require a version of the database that is
> reasonably up to date for reporting purposes. They dont have the
> Enterprise version of SQL, so I was wondering if mirroring and then
> doing snapshot replication (from the mirror) would be a viable
> solution. I suspect not as the database would be unavailable for too
> long. In addition, I am not even sure if this is an available option.
> NB: They are unable to use transactional or merge replication due to
> the tables not having primary keys.
> I know that snapshot replication can be extremely slow but I am not
> sure how much faster database snapshots are? In addition, when you do
> them, can you simply overwrite the previous one as you dont want the
> clients to have to access a different database?
> Bottom line, is it a viable solution to make multiple database
> snapshots during the course of a production day (from the mirror)?
> I dont want to propose going to Enterprise version if it isnt going to
> work.
> On Feb 8, 12:29 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
>
|||Thanks, well I guess I can rule out snapshot replication.
However, what about database snapshots. How feasible is it to take
them once every half hour (say) and overwrite the existing one and
then use that as the reporting database server?
On Feb 8, 8:18 pm, "Hilary Cotter" <hilary.cot...@.gmail.com> wrote:
> One problem, you can't do snapshot replication off a mirror.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTShttp://www.indexserverfaq.com
> "PromisedOyster" <PromisedOys...@.hotmail.com> wrote in message
> news:1170908921.373111.263690@.v33g2000cwv.googlegr oups.com...
>
>
>
>
>
>
>
>
>
> - Show quoted text -

Database Snapshots question

Dear all,
How can I make a snapshot in sql25k? When I do click on the option 'Database
snapshots' only appears 'refresh'.
Thanks for any input,from bol
CREATE DATABASE AdventureWorks_dbss1800 ON
( NAME = AdventureWorks_Data, FILENAME =
'C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\AdventureWorks_data_1800.ss' )
AS SNAPSHOT OF AdventureWorks;
GO
"Enric" wrote:

> Dear all,
> How can I make a snapshot in sql25k? When I do click on the option 'Databa
se
> snapshots' only appears 'refresh'.
> Thanks for any input,
>|||thanks a lot
--
Please post DDL, DCL and DML statements as well as any error message in
order to understand better your request. It''''s hard to provide information
without seeing the code. location: Alicante (ES)
"Omnibuzz" wrote:
> from bol
> CREATE DATABASE AdventureWorks_dbss1800 ON
> ( NAME = AdventureWorks_Data, FILENAME =
> 'C:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\Data\AdventureWorks_data_1800.ss' )
> AS SNAPSHOT OF AdventureWorks;
> GO
> --
>
>
> "Enric" wrote:
>sql

Database Snapshots Performance

Hi,
I'm developing a Data Mart and i'm experiencing a performance gap between my fact table and its snapshot.
I create snapshot with the istruction:

CREATE DATABASE DB_SNAP ON

( NAME = DB_SNAP_Data, FILENAME =

'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DB_SNAP_Data.ss' )

AS SNAPSHOT OF DB;

And it works. But executing queries on the snapshot result very "low".
Can anyone tell me why?

Tanks.

F.

There is a section in Books Online titled "How Database Snapshots Work" which shows the extra level of redirection for snapshots. For a newly created snapshot, the data will not be in cache so it might take a little while to pull the data into the buffer pool. Once it is "warmed up" though, the performance should not be that different.

You can look at the sys.dm_db_index_operational_stats and sys.dm_io_virtual_file_stats DMVs to try to determine where the issues are.

|||Yes, but I always have a "newly created snapshot". Infact, to update the snapshot, i need to drop and re-create. And i do this every day at least.|||

So, do the performance problems persist, or are they temporary until the cache is populated?

This will help narrow down where the problem may be.

Database Snapshots Performance

Hi,
I'm developing a Data Mart and i'm experiencing a performance gap between my fact table and its snapshot.
I create snapshot with the istruction:

CREATE DATABASE DB_SNAP ON

( NAME = DB_SNAP_Data, FILENAME =

'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DB_SNAP_Data.ss' )

AS SNAPSHOT OF DB;

And it works. But executing queries on the snapshot result very "low".
Can anyone tell me why?

Tanks.

F.

There is a section in Books Online titled "How Database Snapshots Work" which shows the extra level of redirection for snapshots. For a newly created snapshot, the data will not be in cache so it might take a little while to pull the data into the buffer pool. Once it is "warmed up" though, the performance should not be that different.

You can look at the sys.dm_db_index_operational_stats and sys.dm_io_virtual_file_stats DMVs to try to determine where the issues are.

|||Yes, but I always have a "newly created snapshot". Infact, to update the snapshot, i need to drop and re-create. And i do this every day at least.|||

So, do the performance problems persist, or are they temporary until the cache is populated?

This will help narrow down where the problem may be.

Database Snapshots

Hi,
I'm developing a Data Mart and i'm experiencing a performance gap between my fact table and its snapshot.
I create snapshot with the istruction:

CREATE DATABASE DB_SNAP ON

( NAME = DB_SNAP_Data, FILENAME =

'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\DB_SNAP_Data.ss' )

AS SNAPSHOT OF DB;

And it works. But executing queries on the snapshot result very "low".
Can anyone tell me why?

Tanks.

F.Can you please explain the term about 'low', is it the data size or data?|||

Satya SKJ wrote:

Can you please explain the term about 'low', is it the data size or data?

It was "Slow" and not "low". Sorry.
I mean the time to execute a query.|||

It is by design@.

Performance is reduced, due to increased I/O on the source database resulting from a copy-on-write operation to the snapshot every time a page is updated.

|||

Satya SKJ wrote:

It is by design@.

Performance is reduced, due to increased I/O on the source database resulting from a copy-on-write operation to the snapshot every time a page is updated.

Ok. I read that note.
But what does it mean "Performance is reduced"?
Query on the normal table executed in about 40 seconds; on the snapshot it's over 8 minutes...

Database snapshot SQL Server 2005

Hello Every

I have a problem withASP.NET connect toDatabase Snapshot SQL Server 2005.

Step One: I create database snapshot.

Step Two: I want to use ASP.NET to Database Snapshot that create already. But I don't know connection string to database snapshot.

Please help me .....................

Thank You,

I also have the same problem as follows:

The first execute of SQL Server 2005 tasks to creates the snapshot as follows:

USE Master;
GO
IF EXITS (SELECT name FROM sys.database WHERE name = "N'source_system_snapshot_extract')
BEGIN
DROP DATABASE [source_system_snapshot_extract]
END
GO
CREATE DATABASE source_system_snapshot_extract ON
('C:\Test\source_system_snapshot_extract.ss)
AS SNAPSHOT OF source_system
GO

The second I want code in the ASP.NET to connect to the database snapshot replication above

Please post your example code if anyone can solve this problem.

|||

In the ASP.NET from the code design , i write the code as follow:

Imports Microsoft.SqlServer.Dts.Runtime

Public Sub Main()

Dim Constr$=Dts.connections("Source_System").connectionstring

If not Constr.contain("Initial Catalog=Source_System") then

Dts.taskresult=dts.results.failure

return

Endif

Dts.connections("Source_System").connectionstring=Dts.connections("Source_System").connectionstring.replace("Initial Catalog=Source_System", ("Initial Catalog=Source_System_Snapshot_Extract")

Dts.taskresult=dts.results.Success

End sub

The code above does not response correctly to have the database snapshot connect to asp.net

However ,DTS does not show up in code.

Please held me to resolve this .

|||

With your above code, I have write the same code using the Visual Studion IDE, then I have added a reference as follows:

Microsoft.SqlServer.ManagedDTS.DLL

To add the reference above, it is in order to create using statement as discussed in the above code, but it is not possible to display the right statement. I think someone in Microsoft with SQL Server 2005 Specialist will help us to code this. The crucial help from Microsoft will be usefull the programmers over the world.

|||

Thanks alot that you try to help me.

but i still got a problem i can't connect to database snapshot with VB.NET.

Microsoft said that we can do database with database snapshot . but try to find any sample on the internet websit i can't found about that problem , How to connect to database snapshot with VB.NET.

i don't belive in that The Microsoft speak a lie all of customers that support his product, but i am not sure untill he solve this problem , to indicate

me to know or all of programmer in the world.

i hope that someone in Microsoft with SQL Server 2005 Specialist will help this.

|||

I try helping to solve this problem, but i have still not yet find the solution. I think that there will be another specialist like moderator, contributor or commentator of this web site will help you to solve this problem. I have read some technical notes regarding to your needs I hope SQL Server Specialist from Microsoft will assist you to resolve your problem.

If Database Snapshot Replication has no connection with VB.NET, I believe that the SQL Server 2005 programmer within Microsoft was not hosted this project in SQL Server 2005 Project.

|||

I understand your concepts related to the database snapshot to create just the read-only databases for viewing the reports. This is no need to use the original database with SQL Server 2005 install to come along with your backage, but I have some link to talk about database snapshot, but this web is not talking the database snapshot connecting with VB.NET (http://articles.techrepublic.com.com/5100-9592_11-6146916.html), (http://www.code-magazine.com/article.aspx?quickid=0311101&page=4), also see this link:http://sqljunkies.com/WebLog/marathonsqlguy/archive/2006/05.aspx. I think there is no way to code from VB.NET to connect the database snapshot out of the original database.

I probably am poor with this coding, I hope someone in this site will save you to code this and attached with nice example project.

|||

?????????????????? ?????????????????????????????????????http://www.c-sharpcorner.com/UploadFile/paulyau/DBOpsInADOPA11302005071252AM/DBOpsInADOPA.aspx

|||

Please read this link:https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1149179&SiteID=1 , I think it is useful for you.

|||

Also see this link:http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=63581&SiteID=17

|||

This is also useful link:http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1458445&SiteID=1

|||

See this help you:http://msdn2.microsoft.com/zh-cn/library/microsoft.sqlserver.management.smo.database.isdatabasesnapshot.aspx

|||

Is this link help you:http://support.microsoft.com/kb/319649 orhttp://support.microsoft.com/kb/319648/

|||

This topic is still error. Please help me

Database Snapshot Performance

Hi,
I'm developing a Data Mart and i'm experiencing a performance gap
between my fact table and its snapshot.
I create snapshot with the istruction:
CREATE DATABASE DB_SNAP ON ( NAME = DB_SNAP_Data, FILENAME = 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
\DB_SNAP_Data.ss' ) AS SNAPSHOT OF DB;
And it works. But executing queries on the snapshot result very
"Slow".
Can anyone tell me why?
Tanks.
F.
A snapshot is slow because it makes a copy of of modified data in tempdb.
Thus reads are scattered all over. The real question is why would you NEED
a snapshot of a fact table? This is non-standard DW practice AFAIK.
TheSQLGuru
President
Indicium Resources, Inc.
"Johnny" <xxx.johnny@.gmail.com> wrote in message
news:1171290125.043815.129030@.v33g2000cwv.googlegr oups.com...
> Hi,
> I'm developing a Data Mart and i'm experiencing a performance gap
> between my fact table and its snapshot.
> I create snapshot with the istruction:
> CREATE DATABASE DB_SNAP ON ( NAME = DB_SNAP_Data, FILENAME = 'C:
> \Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
> \DB_SNAP_Data.ss' ) AS SNAPSHOT OF DB;
> And it works. But executing queries on the snapshot result very
> "Slow".
> Can anyone tell me why?
> Tanks.
> F.
>

Database Snapshot Performance

Hi,
I'm developing a Data Mart and i'm experiencing a performance gap
between my fact table and its snapshot.
I create snapshot with the istruction:
CREATE DATABASE DB_SNAP ON ( NAME = DB_SNAP_Data, FILENAME = 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
\DB_SNAP_Data.ss' ) AS SNAPSHOT OF DB;
And it works. But executing queries on the snapshot result very
"Slow".
Can anyone tell me why?
Tanks.
F.A snapshot is slow because it makes a copy of of modified data in tempdb.
Thus reads are scattered all over. The real question is why would you NEED
a snapshot of a fact table? This is non-standard DW practice AFAIK.
TheSQLGuru
President
Indicium Resources, Inc.
"Johnny" <xxx.johnny@.gmail.com> wrote in message
news:1171290125.043815.129030@.v33g2000cwv.googlegroups.com...
> Hi,
> I'm developing a Data Mart and i'm experiencing a performance gap
> between my fact table and its snapshot.
> I create snapshot with the istruction:
> CREATE DATABASE DB_SNAP ON ( NAME = DB_SNAP_Data, FILENAME = 'C:
> \Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data
> \DB_SNAP_Data.ss' ) AS SNAPSHOT OF DB;
> And it works. But executing queries on the snapshot result very
> "Slow".
> Can anyone tell me why?
> Tanks.
> F.
>

Database Snapshot on tempdb

Hi Experts:

Can you please offer an explanation on why a database snapshot cannot be created on tempdb?. Is it because the tempdb is created everytime fresh when SQL Server is restarted or some other reason?.

Any insight is appreciated.

Thanks

Ankith

Can I answer this with a question? Why would you want a snapshot of tempdb?

Anyway, the books online say: "Snapshots of the model, master, and tempdb databases are prohibited." These are system databases and you normally wouldn't want to mess with them too much imo.

|||

Hi:

I am not creating a snapshot on tempdb. I just want to know the techinical reason behind it.

Thanks

|||

Probably the primary reason is that tempdb is a temporary store for use by the engine for many situations, worktables, row versions, etc. having a snapshot does not have a purpose and would not work because of these.

|||

Hi Simon:

Thank you for the explanation.

Ankith.

|||

The actual technical reason is that database snapshots undergo restart recovery to rollback any active transactions at the time the snapshot is created. Since TEMPDB cannot be recovered (it is recreated each time the server starts), you cannot create a snapshot on it.

Thanks,
--R

sql

Database Snapshot on tempdb

Hi Experts:

Can you please offer an explanation on why a database snapshot cannot be created on tempdb?. Is it because the tempdb is created everytime fresh when SQL Server is restarted or some other reason?.

Any insight is appreciated.

Thanks

Ankith

Can I answer this with a question? Why would you want a snapshot of tempdb?

Anyway, the books online say: "Snapshots of the model, master, and tempdb databases are prohibited." These are system databases and you normally wouldn't want to mess with them too much imo.

|||

Hi:

I am not creating a snapshot on tempdb. I just want to know the techinical reason behind it.

Thanks

|||

Probably the primary reason is that tempdb is a temporary store for use by the engine for many situations, worktables, row versions, etc. having a snapshot does not have a purpose and would not work because of these.

|||

Hi Simon:

Thank you for the explanation.

Ankith.

|||

The actual technical reason is that database snapshots undergo restart recovery to rollback any active transactions at the time the snapshot is created. Since TEMPDB cannot be recovered (it is recreated each time the server starts), you cannot create a snapshot on it.

Thanks,
--R

Database Snapshot on SAN attached disks

Hi All

I am in process of moving a SQL 2005 solution from a development box that used local storage to UAT environment with SAN attached storage. The solution uses database snapshots

The database files are on the SAN storage but during testing I was unable to create a Database snapshot on the SAN disk. Creating snapshots on the local disk worked fine.

Is their some restriction/problem in using the database snapshot technology with SAN storage?

What edition of Sql server 2005 you have ? Database snapshot is possible only with Enterprise edition I believe
|||

SQL Server Enterprise 2005 SP2 is being used on all systems.

The snapshots are working against the local disks on the server but not against the SAN attached storage.

Regards

Nadreck

|||

Are the SAN attached drives formatted using the NTFS file system? Database Snapshots use NTFS Sparse Files for the underlying technology, and will not work under any other file system.

I have database snapshots on production clustered servers, using SAN storage, and haven't had any problems.

|||Your use of the term "SAN attached" has me wondering. There are Network Attached Storage (NAS) devices that often have their own proprietary file system and then there are Storage Area Networks (SAN) which are usually NTFS in the Windows world. Which type of storage are you referring to? Database snapshots require NTFS.
|||There is no difference between a "SAN" and a local drive to SQL, they both look like local drives. This must be a security issue on the directory.

If you are talking about a "NAS" drive, as in you access it using "\\servername\share", SQL does not support putting data/transaction files on share drives.

|||

The storage is on a true SAN with the disks attached by Fibre Channel and being presented as Local disk.

I have spoken with the SAN administrators and they have confirmed that the disks are formatted as NTFS

The error received when trying to create the sbnapshot was

Msg 1823, Level 16, State 2, Line 1

A database snapshot cannot be created because it failed to start.

Msg 5123, Level 16, State 1, Line 1

CREATE FILE encountered operating system error 5(error not found) while attempting to open or create the physical file 'filename'.

|||I think the login with which you have logged into Sql server(windows authentication) might not be having modify privilege to the folder where the Sparse file is being created ! also check if the sql service account has necessary privileges to that folder ! ! !

Thanxx
Deepak


|||

The logon accounts and service accounts both have local admin rights on the box so write permissions do not appear to be the issue. The mdf and ldf files for the database are both on SAN storage so SQL appears to have sufficient rights to write to these disks. Creating snapshots on local disk (with the same accounts) has no issue.

Obviously it may still be some permissions issue with the SAN but I cannot see any difference.

regards

Nadreck

database snapshot off of a restoring db

Say I establish log shipping between source A and dest B.
and Dest B is continuously restoring logs, can i perform a snapshot on Dest
B
I know if i do mirroring between the 2 servers than i can snapshot off of
the mirror but wanted to know how it works with log shipping destination
ThanksI have not tested myself but saw this on BOL
Limitations on Database Snapshots
"The source database must be online, unless the database is a mirror
database within a database mirroring session"
Ben Nevarez, MCDBA, OCP
Database Administrator
"Hassan" wrote:

> Say I establish log shipping between source A and dest B.
> and Dest B is continuously restoring logs, can i perform a snapshot on Des
t
> B
> I know if i do mirroring between the 2 servers than i can snapshot off of
> the mirror but wanted to know how it works with log shipping destination
> Thanks
>
>|||No. This is not allowed
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Hassan" <Hassan@.hotmail.com> wrote in message
news:eBwaNwiPGHA.2628@.TK2MSFTNGP15.phx.gbl...
> Say I establish log shipping between source A and dest B.
> and Dest B is continuously restoring logs, can i perform a snapshot on
> Dest B
> I know if i do mirroring between the 2 servers than i can snapshot off of
> the mirror but wanted to know how it works with log shipping destination
> Thanks
>

database snapshot off of a restoring db

Say I establish log shipping between source A and dest B.
and Dest B is continuously restoring logs, can i perform a snapshot on Dest
B
I know if i do mirroring between the 2 servers than i can snapshot off of
the mirror but wanted to know how it works with log shipping destination
Thanks
I have not tested myself but saw this on BOL
Limitations on Database Snapshots
"The source database must be online, unless the database is a mirror
database within a database mirroring session"
Ben Nevarez, MCDBA, OCP
Database Administrator
"Hassan" wrote:

> Say I establish log shipping between source A and dest B.
> and Dest B is continuously restoring logs, can i perform a snapshot on Dest
> B
> I know if i do mirroring between the 2 servers than i can snapshot off of
> the mirror but wanted to know how it works with log shipping destination
> Thanks
>
>
|||No. This is not allowed
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Hassan" <Hassan@.hotmail.com> wrote in message
news:eBwaNwiPGHA.2628@.TK2MSFTNGP15.phx.gbl...
> Say I establish log shipping between source A and dest B.
> and Dest B is continuously restoring logs, can i perform a snapshot on
> Dest B
> I know if i do mirroring between the 2 servers than i can snapshot off of
> the mirror but wanted to know how it works with log shipping destination
> Thanks
>

database snapshot off of a restoring db

Say I establish log shipping between source A and dest B.
and Dest B is continuously restoring logs, can i perform a snapshot on Dest
B
I know if i do mirroring between the 2 servers than i can snapshot off of
the mirror but wanted to know how it works with log shipping destination
ThanksI have not tested myself but saw this on BOL
Limitations on Database Snapshots
"The source database must be online, unless the database is a mirror
database within a database mirroring session"
Ben Nevarez, MCDBA, OCP
Database Administrator
"Hassan" wrote:
> Say I establish log shipping between source A and dest B.
> and Dest B is continuously restoring logs, can i perform a snapshot on Dest
> B
> I know if i do mirroring between the 2 servers than i can snapshot off of
> the mirror but wanted to know how it works with log shipping destination
> Thanks
>
>|||No. This is not allowed
--
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Hassan" <Hassan@.hotmail.com> wrote in message
news:eBwaNwiPGHA.2628@.TK2MSFTNGP15.phx.gbl...
> Say I establish log shipping between source A and dest B.
> and Dest B is continuously restoring logs, can i perform a snapshot on
> Dest B
> I know if i do mirroring between the 2 servers than i can snapshot off of
> the mirror but wanted to know how it works with log shipping destination
> Thanks
>sql

Database Snapshot Disk IO considerations and Best Practices

I understand the concept of database snapshots, however, I'm unsure how to tackle this from disk utilization point of view.

First off I'll explain how I want to use database snapshots, then the configurations at the disk level I was considering.

Currently in 2005 we can also find Snapshot Isolation whcih helps with concurrency but it will use the tempdb heavily. Since I have enough things hammering the tempdb I was considering using database snapshots to help with the reporting functionality.

Since a database snapshot creates sparse files there will not be a lot of space being consumed (I'll have a question on this one later). Since creating a database snapshot is pretty light weight I was considering creating a job that will snapshot the database every minute (don't freak out yet let me explain). Then I will have another job to drop snapshots that do not have an active transaction in them. I've created a function that will return the latest available snapshot and using some dynamic SQL I can use that in my reporting code.

I've created all the code for this to happen, but now comes the fun part... where do I put the database snapshots?

Currently my databases have seperated array for Log files, seperate array for the clustered indexes, and a seperate array for non-clustered indexes (as well as partitioned tables, BLOB, etc...). So all together my IO is split up across about 32 spindles. I have 3 spindles in a RAID 5 available. Do I created the database snapshot in the same location as the files (because creating a db snapshot is just like creating a real database). Or to I lump them up on the small array, data and logs and all?

Also, if my database is let say 75GB and I want to snapshot it to a 36GB partition I know that the sparse files will be small and it show actual space on disk to be small but logically it will show at 75GB will SQL or the OS have an issue with that?

Thanks

Rich

If there is a possibility to create another drive then use that to store the backup/snapshot files. I'm not sure if you are using EMC then it will be easy to store them inspite of any issue. Why you want to compress the snapshot in this case.|||I'm not looking to compress anything. I'm not sure if I'm being clear but I'm talking about SQL 2005 new ability to create database snapshots, which automatically creates sparse files. We are using an EMC CX3-20 SAN if that helps.

Database Snapshot (SQL Server 2005)

Hi,
--
Sorry for posting my question in this group. Isn't Micsrosoft going to
create new forums for SQL2K5?
--
BOL states that the snapshot file(sparse file) is small when it is created,
and gradually grows. But I tried on my databases (even big ones) and its
size is the same as original data files. For example on AdventureWorks, the
sparse file I created took 223mb which is even bigger than the db itself!
Any help would be greatly appreciated.
LeilaRight-click the file in explorer, properties, check "size on disk".
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Leila" <Leilas@.hotpop.com> wrote in message news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...[
color=darkred]
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to cre
ate new forums for
> SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is created
, and gradually grows.
> But I tried on my databases (even big ones) and its size is the same as or
iginal data files. For
> example on AdventureWorks, the sparse file I created took 223mb which is e
ven bigger than the db
> itself!
> Any help would be greatly appreciated.
> Leila
>[/color]|||That is the way a sparse file works. It appears as large as it can be but
in reality it is only a few bytes to begin with and will grow as it gets
populated. Right click on the file in Explorer and choose properties. You
will see both sizes.
Andrew J. Kelly SQL MVP
"Leila" <Leilas@.hotpop.com> wrote in message
news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to
> create new forums for SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is
> created, and gradually grows. But I tried on my databases (even big ones)
> and its size is the same as original data files. For example on
> AdventureWorks, the sparse file I created took 223mb which is even bigger
> than the db itself!
> Any help would be greatly appreciated.
> Leila
>|||"Leila" <Leilas@.hotpop.com> wrote in message
news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to
> create new forums for SQL2K5?
> --
I hope not. It's just SQL Server.

> BOL states that the snapshot file(sparse file) is small when it is
> created, and gradually grows. But I tried on my databases (even big ones)
> and its size is the same as original data files. For example on
> AdventureWorks, the sparse file I created took 223mb which is even bigger
> than the db itself!
>
Sparse files have a logical size and a smaller physical size. You are just
seeing the logical size of the file.
http://msdn.microsoft.com/en-us/library/ms175823.aspx
Look at the available space on your drive before and after creating the
snapshot. You will find that although the file is reported as being 223mb,
the available space on your drive has hardly diminished at all.
David|||And just to add, within SQL you can use fn_virtualfilestats to get the
actual size on disk of a snapshot e.g.
select db_name(DbId) as [Database],
sum(cast(((BytesOnDisk/1024.0)/1024.0) as numeric(25,2))) as [SizeOnDisk_MB]
from fn_virtualfilestats(-1,-1)
group by db_name(DbId)
You should see your snapshot database is a lot smaller than the database
it's based on (initially at least!)
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Leila" <Leilas@.hotpop.com> wrote in message
news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to
> create new forums for SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is
> created, and gradually grows. But I tried on my databases (even big ones)
> and its size is the same as original data files. For example on
> AdventureWorks, the sparse file I created took 223mb which is even bigger
> than the db itself!
> Any help would be greatly appreciated.
> Leila
>

Database Snapshot (SQL Server 2005)

Hi,
Sorry for posting my question in this group. Isn't Micsrosoft going to
create new forums for SQL2K5?
BOL states that the snapshot file(sparse file) is small when it is created,
and gradually grows. But I tried on my databases (even big ones) and its
size is the same as original data files. For example on AdventureWorks, the
sparse file I created took 223mb which is even bigger than the db itself!
Any help would be greatly appreciated.
Leila
Right-click the file in explorer, properties, check "size on disk".
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Leila" <Leilas@.hotpop.com> wrote in message news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to create new forums for
> SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is created, and gradually grows.
> But I tried on my databases (even big ones) and its size is the same as original data files. For
> example on AdventureWorks, the sparse file I created took 223mb which is even bigger than the db
> itself!
> Any help would be greatly appreciated.
> Leila
>
|||That is the way a sparse file works. It appears as large as it can be but
in reality it is only a few bytes to begin with and will grow as it gets
populated. Right click on the file in Explorer and choose properties. You
will see both sizes.
Andrew J. Kelly SQL MVP
"Leila" <Leilas@.hotpop.com> wrote in message
news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to
> create new forums for SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is
> created, and gradually grows. But I tried on my databases (even big ones)
> and its size is the same as original data files. For example on
> AdventureWorks, the sparse file I created took 223mb which is even bigger
> than the db itself!
> Any help would be greatly appreciated.
> Leila
>
|||"Leila" <Leilas@.hotpop.com> wrote in message
news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to
> create new forums for SQL2K5?
> --
I hope not. It's just SQL Server.

> BOL states that the snapshot file(sparse file) is small when it is
> created, and gradually grows. But I tried on my databases (even big ones)
> and its size is the same as original data files. For example on
> AdventureWorks, the sparse file I created took 223mb which is even bigger
> than the db itself!
>
Sparse files have a logical size and a smaller physical size. You are just
seeing the logical size of the file.
http://msdn.microsoft.com/en-us/library/ms175823.aspx
Look at the available space on your drive before and after creating the
snapshot. You will find that although the file is reported as being 223mb,
the available space on your drive has hardly diminished at all.
David
|||And just to add, within SQL you can use fn_virtualfilestats to get the
actual size on disk of a snapshot e.g.
select db_name(DbId) as [Database],
sum(cast(((BytesOnDisk/1024.0)/1024.0) as numeric(25,2))) as [SizeOnDisk_MB]
from fn_virtualfilestats(-1,-1)
group by db_name(DbId)
You should see your snapshot database is a lot smaller than the database
it's based on (initially at least!)
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Leila" <Leilas@.hotpop.com> wrote in message
news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to
> create new forums for SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is
> created, and gradually grows. But I tried on my databases (even big ones)
> and its size is the same as original data files. For example on
> AdventureWorks, the sparse file I created took 223mb which is even bigger
> than the db itself!
> Any help would be greatly appreciated.
> Leila
>

Database Snapshot (SQL Server 2005)

Hi,
Sorry for posting my question in this group. Isn't Micsrosoft going to
create new forums for SQL2K5?
BOL states that the snapshot file(sparse file) is small when it is created,
and gradually grows. But I tried on my databases (even big ones) and its
size is the same as original data files. For example on AdventureWorks, the
sparse file I created took 223mb which is even bigger than the db itself!
Any help would be greatly appreciated.
Leila
Right-click the file in explorer, properties, check "size on disk".
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Leila" <Leilas@.hotpop.com> wrote in message news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to create new forums for
> SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is created, and gradually grows.
> But I tried on my databases (even big ones) and its size is the same as original data files. For
> example on AdventureWorks, the sparse file I created took 223mb which is even bigger than the db
> itself!
> Any help would be greatly appreciated.
> Leila
>
|||That is the way a sparse file works. It appears as large as it can be but
in reality it is only a few bytes to begin with and will grow as it gets
populated. Right click on the file in Explorer and choose properties. You
will see both sizes.
Andrew J. Kelly SQL MVP
"Leila" <Leilas@.hotpop.com> wrote in message
news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to
> create new forums for SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is
> created, and gradually grows. But I tried on my databases (even big ones)
> and its size is the same as original data files. For example on
> AdventureWorks, the sparse file I created took 223mb which is even bigger
> than the db itself!
> Any help would be greatly appreciated.
> Leila
>
|||And just to add, within SQL you can use fn_virtualfilestats to get the
actual size on disk of a snapshot e.g.
select db_name(DbId) as [Database],
sum(cast(((BytesOnDisk/1024.0)/1024.0) as numeric(25,2))) as [SizeOnDisk_MB]
from fn_virtualfilestats(-1,-1)
group by db_name(DbId)
You should see your snapshot database is a lot smaller than the database
it's based on (initially at least!)
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Leila" <Leilas@.hotpop.com> wrote in message
news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to
> create new forums for SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is
> created, and gradually grows. But I tried on my databases (even big ones)
> and its size is the same as original data files. For example on
> AdventureWorks, the sparse file I created took 223mb which is even bigger
> than the db itself!
> Any help would be greatly appreciated.
> Leila
>

Database Snapshot (SQL Server 2005)

Hi,
--
Sorry for posting my question in this group. Isn't Micsrosoft going to
create new forums for SQL2K5?
--
BOL states that the snapshot file(sparse file) is small when it is created,
and gradually grows. But I tried on my databases (even big ones) and its
size is the same as original data files. For example on AdventureWorks, the
sparse file I created took 223mb which is even bigger than the db itself!
Any help would be greatly appreciated.
LeilaRight-click the file in explorer, properties, check "size on disk".
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Leila" <Leilas@.hotpop.com> wrote in message news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to create new forums for
> SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is created, and gradually grows.
> But I tried on my databases (even big ones) and its size is the same as original data files. For
> example on AdventureWorks, the sparse file I created took 223mb which is even bigger than the db
> itself!
> Any help would be greatly appreciated.
> Leila
>|||That is the way a sparse file works. It appears as large as it can be but
in reality it is only a few bytes to begin with and will grow as it gets
populated. Right click on the file in Explorer and choose properties. You
will see both sizes.
--
Andrew J. Kelly SQL MVP
"Leila" <Leilas@.hotpop.com> wrote in message
news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to
> create new forums for SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is
> created, and gradually grows. But I tried on my databases (even big ones)
> and its size is the same as original data files. For example on
> AdventureWorks, the sparse file I created took 223mb which is even bigger
> than the db itself!
> Any help would be greatly appreciated.
> Leila
>|||"Leila" <Leilas@.hotpop.com> wrote in message
news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to
> create new forums for SQL2K5?
> --
I hope not. It's just SQL Server.
> BOL states that the snapshot file(sparse file) is small when it is
> created, and gradually grows. But I tried on my databases (even big ones)
> and its size is the same as original data files. For example on
> AdventureWorks, the sparse file I created took 223mb which is even bigger
> than the db itself!
>
Sparse files have a logical size and a smaller physical size. You are just
seeing the logical size of the file.
http://msdn.microsoft.com/en-us/library/ms175823.aspx
Look at the available space on your drive before and after creating the
snapshot. You will find that although the file is reported as being 223mb,
the available space on your drive has hardly diminished at all.
David|||And just to add, within SQL you can use fn_virtualfilestats to get the
actual size on disk of a snapshot e.g.
select db_name(DbId) as [Database],
sum(cast(((BytesOnDisk/1024.0)/1024.0) as numeric(25,2))) as [SizeOnDisk_MB]
from fn_virtualfilestats(-1,-1)
group by db_name(DbId)
You should see your snapshot database is a lot smaller than the database
it's based on (initially at least!)
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Leila" <Leilas@.hotpop.com> wrote in message
news:usZ5Tdr5FHA.2576@.TK2MSFTNGP10.phx.gbl...
> Hi,
> --
> Sorry for posting my question in this group. Isn't Micsrosoft going to
> create new forums for SQL2K5?
> --
> BOL states that the snapshot file(sparse file) is small when it is
> created, and gradually grows. But I tried on my databases (even big ones)
> and its size is the same as original data files. For example on
> AdventureWorks, the sparse file I created took 223mb which is even bigger
> than the db itself!
> Any help would be greatly appreciated.
> Leila
>sql