Can you set a single FILEGROUP to READONLY without getting exclusive access to the entire DB?

I'm in the process of building a partitioned table with a sliding-window partition.  I have several years of historical static image data that will be moved to individual filegroups created to hold year's worth of data each.  The Business
requires that the last 60 days of images be updateable, everything older needs to be readonly which simplifies the backup process.
Since the PRIMARY filegroup is always READWRITE, I'm going to use the PRIMARY filegroup for the upper range of my partition to allow users to make necessary modifications to images in this 60 day window.  On a nightly basis, I'm going to run
a process that changes the upper range on the partition to the daterange = (getdate() - 60).  The 61st day moves seamlessly from PRIMARY filegroup to my 2013FileGroup in milliseconds. 
The process runs almost flawlessly, however, I'd like to change the FILEGROUP to READ-ONLY after moving the data to the archive partition.  In my process, I can quickly switch this archive filegroup to READWRITE and run the Partition MERGE \ SPLIT to
change my upper range and move records between partitions.  However, I cannot change the FILEGROUP back to READ_ONLY without getting exclusive access to the entire database to save the change.
Is there any way to set a single FILEGROUP to read-only quickly without setting the entire DB to SINGLE-USER with ROLLBACK IMMEDIATE?  I've tried the WITH ROLLBACK IMMEDIATE on the ALTER DB statement to modify the filegroup without any success. 
I need WRITE access for a matter of seconds before setting it back to read only. Any help would be greatly appreciated.
I'm dealing with a TB of data, a full restore could take 60+ hours to recover the entire db.  However, doing partial backups on the READWRITE portion of the DB is done quickly and I can get the business back online quickly by recovering the
PRIMARY filegroup and then restore readonly filegroups in the background.  If I can't change these filegroups to read-only on the fly, I may have to maintain more backups for extended periods of time and may need to wait for maintenance windows to set
filegroups to READONLY.

Is there any way to set a single FILEGROUP to read-only quickly without setting the entire DB to SINGLE-USER with ROLLBACK IMMEDIATE?  I've tried the WITH ROLLBACK IMMEDIATE on the ALTER DB statement to modify the filegroup without any success. 
I need WRITE access for a matter of seconds before setting it back to read only. Any help would be greatly appreciated.
I am moving it to Tools. Consider setting up a separate database for the 60+ days data.
Related thread:
USE TempDB
GO
ALTER DATABASE SampleDb
MODIFY FILEGROUP [Archive] READONLY
GO
The following error appears:
Msg 5070, Level 16, State 2, Line 1
Database state cannot be changed while other users are using the database 'SampleDB'http://www.sqlservercentral.com/Forums/Topic1328084-391-1.aspx
Kalman Toth Database & OLAP Architect
sqlusa.com
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Similar Messages

  • Hello , can you with a single account creative cloud , install on two computers ? (The one from home and one at work)

    Hello , can you with a single account creative cloud , install on two computers ? (The one from home and one at work)
    This will avoid me lugging around my mac, sorry for my english.
    Margaux, photographer

    Yes, this has been allowed with Adobe applications going back many years.  A program such as Photoshop can legally be installed and activated on two computers at a time for the use of the single licensed user.  You can't install legally on your own and a friend's computer for use by the two different people.  Prior to Creative Cloud, there was an unwritten limit on how many times a given application could be activated, but there is no longer such a limit under CC.  That means you could theoretically install on three or four computers, activating only two at a time, and then deactivating one or both before activating on another computer.

  • Can you set up multiple user accounts on one laptop?

    can you set up multiple user accounts on one laptop?

    Of course.
    And instructions can depend on which OS X is installed.
    For v10.7 Lion > OS X Lion: Create a new user account
    For v10.8 Mountain Lion > OS X Mountain Lion: Create a new user account
    When you post for help, please state which OS X is installed.
    If you aren't sure, click About this Mac from your Apple menu 

  • Can you set up apple tv using 2 different itunes accounts from 2 different macs in same household?

    can you set up apple tv using 2 different itunes accounts from 2 different macs in same household?

    No, you can only connect to one Home Sharing account at a time. If you want to see the content of the other Mac's library you will have to turn off Home Sharing on the Apple TV and log back in with the other iTunes account.

  • How can you set up more than one device on iTunes. I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices.

    How can you set up more than one device on iTunes? I have an iPad, iPod, itouch and iPhone. I don't want the same on all devices. I have all my music/videos on iTunes on my mac book pro. Can you set up separate folders for each device and drop in what ever music/videos from the main iTunes library?

    In itunes it is called syncing and you can choose exactly what content to sync to all devices and it can be different for all of them
    How to sync

  • Can you set up multiple Facebook users on 1 IPad 4?

    Can you set up multiple Facebook users(2) on one IPad 4?

    I think maybe on different users on one computer - but not on the same one.

  • Can you set up 2 iTunes accounts on one computer?

    Can you set up 2 iTunes accounts on one computer?

    I had two accounts on one computer until recently. You need to use two user accounts on the computer. Note, I say I did it until recently, therefore I'm not able to confirm this still works, but assume it does.

  • Can you set a second "Open with:" application for a file?

    Hi all,
    I was wondering if something like this exists for OS X Lion or greater: you can set a default application to open a type of file, say Safari for all .html files, but can you set a second default application for a file?
    I usually open files using command + o or command + down arrow from the Finder and I've often thought how good it would be to hit an alternate keyboard shortcut to open the selected file in a secondary default application.
    For example, if I'm making a web page and have the .html selected in the finder I can hit command + o (or command + down arrow) to open it in Safari and if the file isn't open in my editor and is selected in the Finder I can hit, say command + option + o (or command + option + down arrow) to open the .html file in my editor.
    Does anyone know if this can be achieved in OS X Lion or greater?
    Any advice is greatly appreciated.
    Thanks.

    Hi all,
    If anyone's interested in a partial solution, I've rigged up the following.
    I ended up using an Automator action coupled with Spark to capture a keyboard key combination. Spark: http://www.shadowlab.org/Software/spark
    I've used Spark before with good results, and although it's from 2008 it still works on Lion.
    I created an Automator action that does two things:
    gets the selected Finder items
    opens finder items in the text editor I'm using.
    I then saved the workflow as an application so that Spark could run it.
    I've set up a keyboard shortcut that Spark picks up and calls my Automator workflow. It all seems to work nicely.
    So, I've created a specific "open selected file with <text editor>" keyboard shortcut that should do for the time being.

  • Can you set a web page as a 'home page' on the i phone safari as you would?

    Can you set a home page or will the safari button always take you to the last web site you were on?

    You cannot set a Home Page in Safari but if you save your favorite bookmark to the home screen, you can use that to open the browser on iPhone.
    To do this:
    Open Safari and open the page you want for the "Home Page".
    Tap the "+" at the bottom of the screen and select "Save to Home Screen"
    You can then name it whatever you wish and tap Save.
    This will create an icon on the home screen that you can tap on to always open Safari to that page.

  • Can you set different colours for invitees in calendar?

    In calendar on the iphone/ipad can you set any events that you accept from invitees to a different colour so that you can instantly distinguish them from your own events?
    Cheers

    You could choose None in Preferences > General > New Mail Sound and set up a rule for each account in Preferences > Rules as follows:
    If [any/all] of the following conditions are met:
    [Account] [AccountName]
    Perform the following actions:
    [Play Sound] [Sound]
    Problem is, that would cause the sound to be played for junk mail as well — probably not what you want.

  • HT1677 Where can you set default in Safari to view as web page instead of Mobile Version?

    Where can you set the default setting in Safari to open page as web page instead of Mobile Version on iPad running iOS6.01?

    And, to make it even more fun, sometimes a website changes how it deals with Safari Mobile. A website that treated it like a desktop browser suddenly starts treating it like a cell phone. Just to mess with you. Or push an app.
    Best of luck.

  • In Initial View, can you set defaults for Navigation tab, Page layout, and Magnification?

    Adobe Acrobat 9 Pro V9.4.0
    Win7 Pro x64
    Problem: In Initial View, can you set defaults for Navigation tab, Page layout, and Magnification?
    Every time Acrobat scans a document, I have to go to Initial View to set Navigation tab, Page layout, and Magnification. It does not remember the settings I last used.
    Thanks in advance.

    See my response to this post

  • Can you set a project wide time limit?

    I know that you can set a time limit for each question, can you set a time limit for the entire project?

    That variable has really no sense. First of all, you have to create it and it will just be toggled when time is over. I think it is just taken over from the former Timer widget (Timer widget... to stress your learners - Captivate blog) where it had sense, because it didn't have the same functionality of jumping to a slide when time was over. Beware: the timing is not very accurate, it will start with a delay of about 1 second if you put it on the first slide (display for rest of project), and when time is over the message (you cannot escape from it) will display for 2 seconds. Had planned to blog about Timing/Hourglass interactions, but have too many plans that I didn't realize.

  • Can you set a song on repeat on iPhone 4s

    Can you set a song on repeat on iPhone 4s

    From the now playing screen, bring up the scrubber bar(tap the screen):
    A small icon that looks like two circular arrows is on the left side below the scrubbing bar. Tap this icon once to repeat the album. The icon will turn blue when repeat is activated. Tap the icon again to repeat the current song. The icon will change to show the number 1 inside a blue circle. Touch the icon a third time to cancel any repeat. The icon will turn white when it's deactivated.

  • How can you set the max row for a 'open cursor' in a stored proc?

    I would like to know how can you set the maximum amount of row returned in a resultset coming from a stored proc?
    You can do it via JDBC with cStatement.setMaxRows(10); but it works only for select that you do via JDBC...
    I would like the same functionality using open cursor inside a stored proc...
    Thanks...

    is "where ROWNUM <= 10" the equivalent of "cStatement.setMaxRows(10);" because the ROWNUM as problem with the ORDER BY clause and the setMaxRows() as no problem...

Maybe you are looking for

  • How to get rid of the "mil" in Data View's large Display meter

    Hi, there!   I have two analog voltage inputs that I am having signal express V2.5 to collect data on.   The first input is scaled to inches while the second input is scaled to pounds.   For some reason, as i bring up the large display in Data View,

  • Strange Indesign Bug -- I lost a weeks worth of files

    Not sure what caused this.  There's certainly nothing that can be done about it.  I neglected to repair my backup volume which failed a couple weeks ago and proceeded with an InDesign large project and lost all my work. When working on this doc, ever

  • HELP botton doesnt work

    I have the first generation ipod nano and it wont respond when I touch the bottons. I can control it (switch songs, pause etc) when its plugged into my ihome and I use the remote. But otherwise it wont work! I tried restoring it and it did nothing. P

  • MRIO Before Goods receipt

    Hi, I am facing a problem, some of goods we need to pay to vendor before goods delivered to us, I know that we can do the MIRO before goods receipt. But I would like to know any influence if I use this approach? Thanks!

  • Check a group assigned to which role

    Hi, I have a group called as "GroupOne". There are no roles/users assigned to this. Now, how can we check whether any roles has added group "GroupOne" to its Assigned Groups under Identity Management. I know its a silly question, but I am not able to