.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Help needed for backup

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :Sql Server

Hi All,

We are using SQL Server2005 Enterprise edition.

In our production server DB backup to tape will be occerred at the wkend(i cannot confirm the day) . Once the DB backups to tape are completed i want to delete the old backup files from a particular directory. How i can achieve this.

Can any one suggest that how to identify that files are copied to tapes. If i am able to find this i think we can go with maintanace wizard or may be with the script.

Please suggest me that which one is the best.

Waiting for valuable replies.

View Complete Post

More Related Resource Links

Advice needed on backup strategy and implementation

This is my plan: Full database backup is performed at 5AM every day. Then log backups are taken every 30 minutes starting from 5:30AM till 11:30PM What I want to achieve is to have all backups for the same day to be contained in the same file on the disk. That is on Feb 18 2010 file c:\db_backup_02_18_10.BAK will be created at 5AM with full database backup. All backup logs that occur on Feb 18 will be appended to the same file. Next day c:\db_backup_02_19_10.BAK will be created at 5AM. Is this "correct" approach? The reason I like it is that everything needed to restore to any point in time for specific day is contained in one file and can be copied easily to a different computer. I tried to achieve this result via Maintenance Plan wizard by creating one task for full backup (scheduled once a day at 5AM) and another task for log backup (scheduled every 30 minutes starting from 5:30AM till 11:30PM) (both tasks are in the same maintenance plan). This, however, saves result from each job in a separate file called $DBNAME_backup_YYYY_MM_DD_HHMMSS_NNNNNNN.trn (for transaction log backup; will probably have extension .BAK for full backup) Can this even be done via Maintenance plan? I think I can achieve desired result via SSIS where I can generate file name programmatically and pass it as a parameter to "BACKUP DATABASE ..." or "BACKUP LOG ..." stat

SQL Server Backup and Restore (video)

Restore your full backup, then run a few queries before you keep restoring transaction logs. Brent shows how to use the Standby option for restores.

In this five minute video, Brent demonstrates how to do it by creating a database, populating data, and then showing what disaster recovery is like by doing RESTORE WITH STANDBY.

How to backup SMS from windows mobile Pocket PC to computer

How to backup SMS from windows mobile Pocket PC to computer

Many Windows Mobile Pocket PC Phone users could not backup their SMS to txt file or view on computer. I found this software offers a SMS Messages backup solution to Backup all SMS messages for Windows Mobile Phones onto computer and keep them safe. Here is the user's guide:

Response.BinaryWrite help needed


Hi all

Im new to .NET and stuck now, so i hope anyone can help my with my problem.

I have a MS SQL database where i have stored some documents as Binary data. I cant figure out how to retrieve them and show/download them in my browser.

I found some guides online and have try to put something together.


private void Write()
 int id = 0;
 string strID = Request.QueryString["id"];
 int.TryParse(strID, out id);

 var db = new ModelDataContext();
 var doc = db.DocumentDatas.Where(x => x.ID == id).FirstOrDefault();

 byte[] byteArray = File.ReadAllBytes(doc);


How do i fill the byteArray with the data?

Thanks in advance :)


help needed: Ldap User authentication using userDN and password



Is it possible to authenticate a user using userDN and password? If so, then tell me the syntax.So far i have tried to authenticate using username and password from my c# code using directoryentry which takes the parameters like domainname,username and password. But i need to authenticate using Userdn and password.

helped needed: ASP LDAP authentication failed in IE 8


I use the following code to do the user authentication through Active Directory using LDAP.

entry = new DirectoryEntry("LDAP://" + server, user_name, password);
if (!string.IsNullOrEmpty(entry.Name))
EmployeeNetId = entry.Username.Substring(0, 3);

// Retrieve EmployeeId, and Employee Full Name
EmployeeId = -1;

It works for Chrome, Firefox with no problem. But with IE 8, it works sometimes, and failed on some computers. When it failed, I figured that I need to check SSL 2.0 in IE 8 Internet Options.  It's weird because in those computers that IE 8 works, SSL 2.0 is also unchecked.

Am I using some deprecated method? Or How do I specifiy the SSL version options in the LDAP connection?

Toolbox: Easy File Backup, Exploring Files And Folders Inside Visual Studio, Multiple Monitor Softwa


If the responsibility for creating, managing, and executing routine backups is yours, these tools will make it easier. Also see how you can browse folders and files from inside Visual Studio.

Scott Mitchell

MSDN Magazine May 2009

Help needed in selecting coulmns from 2 tables using entity framework


Hi all,

I have two tabels as mentioned below. I am using entity framework and vs2010.I am not able to write linq query to get data from both the tables. there is one to many relationship(for one category ther can be multiple articles). Please help me out as this is very urgent. Thanks in advance.

1) Article

ArticleID bigint Unchecked
CategoryID int Unchecked
ArticleName varchar(500) Unchecked
ArticleDesc nchar(1024) Unchecked

Is the REST Starter Kit still needed with WCF 4?


The REST Starter Kit was targeted at WCF 3.5. I am wondering if it is still needed with WCF 4?

MOSS 2007 Backup Strategies

I saw some backup strategy best practices papers stating you could backup the databases and site content separately, but was told by Microsoft that if you do that, and have to do a bare metal restore you will not be able to recover because the site content and database will be out of sync. Does anyone have a proven DR process for MOSS 2007 that they can share? We have Commvault in house right now, but are using it only to backup the databases and file system separately. Should we be using the built in sharepoint backup stdadm(sp?) tools?
John M. Couch Insight Enterprises Inc. 6820 S. Harl Ave, Tempe, Az 85283 Email: john.couch@insight.com

WCF over mobile modem link - performance help needed

I am looking for ways to improve the performance of my WCF communications over a mobile modem. I have a system where the clients are connected to the internet via a mobile (GPRS/3G/HSDPA) connection. This is NOT a windows mobile client, it is a full XP Professional system running .Net4.0. The clients basically use a USB mobile modem (SIM card etc) to get their internet connection. The server is connected directly to the internet via broadband. My WCF interface has 2 main methods, one sends 2 int values from the client to the server and the other sends 3 images (JPGs) to the server. As you can see one is going to take less than a second and the other is going to take maybe 30-60 seconds depending on the images size and connection speed. If we have a good mobile modem connection to the internet then everything works perfectly. The problem I have is a lot of the time I do not have a good connection. The timeout on the WCF binding is set to 120 seconds. This gives the images enough time to get across even if the connection is a bit slow.  The problem comes when the connection stops - this is a network (mobile network) problem, something like the signal drops etc. Communications never recovers. At this point after about 10 seconds of inactivity (no communications) I know that the connection will never recover. At this point the best thing I have found to do it res

SQL2005 backup Issue

After moving the SPS 2003 portal from one disk to another, I am having a problem in backing up the portal from the spsbackup tool as well as through the SQL Server 2005 database backup option . Following is the error am getting:-   ============================================================================================================================= Backup failed for Server 'sql server name'.  (Microsoft.SqlServer.Smo)   ------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Backup+Server&LinkId=20476   ------------------------------ Program Location:      at Microsoft.SqlServer.Management.Smo.Backup.SqlBackup(Server srv)    at Microsoft.SqlServer.Management.SqlManagerUI.BackupPropOptions.OnRunNow(Object sender)   ===================================   System.Data.SqlClient.SqlError: The backup of the file or filegroup "sysft_ix_ContentDatabaseName" is not permitted because it is not online. BACKUP can be performed by using the FILEGROUP or FILE clauses to restrict the selection to include only online data. (Microsoft.SqlServer.Smo)   ------------------------------ For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.00&LinkId=

SMO Backup and Restore Help

Hello Friends, I am new to SMO, Till now I have only worked with Selct,Insert/update Queries.. Now I want to Implement some backup and restore feature for my application. I looked at some documents of SMO and found it is possible using SMO. First of all I will explain my situation. My application wants to store data belongs to different companies(which is maintained with in application) in to single database server, Sql server 2008. I am planning to use Partition Scheme function and create filegroup for each company. Advantage here is, taking backup of each company will be easy. I am generating primary key for each table without taking into consideration of companies. In other words Particular table's ID 1,2 belongs to Company A, 3 Belongs to Company B and 5 belongs to Company A... But these data will be split in to Different filegroups using Company ID.(horizontal partitioning) Ok... Now the Problem.. My backup for a particular company was taken successfully. Now I want Restore function. When I am trying to restore this backup to somewhere else. Target database may or may not contain Companies installed. When Restoring Will there be any Primary key Violation? I know one solution is to generate primary key by taking into consideration Company Id. But this will cause a complete rewriting of code, as it contains lot of edit/delete queries.  I want to know, whether the

SQL2008 - Cannot Restore a new database from a full backup of a different one, database in use

I am trying to restore a brand new database from a copy of another one and am encountering an error message stating: System.Data.SqlClient.SqlError: The file <Backup source database file location> cannot be overwritten.  It is being used by database <Backup Source Database>. (Microsoft.SqlServer.Smo) I am running the Restore procedure with the REPLACE option and am wondering why it is stating that the source database is the database in use when I am trying to restore and overwrite a completely different database. This issue happens when running the replace both in C# using SMO and when manually restoring with SqlServer Management Studio Interesting note is, the original source database is created / deployed using a database project within VisualStudios 2010 and then deployed to SqlServer through VisualStudios. Any thoughts on why this is happening? Thanks in advance for any help!

What happened to the backup and restore classes in namespace Microsoft.SqlServer.Management.Smo vers

I do not see these two classes in version 10 of this namespace and I am not finding any documentation explaining what happened to them.

Can I backup to a UNC destination not part of domain using Proxies?

Hi, I am trying to backup my databases to a UNC destination that is not part of domain (stand alone machine) Can I use proxy accounts, so the database backup engine uses the UNC path using a stand alone machine’s account? If not, how can I handle this situation? Thank you, Max

Any issues removing backup mount point cluster resources from SQL Server dependencies?

Win 2003, SQL 2005/SQL2008 64 bit enterprise failover cluster with 3 nodes and 6 instances. The mount points configured as cluster resources for the data/backup/logs. The entire cluster mount points are SAN replicated to a DR Site. But backup drives/LUNs are excluded from the replication. All the disk resources including backup LUNs are set to dependencies on the SQL Server server. The SQL Server is not coming on-line in the DR Site due to unavailability of the backup LUNs (failed resources). As per the documentation all the disk resources must be set to dependencies (http://support.microsoft.com/kb/835185). Thought it did not specifically mentions only Data/Log mount points and/or the backup LUNs as well. "The SQL Server 2005 resource depends on the SQL network name resource and the physical disk resources that hold its data. When mount points are being used together with the physical disks, each mount point must appear as a cluster resource. Additionally, each mount point must also be added as a SQL Server dependency. If only the root physical disks dependency is added and the mount points are not added, database corruption will occur on failover. Database corruption may also occur when SQL Server is restarted without failing over. "     What if I remove the backup LUNs from dependencies list. This will allow me to recover the SQL Server
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend