Created
June 16, 2012 17:53
-
-
Save steegi/2942084 to your computer and use it in GitHub Desktop.
Script to drop disconnect and drop DB2 database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
db2 "connect to sugarult" | |
# Not sure if the following is actually need if the database needs to be restarted | |
# because of the 'currently in use' issues. However it should disconnect all application | |
# connected to the database. | |
db2 "quiesce database immediate force connections" | |
db2 "unquiesce database" | |
db2 "force application all" | |
# Note the following will impact all databases and applications connected to this instance | |
# Only perform these steps if the above is not a problem. | |
# These steps take care of 'The database is currently in use' issues after doing the above | |
db2stop force | |
db2start | |
# Finally drop the database | |
db2 "drop database sugarult" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment