Stored Procs in Master

I had a user (don't ask how) get access to Master and ran a script that deleted all the stored procedures in Master. Some how the server was still working but the database dropdown lists in the GUI would not populate, but the default DB was Master. I was able to make the connection to the server, copy the code for all the SPs and recreate them.

Now the GUI reports that my SQL2000 server is a SQL6.5. There are also some errors relating to sysconstraints when I try to view properties of a table.

Any hints other than reinstall

Pete



Answer this question

Stored Procs in Master

  • Guenter

    Hello Troy,


    Thanks for your help.So i have a quick question,what will happen to the existing logins and permissions.will be login and permissions are preserved after rebuilding new master database by running setup.exe I doubt but i am not sure 100%...



  • 2V.

    Hello,

    You can also build a new master db by running setup.exe.



  • markovuksanovic

    you can also rebuild the master database using

     rebuildm.exe

     which resides in the binn folder

    Restore is probably a safer path though



  • Curtis the Analyst of Doom

    Well...as luck would have it the backup of master was deleted earlier in the day, so restoration is not possible. I'm trying not to rebuild master as there are many users and databases which would be a pain (as all options are) to re-enter. The SQL Log reports an 8.x Server but EM is still showing 6.5. Not sure where its getting that info.

    Peter Cwik


  • Scott Allen - OdeToCode.com

    Good afternoon Hema,

    If you do a complete rebuild of the Master db, you are correct, you will lose all logins:

    *From Technet

    -------------------------------------------------------

    To restore any database, the instance of SQL Server must be running. Startup of an instance of SQL Server requires that the master database is accessible and at least partly usable. If master becomes unusable, you can return the database to a usable state in either of the following ways:

    • Restore master from a current database backup.
      If you can start the server instance, you should be able to restore master from a full database backup. For more information, see Restoring the master Database.
    • Rebuild master completely.
      If severe damage to master prevents you from starting SQL Server, you must rebuild master. Next, you should restore your most recent full database backup of master, because rebuilding the database causes all data to be lost. For more information about how to rebuild master, see Rebuilding the master Database

    ------------------------------------------------------------

    Fortunetly I've never had to rebuild/repair my Master DB. You may be OK if setup.exe let's you do a simple repair of the Master. Of course if you'd like, you could always backup your Master and give it a shot. It's always fun to learn new things!

    Troy



  • PavanKR_ind

    Its hard to tell because the master database is corrupted. You will have to rebuild the database. Sometimes you have to decide whether to go the hard way to rebuild the master or go the even harder way, trying to rebuild / fix the issue on your own.

    HTH, Jens K. Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---

  • ddee

    I would defintely second that.

    HTH, Jens K. Suessmeyer.

    ---
    http://www.sqlserver2005.de
    ---

  • Logic Rules

    Understood.Thanks Troy.



  • Ashok Kumar MVN

    restore a backup of your master database

  • Derek Ekins

    I had a smilar problem recently which was fixed it.Initiall i though of goinf for rebuild database.Rebuild database will give your free copy so i need to restore all the databases again.simple way i found was..

    Resolution:

    1). Copy(.mdf and .ldf files) from corrupted master database.

    2). Restore the database in a backup server with (name :master_sup is aviod the naming conflict with master database)

    3). Once database is online then detach the database,copy the physical files to problematic server and rename the master database(master_sup to master)

    4). Restart the SQL server from command prompt.

    (In case if you have any problem in restarting in single user then go to registry and modify to multi user(/m) mode.

    Note: Before rebuilding the master database i would suggest try this option. Rebuild option will lead you to fresh copy..then need to restore all the databases.



  • Stored Procs in Master