sync
This commit is contained in:
19
MIG - e-galexis url change.sql
Normal file
19
MIG - e-galexis url change.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
USE [Arizona]
|
||||
|
||||
SELECT
|
||||
ou.[OU_subsidiary]
|
||||
,s.[SUB_prefix]
|
||||
,ou.[OU_code]
|
||||
,ou.[OU_short_name]
|
||||
,ws.[WSA_code]
|
||||
,c.[WSAC_url]
|
||||
--UPDATE c SET [c].[WSAC_url] = 'https://xml.e-galexis.com:10443/POS/'
|
||||
FROM [dbo].[WSA_connection] c
|
||||
JOIN [dbo].[Web_service_access] ws ON ws.[Web_service_access_GUID] = c.[WSAC_web_service_access]
|
||||
JOIN [dbo].[Organizational_unit] ou ON ou.[Organizational_unit_ID] = c.[WSAC_organizational_unit]
|
||||
JOIN [dbo].[Subsidiary] s ON s.[Subsidiary_ID] = [ou].[OU_subsidiary]
|
||||
WHERE ou.[OU_code] LIKE '824'
|
||||
AND [s].[SUB_prefix]='CVI'
|
||||
AND [ws].[WSA_code] LIKE 'apswsGalexisPurchase'
|
||||
|
||||
|
||||
50
MIG - update medifilm path (userdata).sql
Normal file
50
MIG - update medifilm path (userdata).sql
Normal file
@@ -0,0 +1,50 @@
|
||||
Use ActivePos_server
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
DECLARE @ou_id INT
|
||||
EXEC Arizona.dbo.sp_bmc_Bmc_Applic_Default
|
||||
@in_job_type = 3,
|
||||
@in_param_int_1 = null, /* Company */
|
||||
@in_param_int_2 = null, /* Subsidiary */
|
||||
@in_param_varchar_1 = 'cvCurrentOrganizationalUnit',
|
||||
@out_default_value = @ou_id output,
|
||||
@out_param_int_1 = NULL
|
||||
|
||||
DECLARE @newVal NVARCHAR(500);
|
||||
|
||||
|
||||
/*Save the current value in [HCITools].[tmp].[TT_medifilm_setting]*/
|
||||
IF OBJECT_ID('[HCITools].[tmp].[TT_medifilm_setting]') IS NULL
|
||||
BEGIN
|
||||
CREATE TABLE [HCITools].[tmp].[TT_medifilm_setting](
|
||||
oldValue VARCHAR(MAX) NULL,
|
||||
dateChange DATETIME2(2) NOT NULL CONSTRAINT df_dateChange DEFAULT GETDATE()
|
||||
)
|
||||
END
|
||||
|
||||
/*dynamic sql to avoid exception because of non existing table while compiling the batch*/
|
||||
EXEC('
|
||||
INSERT INTO [HCITools].[tmp].[TT_medifilm_setting]([oldValue])
|
||||
SELECT [SE].[SettingValue]
|
||||
FROM [dbo].[Settings] SE
|
||||
where [SE].[SettingId] = ''Values.Global.SalesImportService.MainDirectory''
|
||||
')
|
||||
|
||||
/*Craft the new URI from the OU ofthe pharmacy*/
|
||||
SELECT @newVal = REPLACE('\\centralinfra.net\GAL\90_UserData\@ou@\POS\Medifilm', '@ou@', RTRIM(i.[Customer])+LTRIM(o.[OU_code]))
|
||||
FROM [Arizona].dbo.[Organizational_unit] [o]
|
||||
CROSS JOIN [master].cfg.[Identity] [i]
|
||||
WHERE [o].[Organizational_unit_ID] = @ou_id
|
||||
|
||||
/*Update the setting*/
|
||||
UPDATE se SET [SE].[SettingValue]= @newVal
|
||||
FROM [dbo].[Settings] SE (nolock)
|
||||
where [SE].[SettingId] = 'Values.Global.SalesImportService.MainDirectory'
|
||||
|
||||
/*restart the service to apply the change*/
|
||||
EXEC xp_cmdshell 'net stop arizonaServerService'
|
||||
EXEC xp_cmdshell 'net start arizonaServerService'
|
||||
|
||||
--COMMIT TRANSACTION
|
||||
ROLLBACK TRANSACTION
|
||||
@@ -13,7 +13,7 @@ DECLARE @isX64 BIT = 1;
|
||||
DECLARE @ThreadStackSize INT;
|
||||
DECLARE @osReserved INT;
|
||||
DECLARE @newMaxMem INT;
|
||||
DECLARE @appReserved INT = 0*1024*1024; --memory reserved for other apps on the server in Kb
|
||||
DECLARE @appReserved INT = 4*1024*1024; --memory reserved for other apps on the server in Kb
|
||||
|
||||
SELECT @totSysMemKb = [total_physical_memory_kb]
|
||||
FROM [sys].[dm_os_sys_memory];
|
||||
|
||||
62
TPDT-268 - ACP in task sequence/dumpDevice.ps1
Normal file
62
TPDT-268 - ACP in task sequence/dumpDevice.ps1
Normal file
@@ -0,0 +1,62 @@
|
||||
<#
|
||||
TPDT-287
|
||||
|
||||
Change the dump device location for Arizona DB to a U drive if this drive exists
|
||||
|
||||
TSC 18.03.2024 Creation
|
||||
#>
|
||||
|
||||
$instance = "(local)\APSSQL"
|
||||
$target_path = "U:" #This path must NOT have a trailing slash
|
||||
|
||||
if(Test-Path -Path $target_path){
|
||||
$query=@"
|
||||
SELECT * FROM sys.backup_devices
|
||||
WHERE [name] IN
|
||||
(
|
||||
N'Arizona_Dump',
|
||||
N'Arizona_dump_SECU'
|
||||
)
|
||||
AND physical_name like 'd:%'
|
||||
"@
|
||||
$ds_dumpDevices = Invoke-Sqlcmd -ServerInstance $instance -Query $query -Database master
|
||||
|
||||
if($ds_dumpDevices.Count -gt 0){
|
||||
Write-Output "Path $target_path exists, ensuring Arizona dump devices are set to this drive"
|
||||
$query = @"
|
||||
|
||||
IF EXISTS (SELECT 1 FROM [sys].[backup_devices] WHERE name='Arizona_Dump' AND [physical_name] LIKE 'D:%')
|
||||
BEGIN
|
||||
EXEC [sys].[sp_dropdevice] @logicalname = 'Arizona_Dump',@delfile = NULL;
|
||||
PRINT 'Dump device Arizona_Dump removed';
|
||||
END
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM [sys].[backup_devices] WHERE name='Arizona_Dump')
|
||||
BEGIN
|
||||
EXEC master.dbo.sp_addumpdevice @devtype = N'disk',
|
||||
@logicalname = N'Arizona_Dump',
|
||||
@physicalname = N'$target_path\Arizona_Dump.bak';
|
||||
PRINT 'Dump device Arizona_Dump created on U drive';
|
||||
END
|
||||
|
||||
IF EXISTS (SELECT 1 FROM [sys].[backup_devices] WHERE name='Arizona_dump_SECU' AND [physical_name] LIKE 'D:%')
|
||||
BEGIN
|
||||
EXEC [sys].[sp_dropdevice] @logicalname = 'Arizona_dump_SECU',@delfile = NULL
|
||||
PRINT 'Dump device Arizona_dump_SECU removed';
|
||||
END
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM [sys].[backup_devices] WHERE name='Arizona_dump_SECU')
|
||||
BEGIN
|
||||
EXEC master.dbo.sp_addumpdevice @devtype = N'disk',
|
||||
@logicalname = N'Arizona_dump_SECU',
|
||||
@physicalname = N'$target_path\Arizona_dump_SECU.bak';
|
||||
PRINT 'Dump device Arizona_dump_SECU created on U drive';
|
||||
END
|
||||
|
||||
"@
|
||||
Invoke-Sqlcmd -ServerInstance $instance -Database master -Query $query
|
||||
}
|
||||
}
|
||||
else{
|
||||
Write-Output "Path $target_path does not exists, not touching dump devices"
|
||||
}
|
||||
Reference in New Issue
Block a user