I'm a Git Lion. (Beam Partner)
I will share how to validate Oracle services in Surebackup feature.
(I looked for a way to run the script on the validation VM, but couldn't find it.)
Here is the scenario of the problem I encountered:
1. A target showing symptoms of disk (superblock) corruption was backed up within a VM (VMware) in the customer hypervisor environment.
2. This issue was identified when performing a recovery.
3. Recovery through disk forensics (contact recovery company)
[Test Lab Configuration]
1. Oracle Server Backup
2. Surebackup Configuration(Guide reference)
> https://helpcenter.veeam.com/docs/backu ... ml?ver=120
3. Surebackup Application Configuration
1) test VM select -> Edit
2) Test Scripts Tab select -> add
3) Use the following test script select
a) Name : custom naming
b) Path : bottom powershell code file select
c) arguments : -ip %vm_ip% -fexist "/veeam/oracle_start.sh" // example
"-fexist path = file in Source VM"
(Please understand the code that is not optimized.)
Code: Select all
###/veeam/oracle_start.sh###
#!/bin/bash
su - oracle << EOF
sqlplus "/as sysdba" << SQL
startup;
exit
SQL
lsnrctl start
EOF
######################
Code: Select all
===This is a Powershell script that will run on the VEEAM server after configuring SureBackup.===
<#
accepts certifs automatically
#>
param(
$fexist = "/veeam/oracle_start.sh",
$plink = "C:\Program Files\Veeam\Backup and Replication\Backup\Putty\plink.exe",
#test lab vm information
$ip = "192.168.0.5",
$username = "root",
$password = "veeam"
)
write-host "Running $fexist @ $ip"
$argplink = @("-v", $ip, "-l", $username, "-pw", $password, "bash /veeam/oracle_start.sh")
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = $plink
$pinfo.RedirectStandardError = $true
$pinfo.RedirectStandardOutput = $true
$pinfo.RedirectStandardInput = $true
$pinfo.UseShellExecute = $false
$pinfo.Arguments = $argplink
$p = New-Object System.Diagnostics.Process
$p.StartInfo = $pinfo
$p.Start() | Out-Null
$p.StandardInput.Write("yes")
$p.WaitForExit()
$stdout = $p.StandardOutput.ReadToEnd()
$stderr = $p.StandardError.ReadToEnd()
if($stdout) {
write-host ("Output: {0}" -f $stdout.trim())
exit 0
} else {
write-host "No output returned or something went wrong... dumping $stderr"
$stderr >> c:\bin\log.txt
exit 1
}
===============================================