Problems With Automated Jobs
Feb 10, 2004
Hi guys
I have setup a sequence of jobs to run maintenance on one of our SQL Servers.
The sequence of jobs is as follows:
Backup database
Archive database
Recreate indexes
Shrink database
Update statistics
Backup database
There is also another step which is Restore Database. This step is only called if the Archive, Re-index or Shrink jobs fail.
I made a slight script error and so when the job ran on Sunday it deemed the job a failure and attempted to restore the database, that wasn't a problem as the error was deliberate to test the restore process.
The restore process failed and logged the following message:
Job 'Sunday Maintenance - Full' : Step 8, 'Restore Database' : Began Executing 08/02/04 22:58:40
Msg 3101, Sev 16: Database in use. The system administrator must have exclusive use of the database to run the restore operation. [SQLSTATE 42000]
Msg 3013, Sev 16: Backup or restore operation terminating abnormally. [SQLSTATE 42000]
The syntax I used to do the restore was:
RESTORE DATABASE Emvolve
FROM DISK = 'H:DbdataBackupEmvolve_Full_Before.BAK'
WITH REPLACE
How do I get around this error message to complete the restore automatically? Any services that access this database are stopped prior to this process running so nothign should be accessing SQL.
Any ideas would be appreciated as I am only a learner as far as SQl goes.
Cheers
Paul
:)
View 3 Replies
ADVERTISEMENT
Oct 28, 2005
Hi everyone,i'm new to ado.net and need some help. My problem:got one DB with real bad tablestructureand one new DB (structured!)i need do do an automated import from the old to the new DB, with check if the data row is new or updated.I try to do it this way-> 2 datasets merged together ->Problem: new entries in destination dataset have row state unchangedother way i tryed add rows from source to destination with add funktion -> problem no check if data exist and maybe is changedSo how can i get the merge working or how can i implemt an effective funktion to solve this problem. Thanks in advance!
View 5 Replies
View Related
Apr 3, 2000
Hi, looking for some paths to take on this one. I have to backup the database to a LS120 floppy
drive. It has to be automated so the user can just click on a desktop icon and away it goes. Probably
an easy script buy i sure would appreciete some help on this one.
Thanks
Troy
View 1 Replies
View Related
Oct 19, 1999
Hi. I am using SQL 7.0.
Here is the situation... there are random (.csv) files being dropped into a specific directory on a daily basis. Is it possible to have SQL server automatically pick up this file and run it through the Import/Export data option so that it creates a SQL table from the original data? I need this whole sequence to be automated. Is this possible? Somebody please help... I will appreciate it greatly. Thanks a lot!
Alan
View 2 Replies
View Related
Aug 28, 1998
I am trying to automate the installation process of our Help
Desk software `Expert Advisor`. It uses a MS SQL Server 6.5
database. I can figure out the automation of Expert Advisor,
but is it possible to automate the installation of the
SQL drivers for each workstation? I don`t want or need any of the
utilities such as ISQL/w installed along with the driver--just the
SQL driver itself. Is there a runtime version of the database I should
use? I`m fairly new to SQL so please forgive me if I seem naive.
Any suggestions? Any help would be appreciated.
Toni
View 2 Replies
View Related
Jun 29, 2005
I don't know what happened on that first thread, but here it is again.
Thanks for your help.
Hello,
I have set up a .bat file to automatically export all of my server logs to a directory on my SQL server. From there I am trying to import those files into an event_log table that I have set up. (from there I am going to use Cold Fusion to parse the table each day and e-mail me with anything I should look at) The estimated ROI for my company is roughly $14.5k, it's easy so if you don't already have an error log monitoring solution, check this out!
Anyway I tried to use BCP in my .bat file but it keeps coming back with an unexpected end of file error.
Can I get some help with either:
1. Find a command line tool to import these .txt files with
-or-
2. Help me with the BCP issue?
Thanks in advance.
View 3 Replies
View Related
Jul 2, 2004
I am an intern at a university and we are looking for a way to automatically document tables, queries, etc. ColdFusion is the platform used, and SQL Server 2000. Is there a way to have the documentation performed that will capture tables, constraints, etc.? I have found some, but so far, none are working. Please help if you can!!! :confused:
View 4 Replies
View Related
Oct 17, 2005
Hi,
I have 2 databases, one called "ManagementDB" and the other called "ManagementDBYesterday".
Basically I get asked very frequently to look at yesterdays data for various reasons and I thought it'd be a good idea to always have yesterdays data to hand instead of restoring all the time.
I have tried DTS but this takes too long, I've also thought of replication however the database is modified too frequently for this to be easliy implemented.
Restoring from a backup is quite quick so I thought if I could somehow automate this, I'd have a readily available copy of yesterdays data to hand.
I have a mon-sun daily backup so I need to write some SQL script to restore from the correct backup to the "yesterday" database.
I've only used restore via the enterprise manager and I was wondering if anyone here could help.
kind regards,
Mike,
View 1 Replies
View Related
Jan 6, 2004
I have a customer who insists on emailing an excel spreadsheet to me to be uploaded to a sql database. I came across a script at one point that laid out how I would script this out. Basically it was in parts, 1. open email program and get attachment. 2.After saving attachment closing email program in order to be used the next day or next time an attachment was sent. 3. import the attached spreadsheet into SQL database. I would also like to be able to schedule this to run with the built in Windows 2000 scheduler.
Can anyone help me out on this one??
Thanks,
Will
View 5 Replies
View Related
Apr 11, 2006
Hi,
I'm working on a program that is some kind of organizer for all the tasks that employees have to carry out. A part of this program should check the deadline from the tasks, and send a mail if the deadline is in less than 5 days.
I'm using asp .net 2.0 & sql server 2000
Can anyone tell me how I can do that, or put me on track with some key words to google for?
thx.
View 4 Replies
View Related
Oct 21, 2007
Hi guys,
I'm pretty new in SQL Server and trying to build up a BI Solution for my firm. We have got monthly data about revenue headcounts and so, which should be integrated into a DW.
I was wondering whether there is an automated way to import this csv data in SQL like in a batch, because the users are not familiar with SQL Server at all. The structure of the data will be the same all the time, since it comes from legacy systems.
YOur help would be highly appriciated:)
demon
View 2 Replies
View Related
Nov 8, 2007
Hi All,
I have around 80 databases in my one of sql server instance.
we hve to regularly send the database wise health report to the client.
The following fields mentioned by the client in excel sheet
Name of database
Logical file name of .MDF
.Mdf File location drive
Size of the file in MB
Physical file location(full path of .mdf file)
Maxsize
Growth
Now a days we have to check databases one by one.
Could anyone provide me the script which automatically fetch all of required fields information from all of the databases.
Urgent help will be appreciable.
Frozen
View 2 Replies
View Related
Jan 28, 2008
Was unsure where to place this post.
Windows Server 2003R2 w/ Sp2
MS SQL 2005
I currently use MS SQL 2005 to host my Citrix Datastore DB. I manually run a daily back up (Tasks>Backup).
How difficult would this be to automated? I have googled this without luck.
Any insight appreciated.
Thanks,
Kerry
View 2 Replies
View Related
Jun 12, 2007
Unfortunately don't I know, how I can adjust this or whether SQL code is needed and if, where?? I do not know myself unfortunately yet so well with the subject out, from therefore am grateful I for each assistance. Many greetings M-l-g
Hello,
I have a problem with an integration services project of SQL server 2005. I have a text file with various data, which can be read out easily with a dataflow task and a flat file source. The data shall be transferred into a target database which I developed according to a star pattern. The fact table can be generated automatically if and only if all data belonging to a dimension table is inserted by myself. Of course, this procedure is not reasonable while having a vast amount of data. That is the reason why I want to generate the dimension tables automatically, too. A dimension is build e.g. like this: ApplicationID | ApplicationName. So, only two columns are available. But I don't know how to insert an automated ID.
I would be thankful for any help.M-l-G
View 7 Replies
View Related
Apr 15, 2008
Hi,
how would i unzip a password protected file after downloading it from sftp server.
thanks
View 2 Replies
View Related
Aug 3, 2006
We have automated the process of backing up and restoring the databases. But the problem is One database is restoring from several hrs ..though it is supposed to take only a few mins. So there is some issue with it and I want to find out how I can stop the restoring process.
Its not a command am running in query analyser or Enterprise manager, but its automated so i cant see the command to stop it.
Any ideas?
View 2 Replies
View Related
Mar 12, 2007
Hi
I am using asp.net framwork 2 with sql 2005 express edition. Can anyone please provide me any sample of sending automated emails (like welcoming people when they register to my website, or if their personal details have been updated....). or any e-book/website ref will do. I am not very expert in sql/db and smtp (or other email) stuffs. So please help me.
With thanks
View 6 Replies
View Related
Jan 14, 2008
Where can i learn about making the sql server execute task when a certain situation happens. Like lets say make the server delete all entrys older than 40 days? Or have a entry deleted automatically when a certain situation happens like lets say it take 4 votes and a entry get deleted how do i make it do that automatically
View 2 Replies
View Related
Jan 27, 2004
I need to create an Automated DTS package. At present I am running it manually each morning to import our phone switch data to an SQL table. The reason I had to go this route is this.
Because the Access tables are locked, I have a System DSN that connects to the System.mda file, this in turn gives me access to the locked tables to extract the data I need into Excel. I then drop the existing SQL table and run the DTS package recreating the SQL table with the data from the Excel file. I do not want to use OLEDB to connect to the Access table from within my application because it changes each month and of course the traffic load, I have as many 150 clients hitting the DB at one time.
I actually need the DTS package to update the SQL table with the latest data.
I'm no DTS guru, so how can I do this automagically?
View 1 Replies
View Related
Feb 12, 2004
Here's my process:
1. I have a form where someone enters certain criteria for some data…
2. The form than populates a record in a table with all the criteria…
3. I create a query based on the selected criteria for exporting…
How can I automate the process (maybe using DTS) where SQL server will automatically export the data for me using a stor proc? Create a file, populate the file etc…. or will I need to create an external App to do this?
View 2 Replies
View Related
Apr 13, 2006
I have a SQL server 2005 database. I want to send a user an email when it's his birthday. His birthdate is stored in the "birthdate" column...How can I automate this?
View 5 Replies
View Related
Sep 20, 2002
I have been playing around with the enterprise manager and selected Backup Database from the action menu and schedule this task for an odd time for testing.
How do I go about removing this task?
Whenever I go to the same menu item again, it just starts over .. like I don't have the task already setup.
In general, how do you remove automated tasks?
Thanks,
bf
View 1 Replies
View Related
Aug 30, 1999
I wish to select processes from sysprocess that are SLEEPING and more than a certain time old (say 10 minutes) so that I may KILL them. I can get the query to do the select, but how do I KILL the process? I have tried selecting the SPID into a local variable and then trying KILL @var_name, but I get "Incorrect syntax near '@var_name'".
I have tried all of the resources that I can find, but without success. Is this possible? If so, how do I go about doing it?
Thanks in advance.
Matthew
View 3 Replies
View Related
May 9, 2005
Hi,
I'm looking for a bit of advice about the best way to make automatic remote backups of a MS SQL server.
I currently run a dedicated windows 2003 standard server that i have complete control over, but my databases are hosted on a shared machine that i have no control on.
Is there a way to automate backups from the SQL database onto the windows machine?
Any suggestions on how to do this would be appreciated!
View 4 Replies
View Related
Apr 11, 2002
Is there a way to automate the generation of sql scripts. I addition to backing up the database I like to have a backup schema. Just wondering if this can be done.
Thanks !!!
Steve
View 2 Replies
View Related
May 20, 2007
anybody ever use any of these...
http://www.security-hacks.com/2007/05/18/top-15-free-sql-injection-scanners ?
thoughts? preferences?
View 1 Replies
View Related
Nov 28, 2007
Every Month I have to restore Database Northwind (Using this as an example) into Database Northwindtest. I Am trying to automate this process using a Job Agent. My Code is:
RESTORE DATABASE Northwindtest
FROM DISK = 'C:Program FilesMicrosoft SQL ServerMSSQLBACKUPGold_db_200711120300.bak'
The problem is I do a back up of this Database for day for a week. So I have:
Gold_db_200711120300.bak
Gold_db_200711130300.bak
Gold_db_200711140300.bak
Gold_db_200711150300.bak
Gold_db_200711160300.bak
Gold_db_200711170300.bak
Gold_db_200711180300.bak
How would I tell the Job agent to restore the most Current Full backup?
Thanks,
-Long
View 14 Replies
View Related
Jan 16, 2008
I have a database (actually several of them) on a production server. I want to be able to create an automatic process so every evening the production database is copied to a different server that runs staging sites.
I know that this is possible through database mirroring, but I don't want the database to be constantly mirrored. I would prefer to have a script that ran every night that just make an exact copy over to the staging server.
Is there any way to automate this, possibly through the copy database wizard? Does anyone have any good suggestions as to how I can make this work? If not, does anyone know of a good straight forward article on database mirroring that will get me started quick?
Thanks.
http://www.dynamicajax.com
View 5 Replies
View Related
Jul 23, 2005
Hi, folks. I'm fairly new to SQL Server, so forgive any stupidityinherent in this question. I work at a university and a certainfaculty member would like to have her students create a simple auctionweb site as an exercise. As part of the assignment, she wants theauction site to be able to send an email to a bidder when they havebeen outbid.So she has asked me if this is possible, and how to do it. I've read abit about sending an automated email from SQL Server, but I can't findanything about how to trigger the email based upon a field comparisonin the database. I also don't know how to incorporate a field value asa variable into the body of the email.Of course, I don't expect anyone to solve my entire problem in thisforum. I was just hoping that someone could point me in the rightdirection. Can anyone give me any advice about where I should belooking for such info? Can you recommend a web page, or some otherreference material? Is there a specific terminology I should be usingwhen I search? I just don't seem to be able to find what I need.Please reply to Join Bytes! -- I don't read newsgroups regularly.Many thanks in advance!--Sue
View 3 Replies
View Related
Oct 16, 2006
i seem to have some misunderstanding about how roles work in sql server2005. i see that i can add a role to a database(dbname->[right-click]->properties->permissions->[add ...]. THis allowsme to add either users or roles. Users can be added programmaticallyusing sp_grantdbaccess @username, but this does not allow for additionof roles to access the database (i.e., sp_grantdbaccess @rolename doesnot work).Is there some other command that is used to add a role to thedatabase's permissions list? Seems there must be since all the otherparts of the permissions chain work quite well:* sp_addrole* sp_addrolemember* grant <permissionon role::@rolenameetc.So the missing ingredient of something like sp_grantdbroleaccess iswhat I need and can't seem to find it anywhere!Thanks much for any help
View 4 Replies
View Related
Nov 30, 2007
I have successfully automatically installed SQL Server Express on several XP machines with the following lines in an installation script that references an MyTemplate.ini file. However, installation failed on a Windows 2000 machine and on another XP machine. Is something wrong with MyTemplate.ini or anything else? Your help is much appreciated.
Two Lines in an installation file that extract from SQLEXPR.exe and then execute setup.exe using MyTemplate.ini
==================================================================================
Filename: "C:SQLEXPRtmpSQLEXPR.exe"; Description: "{cm:LaunchProgram,SQLEXPRESS Setup}"; Parameters: "/x" ; check: installSQL; StatusMsg: "Extracting files from SQLEXPR file..."; Components: SQL
Filename: "C:SQLEXPRtmpsetup.exe"; Description: "{cm:LaunchProgram,SQLEXPRESS Setup}"; Parameters: "/qb /settings C:SQLEXPRtmpmyTemplate.ini" ; check: installSQL; StatusMsg: "Installing SQLEXPRESS..."; Components: SQL
Contents of MyTemplate.ini
==========================
[Options]
ADDLOCAL=ALL
SAPWD=commtxxxxxx
SECURITYMODE=SQL
SQLACCOUNT="NT AUTHORITYNETWORK SERVICE"
SQLPASSWORD=commxxxxxx
SQLBROWSERACCOUNT="NT AUTHORITYNETWORK SERVICE"
SQLBROWSERPASSWORD=commxxxxxx
DISABLENETWORKPROTOCOLS=0
SQLBROWSERAUTOSTART=1
View 6 Replies
View Related
Feb 22, 2007
We create replication scripts on a regular basis, saving them to a warm standby server as a precaution. Is there a way to automate (i.e. in a job) the scripting of replication? Right-clicking in EM is becoming tedious with the number of servers we have (80+ of them SQL Servers). My manager does not want to go through just restoring msdb on the standby; he says there are issues with that. I am new enough to replication to just go with his guidance, which is why we are taking this approach.
View 5 Replies
View Related
Mar 13, 2008
Hi ,
I need to automate the replication process uisng SSIS . CAn you give me some suggestion
to proceed forrward..
one thing from the some article i understand tht i can use Execute SQL Command.
Can some one give some ways to proceed..
Thanks,
Nav
View 10 Replies
View Related