Near-Continuous replication and database growth

VMware specific discussions

Re: Near-Continuous replication and database growth

Veeam Logoby dellock6 » Tue Feb 18, 2014 10:09 pm

Really nice *Mark*, thanks for the detailed informations.

Luca.
Luca Dell'Oca
EMEA Cloud Architect @ Veeam Software

@dellock6
http://www.virtualtothecore.com
vExpert 2011-2012-2013-2014-2015-2016
Veeam VMCE #1
dellock6
Veeam Software
 
Posts: 5047
Liked: 1330 times
Joined: Sun Jul 26, 2009 3:39 pm
Location: Varese, Italy
Full Name: Luca Dell'Oca

Re: Near-Continuous replication and database growth

Veeam Logoby Unison » Wed Dec 10, 2014 12:13 am

mlinders wrote:Just received word back from VMware. Here is the official statement:

"The fix for this issue is currently in development for 5.1 Update 3 which is due for release approximation the end of this year. Due to the time frame I would like to suggest we archive this case. When 5.1 U3 is release can you upgrade your systems when possible. If the issue continues we can open a new case - referencing this one."

Regards,
Mark (That's not spelled Lars.... Gostev :wink: )



Hey Mark,
With Update 3 for 5.1 being released recently, did that provide any relief for these problems or have you moved on to 5.5? Has this issue presented in 5.5 at all?
We are just starting to see these symptoms in our environment (massive trans log file growth, nested veeam temp images getting stuck causing huge vm performance issues - never seen these issues until last couple months) and are running 5.1.
Unison
Enthusiast
 
Posts: 80
Liked: 16 times
Joined: Fri Feb 17, 2012 6:02 am
Full Name: Gav

Re: Near-Continuous replication and database growth

Veeam Logoby lars@norstat.no » Wed Dec 10, 2014 2:50 pm

I can say that these issues are still present on vSphere 5.5 with the very latest updates as of today.

My Vcenter grinded to an absolute standstill the other day and i reduced the database of the Vcenter from 68 GB down to about 7-8 GB.

Have to do this at least every 3 monts, but the slow down is incremental.

We are running about 2400 migration every 24 hours.
lars@norstat.no
Expert
 
Posts: 109
Liked: 14 times
Joined: Tue Nov 01, 2011 1:44 pm
Full Name: Lars Skjønberg

Re: Near-Continuous replication and database growth

Veeam Logoby Unison » Wed Dec 10, 2014 11:10 pm

Thats disappointing to hear :(
Its been difficult to find other reports of this - specially with others seeing the nested Veeam Temp Snapshots - do you know of others seeing this problem consistently?

We have not changed our replication setup, hosts, storage or network recently (not even any new vmware updates) which makes it hard to determine why this issue only just started happening here recently. For years this setup has run with no nested Veeam Temp Snapshots or vcentre database blowouts.

have you discovered any clues about the true cause of this or just given in to it and added it to your admin functions - clear the database regularly and watch for nested Veeam Temp Snapshots (got a vCLI script to run a couple times a day to help me capture the nested snapshots)?

Is it your database that is growing (.mdf) or is it your log.ldf file that is growing huge? It is my log.ldf that is growing huge....the transaction log....i am able to shrink that by 99% - so i am not sure why the transactions are not clearing out of here anymore considering it will allow me to do it manually....if the transaction was still running, i wouldn't think that the trans log could be reduced by 99%.
Unison
Enthusiast
 
Posts: 80
Liked: 16 times
Joined: Fri Feb 17, 2012 6:02 am
Full Name: Gav

Re: Near-Continuous replication and database growth

Veeam Logoby mlinders » Mon Dec 15, 2014 8:39 am

Hello Unison,

Lars is correct, this issue is still appearing in vSphere 5.5. I do have to say that there has been some slight improvement on the growth. With the latest versions of vSphere 5.5 we only have to clear our database about twice a year. This time is obviously based on the amount of replica jobs you are running.

The issue we had was not transaction log growth, but database growth. Since we are using the express version the 10 GB limit was reached.

I have seen issues with transaction logs growing quite large on VMware databases. This started when the maximum size for the log was set too small. Basically what happened was a cleanup procedure in the database was causing the log to grow. This makes sense, since it's making transactions in the database. Because the transaction log was full the changes were rolled back. This left the transaction log huge, and the database was unable to maintain itself, so the problem got worse over time.

If I remember it correctly we did 2 things:
1) Since we didn't have the SQL Agent tasks (SQL Express) we used Windows Scheduled tasks to cleanup the VMware database
2) We set the transaction log size to maximum 20 GB, so there is enough room for the DB maintenance to succeed.

Regards,
Mark
mlinders
Veeam ProPartner
 
Posts: 26
Liked: 8 times
Joined: Sun Apr 22, 2012 10:42 pm
Location: the Netherlands
Full Name: Mark Linders

Re: Near-Continuous replication and database growth

Veeam Logoby Unison » Mon Dec 15, 2014 11:02 pm

Hi Mark,
Thanks for confirming about the problem in 5.5 - i wont consider that the hail mary to this problem anymore :(

I have given in to shrinking the database/files again and everything is back to being small. I have also disabled our replication job completely - instead bumping up the incrementals on normal jobs to boost our recovery point objective........i am going to sit on this config for several months and see what happens to the database - see if it was the replication job blowing out the trans/database.

I think that others have probably run into vcenter services stopping because of the trans log hitting a max set size (when trying to run clean ups and then having to roll back - making no progress) - i didnt have that here as the trans log is set to unlimited growth.

Will keep an eye on this and see what happens from here.
Unison
Enthusiast
 
Posts: 80
Liked: 16 times
Joined: Fri Feb 17, 2012 6:02 am
Full Name: Gav

Re: Near-Continuous replication and database growth

Veeam Logoby larry » Tue Dec 16, 2014 6:19 pm 1 person likes this post

Sorry for not sharing long ago but... After having it happen at the worst time again, which is ever, I fixed with below. I used for a year plus now.

I run a weekly scheduled task "VL-Log-Shink"

Code: Select all
task runs C:\SQLCommands\swhinklog.bat
starts in C:\SQLCommands
run with highest privileged, not logged in. - local admin account.

swhinklog.bat contains one line
sqlcmd -S GR-VC\VIM_SQLEXP -i C:\SQLCommands\ShinkLog.sql >C:\SQLCommands\log.txt

ShinkLog.sql has 4 lines
USE VIM_VCDB
ALTER DATABASE [VIM_VCDB] SET RECOVERY SIMPLE;
DBCC SHRINKFILE(VIM_VCDB_log);
ALTER DATABASE [VIM_VCDB] SET RECOVERY FULL;


Never had an issue again.

To run on demand you must right click bat file and run as administrator
larry
Expert
 
Posts: 372
Liked: 89 times
Joined: Wed Mar 24, 2010 5:47 pm
Full Name: Larry Walker

Re: Near-Continuous replication and database growth

Veeam Logoby Unison » Wed Dec 17, 2014 2:48 am

Hey Larry,
thanks for posting - good solution to keep the log file under control (essentially its doing the same as using the GUI to shrink just the log file). Might deploy this 'automatic' method if my log continues to grow even after i have stopped replication.
Unison
Enthusiast
 
Posts: 80
Liked: 16 times
Joined: Fri Feb 17, 2012 6:02 am
Full Name: Gav

Re: Near-Continuous replication and database growth

Veeam Logoby dellock6 » Wed Dec 17, 2014 10:53 pm

vSphere 5.1 update 3 has been released few weeks ago, I've searched on release notes but I didn't find any reference to VPX_INT_ARRAY, Mark by any chance have you checked if this updates has fixed this issue as told by VMware when you opened the support case?
Luca Dell'Oca
EMEA Cloud Architect @ Veeam Software

@dellock6
http://www.virtualtothecore.com
vExpert 2011-2012-2013-2014-2015-2016
Veeam VMCE #1
dellock6
Veeam Software
 
Posts: 5047
Liked: 1330 times
Joined: Sun Jul 26, 2009 3:39 pm
Location: Varese, Italy
Full Name: Luca Dell'Oca

Re: Near-Continuous replication and database growth

Veeam Logoby mlinders » Tue Dec 30, 2014 10:36 am

Hello Luca,

No, I have not tested if the upgrade fixes the issue. We moved to vSphere 5.5 on all instances we are running. So there was no need for it. But if I had to guess... the problem will probably be still there even after the upgrade. But as I said, that's just a guess.

Regards,
Mark
mlinders
Veeam ProPartner
 
Posts: 26
Liked: 8 times
Joined: Sun Apr 22, 2012 10:42 pm
Location: the Netherlands
Full Name: Mark Linders

Re: Near-Continuous replication and database growth

Veeam Logoby gerry_the_hat » Wed Dec 16, 2015 2:34 pm

Hi Folks,

Seems that the Veeam support is not that aware of this issue. Had some cases open related to "An existing connection was forcibly closed", which then seems to be related to this unfixed VMware bug. Can someone please help and force VMware to relase a fix?

@Anton:
Can you help?

Here is what I've just sent to Veeam support (case 01207942):
A small update from my side: Seems that we ran into a know issue on VMware (see VMware case 15818171111). This is related to Veeam replication used over a long periode of time. What VMware processes in a wrong manner is the amount of logs etc. in the VMware SQL database. Some tables (VPX_INT_ARRAY in particular) grow over time and decreases the overall vCenter performance dramatically. This leads to timeouts and error messages like "An existing connection was forcibly closed". The workaround is to set up a database cleanup job at a regular basis. It might be the case that replication is used by other customers in short intervals as well, so this issue could possible affect quite some Veeam users. Therefore I'd like to suggest publishing a knowledge base article. You may close this case now. Thanks Gerd


Cheers
Gerd
gerry_the_hat
Lurker
 
Posts: 1
Liked: never
Joined: Thu Jul 30, 2015 1:46 pm

Re: Near-Continuous replication and database growth

Veeam Logoby mlinders » Thu Dec 17, 2015 12:33 pm 1 person likes this post

I was amazed I still got a reply on this original post. Seemingly this is a still ongoing issue. We made a "rough" powershell script that does the cleaning for us.

Basically it does the following:
- Stop vCenter services
- Back-up SQL Database
- Cleanout the vCenter database tables
- Start vCenter services
- Disconnect and reconnect the Hosts into your vCenter server (resync)
- Perform shrink of the Database

Note: Total duration of the actions might take an hour depending on your database. Escpecially the database cleanup can take a long time. I have seen occurances in which it took an hour to clean up.

You might want to test this first on your own environment. Should work on 5.1 and 5.5 installations. Not tested against 6.0.
Disclaimer: USE AT YOUR OWN RISK

Code: Select all
# Pre's: - Make sure you have free space at least the same amount as the current VMware database size.
# - Set your maximum transaction log size to 20 GB
# - Configure the variables section
###

# Checking Elevated powershell rights
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
 if (!$IsAdmin)
 {
  Clear-Host
  WRITE-HOST "This script needs to be run Elevated (run as Administrator), exiting now" -foregroundcolor "red"
  exit
 }

Clear-host

# Variables
$vcserver = "<vCENTER_HOSTNAME>"# e.a. vcsserver
$username = "<vCENTER_USERNAME>"    # e.a. domain\administrator
$password = "<vCENTER_PASSWORD>"# e.a. password
$SQLInstance = "<SQL_INSTANCENAMEFQDN>"# e.a. VCSSERVER\VIM_SQLEXP
$Instance = "<SQL_INSTANCENAME>"# e.a. VIM_SQLEXP
$vCenterDB = "<vCENTER_DATABASE>"# e.a. VIM_VCDB
$backupfile = "<DBBACKUP_LOCATION>"# e.a. E:\SQLBackups\VMware vCenter\VIMVCDB_Pre-cleanup.bak"

# Load SnapIns
WRITE-HOST "-------------------- LOAD SNAPINS --------------------"
$snapins = @("SqlServerCmdletSnapin100", "SqlServerProviderSnapin100", "VMware.VimAutomation.Core")
foreach ($snapin in $snapins)
{
    if ( (Get-PSSnapin -Name $snapin -Registered -ErrorAction SilentlyContinue) -eq $null )
    {
        WRITE-HOST "Mandatory snapin: '$snapin' is not installed" -foregroundcolor "red"
        WRITE-HOST "ERROR: Snapin not installed" -foregroundcolor "red"
        WRITE-HOST "How to resolve: Install Snapin and rerun script"
exit
    }
    elseif ( (Get-PSSnapin -Name $snapin -ErrorAction SilentlyContinue) -eq $null )
    {
        WRITE-HOST "Mandatory snapin: '$snapin' is not loaded"
        WRITE-HOST "Now loading snapin: '$snapin'"
        Add-PsSnapin $snapin
if ( (Get-PSSnapin -Name $snapin -ErrorAction SilentlyContinue) -eq $null )
{
WRITE-HOST "ERROR: Unable to load snapin: '$snapin'" -foregroundcolor "red"
exit
}
else
{
WRITE-HOST "'$snapin' succesfully loaded" -Foregroundcolor "green"
}
    }
    else
    {
WRITE-HOST "'$snapin' already loaded, skipping..." -Foregroundcolor "green"
    }
}


WRITE-HOST "-------------------- Stopping Services --------------------"
# Stop vCenter Server
$services = @("VMware VirtualCenter Management Webservices", "Vmware VirtualCenter Server")
foreach ($service in $services)
{
    try
    {
WRITE-HOST "Stopping Service: $service"
WRITE-HOST "Please wait, this can take a few minutes"
        Stop-Service -displayname $service -Force -ErrorAction Stop
WRITE-HOST "$service Succesfully stopped" -Foregroundcolor "green"
WRITE-HOST ""
    }
    catch
    {
WRITE-HOST "Error stopping service: $service"
WRITE-HOST "$_.Exception.Message" -foregroundcolor "red"
WRITE-HOST "Exit script due to previous error" -foregroundcolor "red"
exit
    }
}



# Backup the vCenter Database
WRITE-HOST "-------------------- Backup SQL Database --------------------"
$sqlquery="BACKUP DATABASE $vCenterDB TO DISK=N'$backupfile' WITH INIT, STATS=5"
try
{
    WRITE-HOST "Starting Backup of SQL Database"
    Invoke-SQLcmd -ServerInstance $SQLInstance -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop' -verbose
    WRITE-HOST "'$sqlquery' completed succesfully" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error)
}
WRITE-HOST ""



# Waiting x seconds for DB to recover from backup
$delay=5
WRITE-HOST "-------------------- $delay Second delay --------------------"
Start-sleep -s $delay
WRITE-HOST "Waited for $delay second(s), continue running script"
WRITE-HOST ""



# Cleanup the vCenter Database
WRITE-HOST "-------------------- Cleanup SQL Database --------------------"
$sqlquery="TRUNCATE TABLE VPX_INT_ARRAY"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="alter table VPX_EVENT_ARG drop constraint FK_VPX_EVENT_ARG_REF_EVENT, FK_VPX_EVENT_ARG_REF_ENTITY "
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="alter table VPX_ENTITY_LAST_EVENT drop constraint FK_VPX_LAST_EVENT_EVENT"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="truncate table VPX_TASK"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="truncate table VPX_ENTITY_LAST_EVENT"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="truncate table VPX_EVENT"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="truncate table VPX_EVENT_ARG"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="alter table VPX_EVENT_ARG add constraint FK_VPX_EVENT_ARG_REF_EVENT foreign key(EVENT_ID) references VPX_EVENT (EVENT_ID) on delete cascade,constraint FK_VPX_EVENT_ARG_REF_ENTITY foreign key (OBJ_TYPE) references VPX_OBJECT_TYPE (ID)"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="alter table VPX_ENTITY_LAST_EVENT add constraint FK_VPX_LAST_EVENT_EVENT foreign key(LAST_EVENT_ID) references VPX_EVENT (EVENT_ID) on delete cascade"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="alter database $vCenterDB set single_user with rollback immediate"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="DBCC CHECKDB ($vCenterDB,REPAIR_ALLOW_DATA_LOSS)"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="DELETE FROM VPX_TEXT_ARRAY WHERE NOT EXISTS(SELECT 1 FROM VPX_ENTITY WHERE ID=VPX_TEXT_ARRAY.MO_ID)"
try
{
    WRITE-HOST "Please be patient, the next query can take a long time to complete (15+ minutes)"
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop' -verbose
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}

$sqlquery="alter database $vCenterDB set multi_user"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}
WRITE-HOST ""



# Waiting x seconds for DB to recover from truncate
$delay=5
WRITE-HOST "-------------------- $delay Second delay --------------------"
Start-sleep -s $delay
WRITE-HOST "Waited for $delay second(s), continue running script"
WRITE-HOST ""


WRITE-HOST "-------------------- Starting Services --------------------"
# Start vCenter Server
$services = @("VMware VirtualCenter Management Webservices", "Vmware VirtualCenter Server")
foreach ($service in $services)
{
    try
    {
WRITE-HOST "Starting Service: $service"
WRITE-HOST "Please wait, this can take a few minutes"
        Start-Service -displayname $service -ErrorAction Stop
WRITE-HOST "$service Succesfully started" -Foregroundcolor "green"
WRITE-HOST ""
    }
    catch
    {
WRITE-HOST "Error starting service: $service"
WRITE-HOST "$_.Exception.Message" -foregroundcolor "red"
WRITE-HOST "Exit script due to previous error" -foregroundcolor "red"
exit
    }
}


# Waiting x seconds for vCenter to start operation
$delay=60
WRITE-HOST "-------------------- $delay Second delay --------------------"
Start-sleep -s $delay
WRITE-HOST "Waited for $delay second(s), continue running script"
WRITE-HOST ""


#Connect to vCenter Server
WRITE-HOST "---------------- Connect to vCenter Server-------------------"
try
    {
WRITE-HOST "Connecting to: $VCServer"
        $VC = Connect-VIServer $VCServer -User $username -Password $password
WRITE-HOST "Succesfully connected" -Foregroundcolor "green"
WRITE-HOST ""
    }
    catch
    {
WRITE-HOST "Error connecting to $VCServer"
WRITE-HOST "$_.Exception.Message" -foregroundcolor "red"
WRITE-HOST "Exit script due to previous error" -foregroundcolor "red"
exit
    }

# Waiting x seconds for vCenter to start operation
$delay=5
WRITE-HOST "-------------------- $delay Second delay --------------------"
Start-sleep -s $delay
WRITE-HOST "Waited for $delay second(s), continue running script"
WRITE-HOST ""

#Reconnect Hosts
WRITE-HOST "---------------- Reconnect Hosts to resync -------------------"
try
    {
$vmhosts = get-vmhost
foreach ($vmhost in $vmhosts)
    {
set-vmhost -VMHost $vmhost -State disconnected
WRITE-HOST "Succesfully disconnected $vmhost" -Foregroundcolor "green"
set-vmhost -VMHost $vmhost -State connected
WRITE-HOST "Succesfully connected $vmhost" -Foregroundcolor "green"
    }
    }
    catch
    {
WRITE-HOST "Error reconnecting hosts to $VCServer"
WRITE-HOST "$_.Exception.Message" -foregroundcolor "red"
WRITE-HOST "Exit script due to previous error" -foregroundcolor "red"
exit
    }

#Reconnect Hosts
WRITE-HOST "---------------- Disconnect from vCenter -------------------"
try
    {
WRITE-HOST "Disconnecting from vCenter server: $VCServer"
Disconnect-VIServer -Confirm:$false
WRITE-HOST "Succesfully disconnected" -Foregroundcolor "green"
WRITE-HOST ""
    }
    catch
    {
WRITE-HOST "Error disconnecting from $VCServer" -foregroundcolor "red"
WRITE-HOST "$_.Exception.Message" -foregroundcolor "red"
WRITE-HOST "Exit script due to previous error" -foregroundcolor "red"
exit
    }


#Reconnect Hosts
WRITE-HOST "---------------- Shrink Database -------------------"

$sqlquery="DBCC SHRINKDATABASE ($vCenterDB)"
try
{
    Invoke-SQLcmd -ServerInstance $SQLInstance -Database $vCenterDB -Query $sqlquery -QueryTimeout 65535 -ErrorAction 'Stop'
    WRITE-HOST "[OK] '$sqlquery'" -foregroundcolor "green"
} catch {
    WRITE-HOST "Error when running '$sqlquery'" -foregroundcolor "red"
    WRITE-HOST($error) -foregroundcolor "red"
}
WRITE-HOST ""

WRITE-HOST ""
WRITE-HOST ""
WRITE-HOST "Done executing script, if you notice any problems you can restore the SQL database backup from this location: '$backupfile'"
WRITE-HOST ""
mlinders
Veeam ProPartner
 
Posts: 26
Liked: 8 times
Joined: Sun Apr 22, 2012 10:42 pm
Location: the Netherlands
Full Name: Mark Linders

Re: Near-Continuous replication and database growth

Veeam Logoby Unison » Fri Feb 19, 2016 1:33 am

Hi All,
been a couple years now - with VMWare 6 and Veeam9 running around.......is this problem resolved yet?
We have had replication disabled for a couple years now because of this - and i would really like to start using replication again.......but not if this problem is still happening.
Unison
Enthusiast
 
Posts: 80
Liked: 16 times
Joined: Fri Feb 17, 2012 6:02 am
Full Name: Gav

Previous

Return to VMware vSphere



Who is online

Users browsing this forum: No registered users and 12 guests