forked from himadanreddy/SQL-DBA-SCRIPTS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigure Distribution First Time.sql
More file actions
63 lines (59 loc) · 1.76 KB
/
Configure Distribution First Time.sql
File metadata and controls
63 lines (59 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/****** Scripting replication configuration. Script Date: 12/21/2011 10:14:34 AM ******/
/****** Please Note: For security reasons, all password parameters were scripted with either NULL or an empty string. ******/
/****** Installing the server as a Distributor. Script Date: 12/21/2011 10:14:34 AM ******/
use master
exec sp_adddistributor
@distributor = N'SQLCLR07-P',
@password = N'$$waz00!*' -- Is the password of the distributor_admin login
GO
exec sp_adddistributiondb
@database = N'distribution',
@data_folder = N'I:\Data\Distribution',
@data_file_size = 5120,
@log_folder = N'G:\Log\Distribution',
@log_file_size = 2048,
@min_distretention = 0,
@max_distretention = 72,
@history_retention = 48,
@security_mode = 1
GO
use [distribution]
if (not exists (select * from sysobjects where name = 'UIProperties' and type = 'U '))
create table UIProperties(id int)
if (exists (select * from ::fn_listextendedproperty('SnapshotFolder', 'user', 'dbo', 'table', 'UIProperties', null, null)))
BEGIN
EXEC sp_updateextendedproperty
N'SnapshotFolder',
N'\\SQLCLR07-P\SQLRepl',
'user',
dbo,
'table',
'UIProperties'
END
else
BEGIN
EXEC sp_addextendedproperty
N'SnapshotFolder',
N'\\SQLCLR07-P\SQLRepl',
'user',
dbo,
'table',
'UIProperties'
END
GO
exec sp_adddistpublisher
@publisher = N'SQLCLR07-P',
@distribution_db = N'distribution',
@security_mode = 1,
@working_directory = N'\\SQLCLR07-P\SQLRepl',
@trusted = N'false',
@thirdparty_flag = 0,
@publisher_type = N'MSSQLSERVER'
GO
-- ADJUST DISTRIBUTION DB FILE GROWTH SIZE
USE [master]
GO
ALTER DATABASE [distribution] MODIFY FILE ( NAME = N'distribution', FILEGROWTH = 1048576KB )
GO
ALTER DATABASE [distribution] MODIFY FILE ( NAME = N'distribution_log', FILEGROWTH = 1048576KB )
GO