Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit da122fa

Browse files
author
Ajay Dwivedi
committed
Updating few lines
1 parent 7b3e40f commit da122fa

File tree

14 files changed

+234
-19
lines changed

14 files changed

+234
-19
lines changed
7.5 KB
Binary file not shown.

‎Baselining/Baselining.ssmssqlproj‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
<FullPath>Agent Operator [Ajay Dwivedi].sql</FullPath>
5151
</FileNode>
5252
<FileNode Name="Baseline with [sp_BlitzFirst].sql">
53-
<AssociatedConnectionMoniker />
54-
<AssociatedConnSrvName />
53+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local):True</AssociatedConnectionMoniker>
54+
<AssociatedConnSrvName>(local)</AssociatedConnSrvName>
5555
<AssociatedConnUserName />
5656
<FullPath>Baseline with [sp_BlitzFirst].sql</FullPath>
5757
</FileNode>
@@ -98,8 +98,8 @@
9898
<FullPath>Generate-Workload-StackOverflow.sql</FullPath>
9999
</FileNode>
100100
<FileNode Name="Job [DBA - FirstResponderKit_Collect_PerformanceData].sql">
101-
<AssociatedConnectionMoniker />
102-
<AssociatedConnSrvName />
101+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local):True</AssociatedConnectionMoniker>
102+
<AssociatedConnSrvName>(local)</AssociatedConnSrvName>
103103
<AssociatedConnUserName />
104104
<FullPath>Job [DBA - FirstResponderKit_Collect_PerformanceData].sql</FullPath>
105105
</FileNode>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
$server = 'TestVm'
2+
3+
<#
4+
$result_all = Get-DbaDbSpace -SqlInstance $server
5+
# Get Log Shipped Database from Source
6+
$result_rcm = Get-DbaDbSpace -SqlInstance SourceTestVM -Database 'RCM_rovicore_20130710_NoMusic1a_en-US'
7+
#>
8+
9+
# Group result by Database, and Get Drive size required
10+
$result_db_wise = $result_all | Group-Object -Property {$_.Database};
11+
foreach($db in $result_db_wise) {
12+
$dbName = $db.Name
13+
$size = ($db.Group.FileSize.Gigabyte | Measure-Object -Sum).Sum;
14+
Write-Host "[$dbName] => $size gb" -ForegroundColor Green #-BackgroundColor White;
15+
Get-SpaceToAdd -TotalSpace_GB $size -UsedSpace_GB $size -Percent_Free_Space_Required 35
16+
Write-Host ''
17+
}
18+
19+
# Get Total Size in GB for Small Dbs
20+
$smallDbs = $result_all | Where-Object {$_.Database -notin @('IDS','tempdb','master','model','msdb') }
21+
$smallDbs_Size_Gb = ($smallDbs.FileSize.Gigabyte | Measure-Object -Sum).Sum;
22+
Get-SpaceToAdd -TotalSpace_GB $smallDbs_Size_Gb -UsedSpace_GB $smallDbs_Size_Gb -Percent_Free_Space_Required 35;
23+
24+
# Get TempDb Size required = 20% of Total All Db size
25+
$allDbs_except_TempDb = $result_all | Where-Object {$_.Database -notin @('tempdb') };
26+
$tempDb_Size_Gb = (($allDbs_except_TempDb.FileSize.Gigabyte | Measure-Object -Sum).Sum) * 0.2;
27+
Get-SpaceToAdd -TotalSpace_GB $tempDb_Size_Gb -UsedSpace_GB $tempDb_Size_Gb -Percent_Free_Space_Required 35;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
use dba
2+
-- https://tidbytez.com/2016/10/21/how-to-identify-all-user-objects-in-the-sql-server-master-database/
3+
4+
Invoke-DbaQuery -SqlInstance SomeProdServerPOC -Query $query | Write-DbaDataTable -SqlInstance SomeProdServerPOCPOC -Database DBA -Table SomeProdServerPOC_SysObjects -AutoCreateTable
5+
6+
--use master;
7+
--SELECT o.object_id AS ObjectId
8+
-- ,o.NAME AS ObjectName
9+
-- ,o.type_desc AS ObjectType
10+
-- ,o.create_date AS CreateDate
11+
-- ,o.modify_date AS ModifyDate
12+
-- ,SUM(st.row_count) AS RowCnt
13+
-- ,CAST(SUM(st.used_page_count) / 128.0 AS DECIMAL(36, 1)) AS DataSize_MB
14+
--into DBA..SomeProdServerPOCPOC_SysObjects
15+
--FROM master.sys.objects o
16+
--LEFT JOIN master.sys.dm_db_partition_stats st ON st.object_id = o.object_id
17+
-- AND st.index_id < 2
18+
--GROUP BY o.object_id
19+
-- ,o.NAME
20+
-- ,o.type_desc
21+
-- ,o.create_date
22+
-- ,o.modify_date
23+
-- ,o.is_ms_shipped
24+
--HAVING o.is_ms_shipped = 0
25+
-- AND o.NAME <> 'sp_ssis_startup'
26+
-- AND o.type_desc NOT LIKE '%CONSTRAINT%'
27+
--ORDER BY CAST(SUM(st.used_page_count) / 128.0 AS DECIMAL(36, 1)) DESC
28+
-- ,RowCnt DESC
29+
30+
--select * from [dbo].[SomeProdServerPOC_SysObjects]
31+
--select * from [dbo].SomeProdServerPOCPOC_SysObjects
32+
33+
34+
use dba
35+
36+
select o.ObjectName, o.ObjectType, o.CreateDate, o.RowCnt, p.ObjectName
37+
from [dbo].[SomeProdServerPOC_SysObjects] o
38+
left join [dbo].SomeProdServerPOCPOC_SysObjects p
39+
on o.ObjectName = p.ObjectName
40+
where p.ObjectName is null
41+
order by o.ObjectName
42+
43+
--truncate table [SomeProdServerPOC_SysObjects]
44+
--drop table SomeProdServerPOCPOC_SysObjects

‎InstanceMigration/InstanceMigration.ssmssqlproj‎

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,69 @@
1515
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
1616
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
1717
</ConnectionNode>
18+
<ConnectionNode Name="LOCALHOST:CORPORATE\adwivedi">
19+
<Created>2020年02月17日T11:51:43.1806786+05:30</Created>
20+
<Type>SQL</Type>
21+
<Server>LOCALHOST</Server>
22+
<UserName />
23+
<Authentication>Windows Authentication</Authentication>
24+
<InitialDB>master</InitialDB>
25+
<LoginTimeout>30</LoginTimeout>
26+
<ExecutionTimeout>0</ExecutionTimeout>
27+
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
28+
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
29+
</ConnectionNode>
30+
<ConnectionNode Name="TUL1CIPCNPDB1:CORPORATE\adwivedi">
31+
<Created>2020年02月18日T14:05:59.9804573+05:30</Created>
32+
<Type>SQL</Type>
33+
<Server>TUL1CIPCNPDB1</Server>
34+
<UserName />
35+
<Authentication>Windows Authentication</Authentication>
36+
<InitialDB />
37+
<LoginTimeout>30</LoginTimeout>
38+
<ExecutionTimeout>0</ExecutionTimeout>
39+
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
40+
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
41+
</ConnectionNode>
1842
</Items>
1943
</LogicalFolder>
2044
<LogicalFolder Name="Queries" Type="0" Sorted="true">
2145
<Items>
46+
<FileNode Name="Check-Space-Requirement.sql">
47+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:TUL1CIPCNPDB1:True</AssociatedConnectionMoniker>
48+
<AssociatedConnSrvName>TUL1CIPCNPDB1</AssociatedConnSrvName>
49+
<AssociatedConnUserName />
50+
<FullPath>Check-Space-Requirement.sql</FullPath>
51+
</FileNode>
52+
<FileNode Name="Get-UserObjects-in-SystemDb.sql">
53+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local):True</AssociatedConnectionMoniker>
54+
<AssociatedConnSrvName>(local)</AssociatedConnSrvName>
55+
<AssociatedConnUserName />
56+
<FullPath>Get-UserObjects-in-SystemDb.sql</FullPath>
57+
</FileNode>
2258
<FileNode Name="LoginsUsers.sql">
23-
<AssociatedConnectionMoniker />
24-
<AssociatedConnSrvName />
59+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:LOCALHOST:True</AssociatedConnectionMoniker>
60+
<AssociatedConnSrvName>LOCALHOST</AssociatedConnSrvName>
2561
<AssociatedConnUserName />
2662
<FullPath>LoginsUsers.sql</FullPath>
2763
</FileNode>
28-
<FileNode Name="Move-TempDb.sql">
29-
<AssociatedConnectionMoniker />
30-
<AssociatedConnSrvName />
64+
<FileNode Name="Migrate-SSRS-Reports.sql">
65+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local):True</AssociatedConnectionMoniker>
66+
<AssociatedConnSrvName>(local)</AssociatedConnSrvName>
3167
<AssociatedConnUserName />
32-
<FullPath>Move-TempDb.sql</FullPath>
68+
<FullPath>Migrate-SSRS-Reports.sql</FullPath>
3369
</FileNode>
34-
<FileNode Name="SQLQuery1.sql">
70+
<FileNode Name="Migration-Issues.sql">
71+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local):True</AssociatedConnectionMoniker>
72+
<AssociatedConnSrvName>(local)</AssociatedConnSrvName>
73+
<AssociatedConnUserName />
74+
<FullPath>Migration-Issues.sql</FullPath>
75+
</FileNode>
76+
<FileNode Name="Move-TempDb.sql">
3577
<AssociatedConnectionMoniker />
3678
<AssociatedConnSrvName />
3779
<AssociatedConnUserName />
38-
<FullPath>SQLQuery1.sql</FullPath>
80+
<FullPath>Move-TempDb.sql</FullPath>
3981
</FileNode>
4082
<FileNode Name="v0.0 - Move Data and Log Files.sql">
4183
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:(local):True</AssociatedConnectionMoniker>

‎InstanceMigration/LoginsUsers.sql‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,15 @@ Export-DbaUser -SqlInstance TUL1CIPXDB18 -Database Logging -User RV_BP_APPUSR
55
-- 01) Script Out User Permissions
66
Import-Module dbatools;
77
Export-DbaUser -SqlInstance TUL1CIPXDB18 -Database Logging -User RV_BP_APPUSR
8+
9+
-- 02) Script Out User Permissions
10+
$scriptPath = Get-DatabasePermissions -SqlInstance tul1advDdb1old2;
11+
$server = 'servername'
12+
$files = Get-ChildItem $scriptPath;
13+
14+
foreach($file in $files) {
15+
$dbName = $file.BaseName;
16+
$fileName = $file.FullName;
17+
Write-Host "Writing to database '$dbName'" -ForegroundColor Black -BackgroundColor White;
18+
Invoke-DbaQuery -SqlInstance $server -Database $dbName -File $fileName;
19+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
To migrate the SSRS from 2008 to SSRS 2014, you can following steps below to use the RS.exe script to copies content items and settings from one SQL Server Reporting Services report server to another report server(for example reports and subscriptions,security setting from server to another server. The script supports both SharePoint mode and Native mode report servers):
2+
3+
1. using the RS.exe utility Download the script file from the CodePlex site Reporting Services RS.exe script migrates content to a local folder, for example c:\rss\ssrs_migration.rss.
4+
5+
2. Open a command prompt with administrative privileges.
6+
7+
3. Navigate to the folder containing the ssrs_migration.rss file.
8+
9+
4. Run the following command to migrate contents from the native mode Sourceserver to the native mode Targetserver:
10+
11+
rs.exe -i ssrs_migration.rss -e Mgmt2010 -s http://SourceServer/ReportServer -u Domain\User -p password -v ts="http://TargetServer/reportserver" -v tu="Domain\Userser" -v tp="password"
12+
13+
More Details information:
14+
Sample Reporting Services rs.exe Script to Migrate Content between Report Servers
15+
16+
Please reference to details steps about the migration and upgrade in these article:
17+
Migrate a Reporting Services Installation (Native Mode) - google
18+
Upgrade and Migrate Reporting Services - google
19+
Migrating SQL Reporting Services to a new server by moving the Reporting Services databases - google
20+
21+
After you restored the related DB from the old 2008 to the new 2014, when you create an new project on the 2014 and import the rdl reports from the 2008 into this project, you just need to change the connection string to make the report works fine.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- SSIS Proxy Credentials
2+
3+
Copy-DbaCredential -Source SourceServerName -Destination DestinationServerName -Name "DS_BISSIS_Cred" -Force
4+

‎PermissionIssues/PermissionIssues.ssmssqlproj‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,25 @@
2727
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
2828
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
2929
</ConnectionNode>
30+
<ConnectionNode Name="TUL1CIPCNPDB1:CORPORATE\adwivedi">
31+
<Created>2020年02月18日T10:44:33.5872848+05:30</Created>
32+
<Type>SQL</Type>
33+
<Server>TUL1CIPCNPDB1</Server>
34+
<UserName />
35+
<Authentication>Windows Authentication</Authentication>
36+
<InitialDB />
37+
<LoginTimeout>30</LoginTimeout>
38+
<ExecutionTimeout>0</ExecutionTimeout>
39+
<ConnectionProtocol>NotSpecified</ConnectionProtocol>
40+
<ApplicationName>Microsoft SQL Server Management Studio - Query</ApplicationName>
41+
</ConnectionNode>
3042
</Items>
3143
</LogicalFolder>
3244
<LogicalFolder Name="Queries" Type="0" Sorted="true">
3345
<Items>
3446
<FileNode Name="Database-Permissions-(Direct+Indirect).sql">
35-
<AssociatedConnectionMoniker />
36-
<AssociatedConnSrvName />
47+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:TUL1CIPCNPDB1:True</AssociatedConnectionMoniker>
48+
<AssociatedConnSrvName>TUL1CIPCNPDB1</AssociatedConnSrvName>
3749
<AssociatedConnUserName />
3850
<FullPath>Database-Permissions-(Direct+Indirect).sql</FullPath>
3951
</FileNode>
@@ -55,6 +67,12 @@
5567
<AssociatedConnUserName />
5668
<FullPath>Install Powershell ISE.sql</FullPath>
5769
</FileNode>
70+
<FileNode Name="SQLQuery1.sql">
71+
<AssociatedConnectionMoniker>8c91a03d-f9b4-46c0-a305-b5dcc79ff907:TUL1CIPCNPDB1:True</AssociatedConnectionMoniker>
72+
<AssociatedConnSrvName>TUL1CIPCNPDB1</AssociatedConnSrvName>
73+
<AssociatedConnUserName />
74+
<FullPath>SQLQuery1.sql</FullPath>
75+
</FileNode>
5876
</Items>
5977
</LogicalFolder>
6078
<LogicalFolder Name="Miscellaneous" Type="3" Sorted="true">
File renamed without changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /