Disabling users access whilst running batchs

  • I look after our production environment, ensuring that MI is available by 8am.

    Over the past week, the job that updates MI with data from other databases has been over running because 1 user is running reports at around 7am against tables being updated at that time.

    Is it possible to disable a particular user id's permissions to the database.  The thought of single user mode did cross my mind but it isn't appropriate as there 2 batch jobs that access the same database (but different tables) between 6am and 8am and only 1 of the jobs is impacted by this user's reports.

    I know in user permissions for the database there is the option of Denydatareader but was wondering is there a way of enabling/disabling that option via a script.

    Thanks.

  • If the batch processes are running with sysadmin level privileges or anything that would map in as a member of the db_owner rule, you could set the database in RESTRICTED_USER mode. You do this the same way as setting a database to SINGLE_USER but the difference here is that RESTRICTED_USER allows multiple users in, but they have to be members of one of the following roles: db_owner (database level), dbcreator (server level), or sysadmin (server level).

    K. Brian Kelley
    @kbriankelley

  • Thankyou for the reply

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply