Difference between revisions of "Template:SQWareProduction sqwdb2 BackupDatabase.ksh example"
m (Updated by BatchUser) |
m (Updated by BatchUser) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<pre> | <pre> | ||
− | Sourcing sqwdb2_Global.lib v2024. | + | Sourcing sqwdb2_Global.lib v2024.07 SQWareProduction for Db2 (dbSQWare) ... |
#Standard help for script sqwdb2_BackupDatabase.ksh: | #Standard help for script sqwdb2_BackupDatabase.ksh: | ||
− | |||
$gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -h | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -h | ||
Line 9: | Line 8: | ||
$gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -Locale en -h | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -Locale en -h | ||
− | #Display online help for this script with forcing of the 'en' locale (default locale managed by | + | #Display online help for this script with forcing of the 'en' locale (by default locale managed by $gvsqw_Locale) |
$gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -s | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -s | ||
#Display usage examples for this script | #Display usage examples for this script | ||
− | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh - | + | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE |
− | # | + | #Generate commands but don't execute them ! |
+ | |||
+ | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -Exec | ||
+ | #Generate db2Dump compressed by default | ||
− | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh - | + | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -NoCompress -Exec |
− | # | + | #Execute db2Dump without compression |
$gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -HI <NumberOfGenerations> -Exec | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -HI <NumberOfGenerations> -Exec | ||
#Changes the number of backup generations to keep | #Changes the number of backup generations to keep | ||
− | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE - | + | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -O <Type> -Exec |
− | # | + | #Changes the type <Type> of backup : Online or Offline (by default managed by $lvsqw_OfflineOnline) |
+ | |||
+ | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -O 'Online' -T <type> -Exec | ||
+ | #Changes the format <type> of this 'Online' backup : Full or Delta (by default managed by $lvsqw_BackupType) | ||
+ | |||
+ | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -O 'Online' -T 'Full' -TC 'TO DISK' -Exec | ||
+ | #execute a full online backup with the specified command 'TO DISK' (by default managed by '$lvsqw_ToolCommand') | ||
− | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -Exec | + | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -O 'Offline' -Freeze -Exec |
− | # | + | #Freeze the database during an Offline backup |
+ | |||
+ | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -O 'Offline' -Blackout -Exec | ||
+ | #Blackout supervision when offline backup | ||
+ | |||
+ | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -AddMail 'mymail1@mydomaine.com,mymail2@mydomaine.com' -Exec | ||
+ | #Add the mail list to the default address managed by $gvsqw_GlobalMail (only this time), if needed separate by commas | ||
+ | |||
+ | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -SendReport -Exec | ||
+ | #Send the log by email at the end of the treatment even if there is no error (by default, send on error) | ||
− | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE | + | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -NoMail -Exec |
− | # | + | #Disables sending an email on error to $gvsqw_GlobalMail (by default, send on error) |
$gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -FRT <NumericValue> -Exec | $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -FRT <NumericValue> -Exec | ||
− | #Force return code to '<NumericValue>' on error (if no error, exit 0!) | + | #Force return code to '<NumericValue>' on error (if no error, "exit 0!") |
#You can also force return code of this script on all your | #You can also force return code of this script on all your | ||
#environnement if you set the variable: $gvsqw_ForcedReturnCodeScript_sqwdb2_BackupDatabase=<NumericValue> | #environnement if you set the variable: $gvsqw_ForcedReturnCodeScript_sqwdb2_BackupDatabase=<NumericValue> | ||
#in configuration file $gvsqw_Db2Bin/../etc_cust/sqwdb2_GlobalVar.cfg | #in configuration file $gvsqw_Db2Bin/../etc_cust/sqwdb2_GlobalVar.cfg | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> |
Latest revision as of 15:54, 31 October 2024
Sourcing sqwdb2_Global.lib v2024.07 SQWareProduction for Db2 (dbSQWare) ... #Standard help for script sqwdb2_BackupDatabase.ksh: $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -h #Display online help for this script $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -Locale en -h #Display online help for this script with forcing of the 'en' locale (by default locale managed by $gvsqw_Locale) $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -s #Display usage examples for this script $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE #Generate commands but don't execute them ! $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -Exec #Generate db2Dump compressed by default $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -NoCompress -Exec #Execute db2Dump without compression $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -HI <NumberOfGenerations> -Exec #Changes the number of backup generations to keep $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -O <Type> -Exec #Changes the type <Type> of backup : Online or Offline (by default managed by $lvsqw_OfflineOnline) $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -O 'Online' -T <type> -Exec #Changes the format <type> of this 'Online' backup : Full or Delta (by default managed by $lvsqw_BackupType) $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -O 'Online' -T 'Full' -TC 'TO DISK' -Exec #execute a full online backup with the specified command 'TO DISK' (by default managed by '$lvsqw_ToolCommand') $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -O 'Offline' -Freeze -Exec #Freeze the database during an Offline backup $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -O 'Offline' -Blackout -Exec #Blackout supervision when offline backup $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -AddMail 'mymail1@mydomaine.com,mymail2@mydomaine.com' -Exec #Add the mail list to the default address managed by $gvsqw_GlobalMail (only this time), if needed separate by commas $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -SendReport -Exec #Send the log by email at the end of the treatment even if there is no error (by default, send on error) $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -NoMail -Exec #Disables sending an email on error to $gvsqw_GlobalMail (by default, send on error) $gvsqw_Db2Bin/sqwdb2_BackupDatabase.ksh -I $DB2INSTANCE -FRT <NumericValue> -Exec #Force return code to '<NumericValue>' on error (if no error, "exit 0!") #You can also force return code of this script on all your #environnement if you set the variable: $gvsqw_ForcedReturnCodeScript_sqwdb2_BackupDatabase=<NumericValue> #in configuration file $gvsqw_Db2Bin/../etc_cust/sqwdb2_GlobalVar.cfg