Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2004
    Posts
    660

    Unanswered: Change database name

    Hi, i have database in sql server called search, but today, i found it is changed to search (Single user), I don't know who did it. How can I change to mutilple users, also how to change the name back to search. Thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Use Enterprise Mangler to change the database properties from single user to unrestricted (right click on the database, properties, options, clear the restricted checkbox).

    -PatP

  3. #3
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    The set up Profiler to track this kind of change and fire someone the next time it happens.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    While firing them is rather gratifying, it really isn't a solution to the underlying problem. You really need something a bit more subtle, and lethal.

    -PatP

  5. #5
    Join Date
    Apr 2004
    Location
    Kansas City, MO
    Posts
    734
    Oh, the way I would fire them would cover that also.
    MeanOldDBA
    derrickleggett@hotmail.com
    When life gives you a lemon, fire the DBA.

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Oh, I see! I'd never thought of it quite that way. Very nice!

    -PatP

  7. #7
    Join Date
    Mar 2004
    Posts
    660
    Hi, you are all expert, i really don't know how to track this kind of change and fire someone? Can you give me more detail. Thanks in advance.

  8. #8
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    We (or at least I) were making jokes about firing someone.

    As far as how to track this kind of change, I'd use SQL Profiler to "watch" all of the commands being submitted to the SQL Server. The commands that you need to watch are sp_dboption, which is used to set a database to single user mode, and ALTER DATABASE which can do it too.

    -PatP

  9. #9
    Join Date
    Apr 2004
    Posts
    64

  10. #10
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    You can probably start by making a list (and checking it twice) of all people who can do such a thing. This includes all sysadmins, members of the db_owner role in the database, and unless you have removed the BUILTIN\ADMINISTRATORS login, anyone in the local NT administrators group on the SQL Server. If you are lucky, this is a short list. Maybe even short enough that you can visit each person and ask them (quietly, of course) if they knew anything about it.

    If the list is long, then you can do one of two things. Wait for it to happen again, in order to confirm there is a real problem, or set up a machine that runs profiler all day and all night. Monitor any rpc or sql statement that includes "sp_dboption" or "alter database" in the text data. Be sure you capture the hostname and login name columns.

    In rare cases, I think this can be caused by a wayward maintenance plan, but I only have old and anecdotal evidence of this. Still. It may be something worth checking on.

  11. #11
    Join Date
    Mar 2004
    Posts
    660
    Thank you all very much, i need to learn that, any question, i still will ask you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •