Lock request time out period exceeded error

yasith
Member Posts: 30
Hi,
I'm trying to create NAV tenant (NAV 2015) using PowerShell in Windows Server 2012 environment.
When I execute HowTo-MoveCompanyToTenant script it gives following error;
Invoke-Sqlcmd : Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
At
\Sana Remote Installation Files\NAVTenantInstallation\AddCompanyTenant.ps1:300 char:9
+ Invoke-Sqlcmd -Database $FromDatabase -InputFile "G:\HowTo-MoveCompanyTo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlPowerShellSqlExecutionException
+ FullyQualifiedErrorId : SqlError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
And windows event log says;
Lock request time out period exceeded.
In the PowerShell script, I have done following modification in-order to read HowTo-MoveCompanyToTenant.sql script.
......
Write-Verbose "Moving company ""$company"" from server/database (Tenant) $DatabaseServer/$FromDatabase ($OldTenantName) to new database/tenant $ToDatabase/$NewTenantName"
Write-Verbose "Creating company ""$company"""
New-NAVCompany -ServerInstance $ServerInstance -Tenant $NewTenantName -CompanyName $company
#Move the data from the old to the new company
Write-Verbose "Moving data"
$VariableArray = "Company=$company","FromDatabase=$FromDatabase","ToDatabase=$ToDatabase"
#$sqlFile = Join-Path $PSScriptRoot 'HowTo-MoveCompanyToTenant.sql'
#Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $FromDatabase -InputFile $sqlFile -Variable $VariableArray -ConnectionTimeout 0
Invoke-Sqlcmd -Database $FromDatabase -InputFile "G:\HowTo-MoveCompanyToTenant.sql" -QueryTimeout 0 -ServerInstance $DBServerWithInstance -Variable $VariableArray
if ($RemoveCompanyWhenMoved)
{
Write-Verbose "Dropping old company"
Remove-NAVCompany -ServerInstance $ServerInstance -Tenant $OldTenantName -CompanyName $company -Force
}
........
Can anyone help me to sort out this issue.
Best regards,
Yasith
I'm trying to create NAV tenant (NAV 2015) using PowerShell in Windows Server 2012 environment.
When I execute HowTo-MoveCompanyToTenant script it gives following error;
Invoke-Sqlcmd : Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
At

+ Invoke-Sqlcmd -Database $FromDatabase -InputFile "G:\HowTo-MoveCompanyTo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Invoke-Sqlcmd], SqlPowerShellSqlExecutionException
+ FullyQualifiedErrorId : SqlError,Microsoft.SqlServer.Management.PowerShell.GetScriptCommand
And windows event log says;
Lock request time out period exceeded.
In the PowerShell script, I have done following modification in-order to read HowTo-MoveCompanyToTenant.sql script.
......
Write-Verbose "Moving company ""$company"" from server/database (Tenant) $DatabaseServer/$FromDatabase ($OldTenantName) to new database/tenant $ToDatabase/$NewTenantName"
Write-Verbose "Creating company ""$company"""
New-NAVCompany -ServerInstance $ServerInstance -Tenant $NewTenantName -CompanyName $company
#Move the data from the old to the new company
Write-Verbose "Moving data"
$VariableArray = "Company=$company","FromDatabase=$FromDatabase","ToDatabase=$ToDatabase"
#$sqlFile = Join-Path $PSScriptRoot 'HowTo-MoveCompanyToTenant.sql'
#Invoke-Sqlcmd -ServerInstance $DatabaseServer -Database $FromDatabase -InputFile $sqlFile -Variable $VariableArray -ConnectionTimeout 0
Invoke-Sqlcmd -Database $FromDatabase -InputFile "G:\HowTo-MoveCompanyToTenant.sql" -QueryTimeout 0 -ServerInstance $DBServerWithInstance -Variable $VariableArray
if ($RemoveCompanyWhenMoved)
{
Write-Verbose "Dropping old company"
Remove-NAVCompany -ServerInstance $ServerInstance -Tenant $OldTenantName -CompanyName $company -Force
}
........
Can anyone help me to sort out this issue.
Best regards,
Yasith
0
Comments
-
When I analyze event log, following message were there;
Autogrow of file 'DynamicsNAV80_WS1962TestNAVTenantInstallation4' in database 'DynamicsNAV80_WS1962TestNAVTenantInstallation4' was cancelled by user or timed out after 153 milliseconds. Use ALTER DATABASE to set a smaller FILEGROWTH value for this file or to explicitly set a new file size.
At that time my database auto growth percentage was 10%. So I changed that % into 5.
After that installation process took a long time to execute, but still got the timeout error.
Can some one advise me on this issue?
:-k0 -
start off with a large enough database - data file and log file - to complete the processDavid Machanick
http://mibuso.com/blogs/davidmachanick/0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions