Showing posts with label locking. Show all posts
Showing posts with label locking. Show all posts

Friday, March 9, 2012

Nomore snapshot without locking tables?

HI There

After upgrading my publishers to 2005 i noticed that i cannot specify not to lock tables during snapshot during publication creation, also not on publication properties, and i see sp_addpublication has no such parameter, is there no longer an option not to lock publication tables during snapshot?

Thanx

Hi Dietz,

You can specify the @.sync_method parameter of sp_addpublication to be concurrent or concurrent_c.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_sp_repl_4s32.asp

[ @.sync_method=] 'sync_method'

Is the synchronization mode. sync_method is nvarchar(13), and can be one of the following values.

Value

Description

native

Produces native-mode bulk copy program output of all tables. Not supported for Oracle Publishers.

character

Produces character-mode bulk copy program output of all tables. For an Oracle Publisher, character is valid only for snapshot replication.

concurrent

Produces native-mode bulk copy program output of all tables but does not lock tables during the snapshot. Only supported for transactional publications. Not supported for Oracle Publishers.

concurrent_c

Produces character-mode bulk copy program output of all tables but does not lock tables during the snapshot. Only supported for transactional publications.

NULL (default)

Defaults to native for Microsoft SQL Server Publishers. For non-SQL Server Publishers, defaults to character when the value of repl_freq is Snapshot and to concurrent_c for all other cases.

Regards,

Gary

|||

Thanx Gary

As far as i can see this option is not available though management studio when creating a publication or viewing publication properties after creation, correct ? Only through TSQL.

Wednesday, March 7, 2012

NOLOCK statement

If you were to set up a SQL statement with 6 tables and you want to make
sure all 6 tables were not locking other tables should a NOLOCK statement be
placed after each table name?
Thanks,
select a.table_name, b.table_name, c.table_name,
d.table_name, e.table_name, f.table_name
from a (NOLOCK),
b (NOLOCK),
c (NOLOCK),
d (NOLOCK),
e (NOLOCK),
f (NOLOCK)Or you could use SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
http://www.aspfaq.com/
(Reverse address to reply.)
"Joe K." <JoeK@.discussions.microsoft.com> wrote in message
news:3FD67600-052E-4E91-8EF1-D5A7E22B1346@.microsoft.com...
> If you were to set up a SQL statement with 6 tables and you want to make
> sure all 6 tables were not locking other tables should a NOLOCK statement
be
> placed after each table name?
> Thanks,
> select a.table_name, b.table_name, c.table_name,
> d.table_name, e.table_name, f.table_name
> from a (NOLOCK),
> b (NOLOCK),
> c (NOLOCK),
> d (NOLOCK),
> e (NOLOCK),
> f (NOLOCK)
>|||As Aaron stated it may be easier to use the READ UNCOMMITTED isolation level
but you should get in the habit of using WITH when you specify hints.
While it is optional now it may not be in the next release.
Andrew J. Kelly SQL MVP
"Joe K." <JoeK@.discussions.microsoft.com> wrote in message
news:3FD67600-052E-4E91-8EF1-D5A7E22B1346@.microsoft.com...
> If you were to set up a SQL statement with 6 tables and you want to make
> sure all 6 tables were not locking other tables should a NOLOCK statement
> be
> placed after each table name?
> Thanks,
> select a.table_name, b.table_name, c.table_name,
> d.table_name, e.table_name, f.table_name
> from a (NOLOCK),
> b (NOLOCK),
> c (NOLOCK),
> d (NOLOCK),
> e (NOLOCK),
> f (NOLOCK)
>