473,774 Members | 2,275 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

possible? scripted DB drop/restore from backup, restart

I'd like to make a tool that non-technicians could invoke if there was a
defacement or destruction of our database data for whatever reason and an
expert wasn't around to tend to things. The sequence would run something
like this:

1) Take IIS offline if necessary and drop existing DB connections
2) Back up current database to [timestamp]_[dbname]_dropped.bak
3) Restore from a known good backup
4) put IIS online if necessary

I'd imagine this can be done via script. Items 1) and 4) are the biggest
mystery. From my experiences working with the SQL Server GUI, existing
connections must be closed to the DB before backup/restore ops, and the only
reliable way I've found to do this is to stop IIS. Perhaps there is a way to
force things entirely in script. Script would be preferable if it is a
reliable way to accomplish what I'm trying to do.

Can someone suggest approaches and ideally a resource or two to read
through?

Thanks.
-KF
Jan 22 '07 #1
2 1079
Hello KF,

From your description, I understand that you're trying to author some
script or a program to programmaticlly turn off ASP.NET application in IIS
server and perform database backup task in SQL Server, correct?

I'm wondering whether your database will be used by the ASP.NET application
only or if you only care about the data accessing from ASP.NET web
application? If you only care about the data accessing from ASP.NET
application, you can consider the following means:

1. stop and start IIS service as you mentioned

2. If you're using IIS6, you can also stop the application pool if the
ASP.NET application only.

here are some IIS management related script resources:

http://www.microsoft.com/technet/tec...ideMSCOM/defau
lt.aspx

http://technet2.microsoft.com/Window...7-c6c3-4748-a4
6a-43710abceddb103 3.mspx?mfr=true

http://www.microsoft.com/technet/pro.../Library/IIS/0
03ed2fe-6339-4919-b577-6aa965994a9b.ms px?mfr=true

http://blog.crowe.co.nz/archive/2006/07/11/669.aspx

3. For ASP.NET 2.0, there is a new feature. You can put a "App_Offline.ht m"
file in the certain ASP.NET 2.0 application's main directory. Then, any
sequential requests won't be processed(deny by ASP.NET applcation runtime).
You can use this feature to stop the ASP.NET application's processing.

http://weblogs.asp.net/scottgu/archi...06/426755.aspx

Hope this helps some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 23 '07 #2
Thanks Steven. This is exactly the "friendly manual" stuff I needed to get
going with the job. Appreciate the resources.
-KF
"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:Jj******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hello KF,

From your description, I understand that you're trying to author some
script or a program to programmaticlly turn off ASP.NET application in IIS
server and perform database backup task in SQL Server, correct?

I'm wondering whether your database will be used by the ASP.NET
application
only or if you only care about the data accessing from ASP.NET web
application? If you only care about the data accessing from ASP.NET
application, you can consider the following means:

1. stop and start IIS service as you mentioned

2. If you're using IIS6, you can also stop the application pool if the
ASP.NET application only.

here are some IIS management related script resources:

http://www.microsoft.com/technet/tec...ideMSCOM/defau
lt.aspx

http://technet2.microsoft.com/Window...7-c6c3-4748-a4
6a-43710abceddb103 3.mspx?mfr=true

http://www.microsoft.com/technet/pro.../Library/IIS/0
03ed2fe-6339-4919-b577-6aa965994a9b.ms px?mfr=true

http://blog.crowe.co.nz/archive/2006/07/11/669.aspx

3. For ASP.NET 2.0, there is a new feature. You can put a
"App_Offline.ht m"
file in the certain ASP.NET 2.0 application's main directory. Then, any
sequential requests won't be processed(deny by ASP.NET applcation
runtime).
You can use this feature to stop the ASP.NET application's processing.

http://weblogs.asp.net/scottgu/archi...06/426755.aspx

Hope this helps some.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Jan 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4326
by: Darshak Shah | last post by:
Hi, * Question background : My DB is in ArchiveLog mode. I have TS in ReadOnly mode. As i know, - Oracle allows to DROP table resides in ReadOnly TS (& other objects also) even though that TS is in ReadOnly mode. - Oracle will not recover ReadOnly TS during Oracle startup.
1
4024
by: Fabius | last post by:
Hello, i'm trying to transfer a DB2 database from a PC to another. Following suggestion that Mr. Jan M. Nelken and Mr. Pierre Saint-Jacques give me on this newsgroup i first made a backup of database, the i transferred the full structure of subdirectories of backup to other PC and tried to Create database from backup copy as explained in DB2 manual. I used the visual interface from command center. I inserted manually the location of backup...
2
5338
by: vj_dba | last post by:
Hi Group, I have a problem in restoring my tablespace, my database is running in ARCHIVAL logging, I created a tablespace, did some transaction, then took the ONLINE BACKUP of the tablespace. Then I dropped the tablespace and tried to restore from the tablespace backup image, when I do this it's throwing error SQL2549N The database was not restored because either all of the table spaces
7
26059
by: satish mullapudi | last post by:
Hi All, I am using Db2 UDB v 8.2 on RHEL . I have performed a load operation on a table. Now that tablespace has been switched into RESTORE PENDING state. Now I can only read the data in the table. I can't modify the data in the table as it is giving me an error saying "Tablespace Access denied". How can I bring the tablespace out of RESTORE PENDING state? Please help me out Thnak you in Advance.......
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.