Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.4 KiB

  1. @ECHO OFF
  2. IF EXIST %0.txt (DEL %0.txt)
  3. ECHO Microsoft (R) UDDI Database Restore Utility
  4. ECHO Copyright (C) Microsoft Corporation 2002. All rights reserved.
  5. IF '%1%' == '/?' GOTO PARMERROR
  6. SET SERVER=(local)\%1
  7. IF '%SERVER%' == '(local)\' SET SERVER=(local)
  8. SET BACKUPFILE=%~Dp0%uddi.database.bak
  9. IF EXIST %BACKUPFILE% GOTO TAKEOFFLINE
  10. ECHO Unable to locate %BACKUPFILE%
  11. ECHO Restore failed
  12. GOTO END
  13. :TAKEOFFLINE
  14. ECHO Taking UDDI database on %SERVER% offline
  15. SET CMDBATCH=ALTER DATABASE UDDI SET OFFLINE WITH ROLLBACK IMMEDIATE
  16. OSQL -S%SERVER% -E -Q"%CMDBATCH%" -dmaster
  17. ECHO Restoring UDDI database on %SERVER%
  18. ECHO Restoring from %BACKUPFILE%
  19. SET CMDBATCH=RESTORE DATABASE uddi FROM DISK='%BACKUPFILE%'
  20. OSQL -S%SERVER% -E -Q"%CMDBATCH%" -dmaster
  21. GOTO END
  22. :PARMERROR
  23. ECHO Restores the UDDI database on a local SQL Server / MSDE instance
  24. ECHO -
  25. ECHO Usage:
  26. ECHO uddi.database.restore [instance]
  27. ECHO -
  28. ECHO instance: Instance name of the MSDE or SQL Server installation which hosts the UDDI database.
  29. ECHO -
  30. ECHO Note: Brackets indicate optional parameters
  31. ECHO -
  32. ECHO Example 1 (Restores UDDI Database on local UDDI instance of MSDE or SQL Server):
  33. ECHO uddi.database.restore.cmd UDDI
  34. ECHO -
  35. ECHO Example 2 (Restores UDDI Database on local default instance of MSDE or SQL Server):
  36. ECHO uddi.database.restore.cmd
  37. ECHO -
  38. :END
  39. ECHO Run %0% /? for help