Difference between revisions of "SQWareProduction:mssql:lib:sqwmsq RestoreDatabase.lib"

From Wiki_dbSQWare
Jump to: navigation, search
m (Updated by Expdbtools)
 
m (Updated by BatchUser)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Librairie de fonctions shell $gvsqw_MssBin/../lib/sqwmsq_RestoreDatabase.lib:<br>
+
shell functions library $gvsqw_MsqBin/../lib/sqwmsq_RestoreDatabase.lib:<br>
lib for sqwmsq_RestoreDatabase.ksh
+
{{SQWareProduction_sqwmsq_RestoreDatabase.lib_presentation}}
 
<br>
 
<br>
cat $gvsqw_TmpFile.fic|grep dump|grep "${lfsqw_DatabaseSource}_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9]_"|awk '{print $NF}'> $gvsqw_TmpFile
+
Functions explanation:
echo "No backup of ${lfsqw_DatabaseSource} found on \\$lvsqw_BckDir" |tee -a $gvsqw_TmpFile.mail
+
<pre>
echo "No file like ${lfsqw_DatabaseSource}_$lvsqw_BckDate_*\${TYPE}*.dump\n" |tee -a $gvsqw_TmpFile.mail
+
gfsqw_BeginningCom
echo "No file like ${lfsqw_DatabaseSource}_\$lvsqw_BckDate_*\${TYPE}*.dump\n" |tee -a $gvsqw_TmpFile.mail
+
gfsqw_ConvertSlashToBackslash $gvsqw_TmpFile
echo "search file $lfsqw_FileName"
+
gfsqw_ExecSql $gvsqw_TmpFile.sql
echo "xp_cmdshell 'dir \\$lvsqw_BckDir\\${lfsqw_DatabaseSource}*.dump'\ngo" >$gvsqw_TmpFile
+
gfsqw_ExecXpCmdShell $gvsqw_TmpFile| sed 's*$,,' | tee $gvsqw_TmpFile.fic
FIC=`cat $gvsqw_TmpFile|grep "${lfsqw_DatabaseSource}_[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]_[0-9][0-9][0-9][0-9][0-9][0-9]_fstripe1_" | tail -1 | sed 's/fstripe..*/fstripe/'`
+
gfsqw_IsXpCmdShellEnabledGlobal "sqwmsq_RestoreDatabase.ksh $gvsqw_InputParameters"
FIC=`cat $gvsqw_TmpFile|grep "${lfsqw_DatabaseSource}_${lvsqw_BckDate}_fstripe1_" | tail -1 | sed 's/fstripe..*/fstripe/'`
+
gfsqw_XpCmdShellGlobalDisable
FIC=`cat $gvsqw_TmpFile|grep $lfsqw_FileName | tail -1 | sed 's/fstripe..*/fstripe/'`
+
lfsqw_BackupPath =>
gfsqw_ExecSql $gvsqw_TmpFile > $gvsqw_TmpFile.fic
+
lfsqw_GenerateMove
if [ $grep -c ${lfsqw_DatabaseSource} $gvsqw_TmpFile -ne 0 ]
+
lfsqw_GenerateMove =>
if [ ! -z "$lfsqw_FileName" ]
+
lfsqw_GenerateSql =>
if [ ! -z "$lfsqw_SubDir" ]
 
lfsqw_GenerateSql
 
lfsqw_GetShared
 
 
lfsqw_ListBck
 
lfsqw_ListBck
lfsqw_RepeatSubDir=""
+
lfsqw_ListBck =>
lfsqw_RepeatSubDir="-SR '$lfsqw_SubDir' "
+
lfsqw_RemoveWarningFromLog =>
lvsqw_BckDir="\\\\${lvsqw_InstanceParam}\\${lvsqw_SharedDirectory}\\\\${lfsqw_SubDir}\\"
+
lfsqw_RestoreDatabase =>
 +
lfsqw_RsyncOrphans =>
 +
lfsqw_Summary
 +
lfsqw_Summary =>
 +
</pre>
 
<br>
 
<br>
{{SQWareProductionSurchargeLib|mssql|Mss|sqwmsq_RestoreDatabase.lib}}
+
{{SQWareProductionSurchargeLib|mssql|Msq|sqwmsq_RestoreDatabase.lib}}
 
<br>
 
<br>

Latest revision as of 18:21, 24 January 2023

shell functions library $gvsqw_MsqBin/../lib/sqwmsq_RestoreDatabase.lib:
lib for sqwmsq_RestoreDatabase.ksh
Functions explanation:

gfsqw_BeginningCom
gfsqw_ConvertSlashToBackslash $gvsqw_TmpFile
gfsqw_ExecSql $gvsqw_TmpFile.sql
gfsqw_ExecXpCmdShell $gvsqw_TmpFile| sed 's,  *$,,' | tee $gvsqw_TmpFile.fic
gfsqw_IsXpCmdShellEnabledGlobal "sqwmsq_RestoreDatabase.ksh $gvsqw_InputParameters"
gfsqw_XpCmdShellGlobalDisable
lfsqw_BackupPath => 
lfsqw_GenerateMove
lfsqw_GenerateMove => 
lfsqw_GenerateSql => 
lfsqw_ListBck
lfsqw_ListBck => 
lfsqw_RemoveWarningFromLog => 
lfsqw_RestoreDatabase => 
lfsqw_RsyncOrphans => 
lfsqw_Summary
lfsqw_Summary => 


Nuvola apps information.png
Note:
You can overload functions contained in $gvsqw_MsqBin/../lib/sqwmsq_RestoreDatabase.lib

by function with same name in $gvsqw_MsqBin/../lib_cust/sqwmsq_RestoreDatabase.lib for all your environnement
or by $HOME/sqwConfig/sqwmsq_RestoreDatabase.lib specifically for this user .