You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
OS is Windows Server 2012 R2 Standard
DB2 is luw v10.5.700.375
Created a batch file that will backup several databases over night. I start at the DOS Command prompt on the server and call DB2cmd as a line command. The problem is I cannot seem to get the CLP and Command prompt windows to close when the backups have concluded. I have tried adding the following commands "quit", "terminate", and "exit". Please provide solutions or suggestions. Thank you for any help!!
TheBoss
unread,
Jul 19, 2016, 4:13:16 PM7/19/16
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
first a disclaimer: I've never worked with DB2 on a Windows platform, so I
have no real life experience with what you are trying to do.
That being said, I think you might take advantage of the following article
on IBM's developerWorks site:
http://www.ibm.com/developerworks/data/library/techarticle/0307fierros/0307 fierros.html
If my interpretation is correct, you specifically could have a look at:
- Table 2, showing the options for the DB2 command window.
- Listing 3, an example backup script invoked from a Windows shell.
My guess is that you will need the '-c' switch.
HTH.
--
Jeroen
bwmil...@gmail.com
unread,
Aug 1, 2016, 11:34:26 AM8/1/16
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Here is how you do it:
In your windows script:
db2cmd -c call db2_backup_daily.cmd
then in another script called db2_backup_daily.cmd
db2 backup database <DB> user <USER> using <PASSWORD> online to C:\PATH compress include logs without prompting
Jeremy Rickard
unread,
Aug 16, 2016, 9:24:46 PM8/16/16
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Since scripting on Windows isn't so nice, you might also consider other options, e.g.:
* Use DB2 automated backups with a suitable window defined. This may not offer enough control for you.
* Use an SQL approach (BACKUP through ADMIN_CMD routine); you can then make those calls via ODBC or JDBC rather than relying on a perhaps flaky interaction between DOS and db2cmd.