Newbie Automatic restore issues

Hi:
I have two issues with a program I am working on to do an automated restore, The restore takes a backup from production, and replaces the database entirely every day so we have offloaded current information: I avoid logical names because we don't want a
database named production:
FIRST ISSUE:
I would like to be able to drop the database. When I drop it interactively, I always click the box close existing connections: The problem is what to do with an interactive connection: Is there any way with an automated restore replace to intrinsically drop
the database? Although it's not something you normally want to do, it is something in this case that I HAVE to do to ensure the restore works and the with moves move the correctly named files.
SECOND ISSUE
When I run the following statement:
USE [coll18_FinAidNoHR]
DBCC SHRINKFILE (N'coll18_production_log' , 0, TRUNCATEONLY)
GO
I get the following error:
Cannot shrink log file 2 (coll18_production_log) because the logical log file located at the end of the file is in use.
(1 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
Is there any way  to work around this without programming?

As for question 2-thanks for all the info on DBCC SHRINKFILE I think the best decision is to do it as needed.The
Restore is a knottier problem. I can't to a restore replace because I want to change the file names. I can't have the logical names.
I run a prestep before my restore that does this common stuff:
if exists (select * from sys.sysdatabases where name = 'FinAidNoHR')
EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'FinAidNoHR'
if exists (select * from sys.sysdatabases where name = 'FinAidNoHR')
ALTER DATABASE [FinAidNoHR] SET  SINGLE_USER WITH ROLLBACK IMMEDIATE
if exists (select * from sys.sysdatabases where name = 'FinAidNoHR')
    drop DATABASE  [FinAidNoHR];
The restore step fails with this error:
Executed as user: CAMPUS\UCCTD10_SQL. Exclusive access could not be obtained because the database is in use. [SQLSTATE 42000] (Error 3101) 
When I run an SP_WHO it DOES show the database open in a sleeping state on a remote machine that did not shut down the instance, but this DROP should have had the effect of an interactive drop with close existing connections checked.
When I did other tests like selecting top 1000 rows from another test database,SP_WHO shows it open in the same way but the DROP works fine.
Before I tear out what little hair I have left, can anybody tell me why it would  not drop the connection?
(It was my boss's PC)

Similar Messages

  • System automatically restored manufacture settings

    Hello, this morning when I turn on my computer it had automatically restored manufacture settings. As in, it was the same as when I connected it from the box. All my documents are gone!!!

    Hello macks87,
    After reviewing your post, I have located an article that can help in this situation. It contains helpful advice concerning Activation Lock which may be the reason you're having issues:
    iCloud: Activation Lock
    http://support.apple.com/kb/PH13695
    Thank you for contributing to Apple Support Communities.
    Cheers,
    BobbyD

  • H87M-G43 and automatic boot issues

    I have an H87M-G43 and for 4 weeks have been struggling to get a new clean Windows 8.1 UEFI build on the PC without odd automatic boot issues.
    Here is the PC configuration:
    CPU Intel Core i5-4440 3.1GHz
    PSU Corsair CX430
    DIMM1:
    DIMM2: Corsair XMS3 DDR3 4GB CMX4GX3M1A1333C9
    DIMM3:
    DIMM4: Corsair XMS3 DDR3 4GB CMX4GX3M1A1333C9
    SATA Port 1: SSD Samsung 840 EVO 120GB
    SATA Port 2:
    SATA Port 3: HDD Samsung 1TB SATA II
    SATA Port 4: HDD Samsung 1TB SATA II
    SATA Port 5: DVD Liteon IHAS124-14 24X
    SATA Port 6:
    JAUD1: Coolermaster 352 Series Case Front I/O Intel HD Audio connector
    JUSB1: Coolermaster 352 Series Case Front I/O USB 2.0 connector
    JUSB4: Coolermaster 352 Series Case Front I/O USB 3.0 connector
    BIOS v1.6:
    01. F6 Restore Defaults: Load Optimized Defaults
    02. SATA Mode: [RAID Mode]
    03. SATA3 Hot Plug: Enabled
    04. SATA4 Hot Plug: Enabled
    05. Initiate Graphics Adapter: IGD
    06. Serial(COM) Port 0: Disabled
    07. Parallel(LPT) Port: Disabled
    08. Windows 8/8.1 Feature: Enabled
    09. Resume From S3/S4/S5 by USB Device: Enabled
    10. GO2BIOS: Enabled
    SATA Port 3+4 RAID1 (Mirror)
    Windows 8.1 UEFI installation
    Install Windows Update:
    1. Important Updates
    2. Recommended Updates
    3. Optional Updates
    Install MSI Drivers/Software:
    01. Intel Chipset Driver 9.4.0.1026
    02. Intel SVGA Driver 10.18.10.3412
    03. Realtek PCIE Network Drivers 8.23.11.26.2013
    04. Intel RAID Driver 12.9.0.1001
    05. Realtek HD Audio Drivers 6.0.1.7111
    06. MSI Wallpaper
    07. Intel AMT Driver 9.5.15.1730
    08. Intel SBA 2.2.39.7991
    09. Intel Smart Connect Technology 4.2.40.2418
    10. Super Charger 1.2.020
    I have not configured any of the Intel Management and Security, Small Business Advantage, Smart Connect software, just installed them.
    The issues I get are:
    1. JUSB1 connected and Resume From S3/S4/S5 by USB Device: Enabled in BIOS. When I shutdown the PC, it automatically boots 2-3 seconds later. If I set Resume From S3/S4/S5 by USB Device: Disabled or disconnect the JUSB1, the PC shutdown is fine.
    2. Once the PC is shutdown OK, PC boots itself several hours later. Yesterday at 15:50pm PC was shutdown. At 21:18pm, PC automatically booted itself.
    This is my first MSI and UEFI motherboard. What I would like is some advice on setting up the BIOS and the software to get sleep/hibernate working and no automatic boots.
    I have contacted MSI regarding these issues, but they say they cannot reproduce them. I have subsequently googled these issues and of course, other MSI users are experiencing similar problems, but there are no obvious resolutions. Please can anyone help/advise?

    Hi,
    I have the MSI Z87-GD65 Gaming mobo and perhaps similar problem as discussed in this thread.
    I wanted to be able to wake my PC from sleep mode via my USB connected mouse and keyboard. Therefore I went into BIOS and set the "Resume from S3/S4/S5 by USB Device" to "Enabled". And yes, now it is possible to wake my PC from sleep mode by just clicking any button on my keyboard or just moving my mouse a little bit. So far so good. BUT, another feature was also added which I did not want to have: By just clicking any button on my keyboard or moving my mouse a little bit the PC also started after I have "shut it down"! This could seem as the PC boot by itself but it does not, I have to move the mouse just a little bit (by accident for example when needing more space on my desk) or clicking a button on the keyboard. I THINK THE ROOT CAUSE TO THIS PROBLEM IS AS FOLLOWS: In BIOS, it says "Resume from S3/S4/S5 by USB Device". Instead it should only be "Resume from S3 by USB Device". S3 is the same as "Sleep" and S5 is the same as "Soft off" = PC shutdown. Do you understand what I mean? When I shut down my PC it is put into state “S5”. (NOTE: I have another PC with MSI Z77-GD65 and here it only says "Resume from S3 by USB Device" and no problem with any starting of that PC via USB device from a shutdown state, it only starts from the sleep state (=”S3”) as I want. How do I get rid of the "S5" state in BIOS for this USB wake up feature? (Btw "S4" is hibernate state which is not the same as a shutdown PC, therefore not causing this problem.)
    ADDED No. 1: Please read msdn.microsoft.com/en-us/library/windows/desktop/aa373229(v=vs.85).aspx for explanation of the different system Power states I mention above.
    ADDED No. 2: My Click BIOS version is 1.8 for Z87-GD65 with release date 2013-12-06. On a Youtube video I have seen that version 1.0 of this BIOS has Wake up "Resume from S3 by USB Device" and not ...S3/S4/S5...

  • Automatic goods issue of components upon creation of Production Order

    Hello gurus.
    The business would like to have the components in a Production Order automatically issued (with Movement Type 261) upon the creation of a Production Order.
    I was investigating this possibility under the Production Scheduling Profile option in IMG, but there is no automatic action for this.
    Do you know of another way this could be achieved? I'd like to do this preferably without having to implement User Exits or Batch Jobs.

    Fernando,
    Automatic goods issue is not possible.
    But you can certainly think of backflushing the components while confirming the order with CO15 or CO11N.
    Make the required settings in material master, work center or routing. It will get copied to the order.
    The same can be maintained in the order too.
    There is one more option available in 'Define confirmation parameters' T code OPK4.
    Execute the above T code.
    In 'Generally valid settings', mark 'All components' under 'Goods moveemnt'.
    Also in 'General individual entry'  under 'Error handlings/ logs' mark ''Goods movement'  & if required mark 'Termination for incorrect goods movement' so that if any problem arises with the GI/ GR, the termination would be terminated.
    Hope this helps you.
    SmanS

  • Automatic Goods Issue for Goods Receipt (Purchase Order).

    Hi,
    Experts - I have some newbee problem.
    I have to create ZMIGO to behave like follows:
    1. User enters all necessary data (like in MIGO) and posts document.
    2. System creates automatic Goods Issue document based on data entered in 1. (above).
    I doubt full automatic posting of GI will be possible (user has to fill in WBS for GI and possibly change "GI for project"). So my idea is to redirect user from ZMIGO (after posting) GR document to MIGO_GI and pass all necessary parameters. And thats my question: How to do it? Is it possible? Any other ideas? Maybe examples???
    Will reward points to all helpful answers.
    Regs,
    FS

    Hi,
    I've created implementation for MB_DOCUMENT_BADI in se19 (named it: ZMB_DOCUMENT_BADI_1). Filled methods with code and put some break-points. Activiated methods and implementation.
    When I post documents via MIGO this BADI is not executed! Why? When I've searched program SAPLMIGO for cl_exithandler only two were found: MB_MIGO_BADI and MB_MIGO_ITEM_BADI. What I have to do to activate this MB_DOCUMENT_BADI???
    Points waiting for helpful answers.
    REgs,
    FS

  • Automatic goods issue for outbound delivery, during the transfer order confirmation

    Hello,
    Could you please advise how to realize automatic goods issue for outbound delivery, during the transfer order confirmation in the WMS.
    Now after creation of outbound delivery, i can't post the goods issue. Before i have to make the transfer order and confrim it and only after this i can post the goods issue in the VL02 t-code.
    Could you please advise - what i have to customize that to make automatic GI for outb. delivery (i mean with creation material document) during the TO confrimation.
    Thanks in advance.

    Hi Iiya
    Check the below setting, might be helpful

  • Automatic Goods Issue in Outbound delivery scenario with resp to Shipment

    Hi,
    Could you please explain me, how  Automatic Goods Issue happens in Outbound delivery scenario process and in shipment process.
    Is there any transaction for this?
    Can we use VL23 for Automatic Goods Issue in Shipment process? or is it only for Outbound delivery scenario?
    How  we schedule a background job by using VL23- transaction, how we create variants on what selection criteria?
    Could you please explain me in detail?
    Thanks A lot.

    Hi Anil,
    VL23 is to schedule Out bound Goods issue.Check once T.code VL06O.
    Thanks,
    Sree.Manam

  • Automatic Goods Issue in Outbound delivery scenario with Shipment

    Hi,
    Could you please explain me how to Automatic Goods Issue happens in Outbound delivery scenario and in shipment process.
    Is there any transaction for this?
    Can we use VL23 for Automatic Goods Issue in Shipment process? or is it only for Outbound delivery scenario?
    How schedule a background job by using VL23- transaction, how we create variants on what selection criteria?
    Could you please explain me in detail?
    Thanks A lot.

    Hi Anil,
    VL23 is to schedule Out bound Goods issue.Check once T.code VL06O.
    Thanks,
    Sree.Manam

  • Automatic goods issue for outbound delivery without picking/packing

    Hi,
    I have the following flow: sales order -> outbound delivery -> goods issue.
    I would like to to be able to post an automatic goods issue on my delivery.
    Could someone please let me me know how to perform the customizing for this or give me the reference of the appropriate post which answers this.
    Thanks,

    Hi,
    Use t-code VL23
    select  varient SAP & STANDARD >>> Click on START IMMEDIATELY
    or else
    click on schedule >>> click on schedule periodically >>> select your option as Minute and maintain value 1 or ( 1 to 60 )
    it means sytem will run this program after every one minute
    Also You can able to create your own varients and speciefy criteris like form which sales orz, which delivery types etc.
    Kapil

  • Automatic Goods Issue

    Hi,
    I am working with point-of-sale scenario. when I am trying to work with sales order ,my requirement is automatic delivery and automatic goods issue and automatic billing. for this I have configured immediate delivery , but wanted to know any user exit or enhancement for automatic Goods issue and immediate billing.? throw some light on this issue as I can go further from where I am.
    Thanks.
    Kanna.

    Hi Chandrasekhar,
    Thats right. But I am working on standard SAP , and I just want to get through with that scenario. As u said , there is no need for Goods Issue when we are working with Order related billing , since the customer picks the goods by himself in super-market sale. But In this case, it is different as we have to do picking by the cashier (just as a regular purpose) , If its like this ...how to approach ? should we go for user exit (if yes , which exit I have to take?) ? or any other way , suggest me.
    Thanks,
    Kanna.

  • Zenworks 7 boot cd for an automatic restore

    Hi everyone....
    I want to know if it's possible ot create a boot cd and restore an image automatically ( whitout any human intervention ).
    I want to start a workstation with a Zen7 boot cd and automatically restore an image that i find on a volume on my Zen7 server. The image .zdm not in the cd but on a volume. I want to give this cd at a person who completly ignore how Zenworks works and i want that this person boot form the cd and then, the restore begin.
    I don't want to use policy to do that. I want to do that with a Zenworks boot cd.
    It is possible to do that and if yes, how?
    Thanks in advance....

    On Thu, 20 Nov 2008 14:46:03 GMT, stevev wrote:
    > It is possible to do that and if yes, how?
    yes, in the settings.txt is an option for CMDTEXT (?) iirc..
    in this variable you reference the script you want to execute.
    in the script you than create the necessary commands to restore the image.
    the script is executed automatically after cd boot.
    Marcus Breiden
    If you are asked to email me information please remove the - in my e-mail
    address.
    The content of this mail is my private and personal opinion.
    http://www.didas.de

  • I'm having restore issues, help please!!!

    this has probably already been answered, but got new 8gb iphone today plugged it in etc it crashed tried to reboot and reconnect to itunes, told to restore tried failed error code 13 checked forum changed usb bingo it starts to restore, now though the progress bar on the phone is full but on itunes it's saying it's still waiting for iphone been like this for almost an hour can anyone help, i've not even made a phone call from it yet!
    Message was edited by: sscsukltd

    sorry... can't help, not having these "restore" issues (yet...) and I've done 4- Restore to Backup the past week and two "restore to new Phone" and no issues... other than the fact that with a "Restore to New Phone" my 3rd party data app's are not "recoverable" as with the "restore to backup"

  • IPOD Touch Restore Issue!!!

    When I turned on my relatively new ipod touch yesterday, it had the itunes logo with a docking cord picture on the screen. I plugged it in to itunes and it stated "iTunes has detected an iPod in recovery mode....". Ok, that I can deal with. I hit restore and then it states I have to restore and update software. OK, that is fine as well. It is downloading iPod touch software 1.1.4. It states that it will automatically restore after the software had downloaded. I have downloaded this software at least 6 times, and it states it is fully downloaded, but then the download box disappears and the restore does not happen. When I hit restore again, it downloads the software all over again... I am SO VERY frustruated! Have any suggestions????!!!!

    Hey Mary Beth,
    Try "Deleting the restore files" as described on this article:
    http://docs.info.apple.com/article.html?artnum=307219
    Also make sure the iPod touch is plugged directly into the PC and not into a hub, monitor, or keyboard. http://support.apple.com/kb/ts1286
    If the iTunes still will not restore the iPod try restoring in another user account as described in the first article.
    Jason

  • Automatic Goods Issue after Outbound delivery and shipment.

    Hi,
    I am working on LES part.
    Could you please explain me how to do Automatic post goods issue for shipments.
    (in our scenario where after outbound delivery, picking, packing shipment takes place.)
    Can we use VL23 for automatic goods issue for shipments? (or igoods issue is only for outbound deliveries?)
    If so what is the selection criteria for background scheduling-Variants?
    Please explain me in detail
    Thanks a lot.

    Anil,
    Not sure if I understand your question, Goods Issue is posted for the delivery and not the shipment.  In a shipment you can update the actual values for Planned, Check-In, Load Start, Load End etc values.  A shipment can have single/multiple deliveries, you can use VL23 for scheduling a background job to do the PGI automatically, use either the standard variants or define your own variant and use that variant to schedule the job.
    hith
    Sunil Achyut

  • I tried updating my ipad but it automatically restored it instead. Will everything be deleted if I didn't back it up on icloud?

    I tried updating my ipad but it automatically restored it instead. Will everything be deleted if I didn't back it up on icloud

    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.

Maybe you are looking for

  • HT5381 i did a software update and now mail wont open at all

    Help......my mail app is coming up with an error "You can't use this version of Mail with this version of Mac OS X".  Can I uninstall the update?

  • Same nr range in Logistics Invoice Verification for the MM and FI document

    I customised Logistics Invoce verification (on ECC6) with the same nr range for MM and FI.  That were done by changing the nr range of doc type RE (in FI) to nr range 52 andcreated the nr range for the company code for fiscal year 2007 and 2008 (our

  • Harman Kardon drive and play

    I have a harman kardon drive and play fitted to my car that works fine with all my older apple stuff. I am now in possession of later generation apple iPhone and iPod touch with a different plug. I have purchased an adaptor to interface the old type

  • Netscape.javascript.JSObject for mac

    I have the latest NetBeans version for mac os 10.5. What do I need to do to get access to the netscape.javascript package. I am trying to read cookies written using php into an applet. I am also open to solutions that do not need netscape.javascript.

  • Windows small business server 2003 help

    I have a server at work that i use to connect remotely from home. i have recently bought a new computer and now when i type the url 24.78.212.85 into the browser I get this screen. 24.78.212.85 - / Tuesday, November 18, 2014 10:06 PM <dir> seriesI ca