How to cancel a SQL Server reindex rebuild - sql-server-2008

Using the SQL Server 2008 Maintenance Plan > Rebuild Index, I've scheduled this to run on Sunday at 5:30am against all the databases on server. I'm just concerned that when I go in on Monday that it might still be running.
If that's the case, can anyone advise how it could be cancelled or check how far it need to go before finishing. As it's a live environment, I will need to restore from the backup if it's not finished in time for Monday 8am.
Hardware information: the server is a new Windows 2008 32 bit with a maximum ram installed 4GB. I don't have any more details to hand on the database size etc at the minute as I'm not at work.
Running the rebuild is the equivalent of running this script:
Kind Regards
James

Related

Why is that Mysql 5.6 runs slower than Mysql 5.5 on the same codebase?

We've just moved to a new server, both run ubuntu 14.04LTS, the only difference is basically that the old server ran mysql5.5, the new one has mysql5.6. Both servers are cloud machines hosted by digitalocean. Both operate on default my.cnf settings, not much has been tweaked.
An other important difference is, that the new server has double the RAM, and CPU power.
Still - while old server ran with an avg of 0.6 second response time for an api call we monitor server health with, the new one is 1.6-1.8 slower. Yes, they contain heavy joins, but that's not my point - the codebase is exactly the same, and the machine itself is supposed to be stronger. New server also shows peaks of CPU usage few times every hour, which never happened with mysql 5.5.
Does this make any sense? For me, not so much, but I'm no MySQL guru.
Ran MySQL Tuner, but unsure if there's anything relevant within:
mysqltuner output for OLD server:
http://pastebin.com/cqSSssW0
mysqltuner output for NEW server:
http://pastebin.com/uk3g1KZa
The only thing that has been tweaked in my.cnf is that it should log slow queries.
Any idea, why this could happen? MySQL5.6 clearly runs faster on benchmarks I saw online. Any help is very much appreciated.

Google compute costs?

I have gone over the pricing and documentation so many times but still do not understand pricing...
I picked a bare minimum server setup (CPU, RAM, etc). I am using this server as a development server (eventually) so it will be actively used about 6-8 hours a day, 5 days per week...when I entered these values in their "cost calculator" the result was a few bucks a month...perfect!
However I have been up and running for less than a week and already the price is $0.65 with a usage of 2,880.00 Minutes?!?!?!
So I am not being billed only for activity but for server uptime, entirely??? So even if the server sits idle, I am getting charged? Is there a way I can disable the instance during non-work hours? Re-enabling it when I arrive in the morning?
EDIT | how to stop compute engine instance without terminating the instance?
This may have answered my questions...
As the other question answered, you are billed by the minute while your server is running, whether or not it is actively using the CPU.
At the moment, there's no way to leave a server shut down and restart it later; you can use a persistent boot disk to store your development state and create/delete an instance (with the same name) each day that you want to use your server.
To use a persistent boot disk like this, you'll want to make sure that the "Delete boot disk when instance is deleted" checkbox is UNCHECKED -- you want your boot disk to stick around after the instance is deleted. The next time you create your instance, select "Use existing disk", and select the same disk.
You'll still pay $0.04/GB/month for the disk storage all the time, but you'll only pay for the instance running when you need it.
You can add a cron job that checks every 10 minutes to see if the load on the machine is less than 0.05 and no one is logged in and then runs "shutdown -p now" to shut down the machine if you're concerned about forgetting to shut down the machine.

SQL back up issues

I have been doing some research on best backup procedures for largish (27.678gb) MYSQL database tables.
Currently we are using a program called Rapidsync (which is a offsite backup tool) but it is slow and it locks the tables it's currently backing up therefore causing downtime/slowness of sql.
Our current server is running Windows 2008 r2 with SQL server 2008 (on the same box) also.
Hardware specs for the dedicated server are:
16gb Ram
CPU intel xeon E3-1230 V2 # 3.30GHz
1 TB hard drive
In terms of databases we have 58 in total varying in size in which some need to backed up weekly ideally or even daily.
Through a program we use called Navicat you can tunnel to a database using SSH and copy databases manually, is this a reliable and feasible option if we were to install it on our local machine and copy them across? Or would it be more secure/efficient to use SQL Dump maybe?
I hope I have given all of the necessary info but please do ask if you need to know more.
P.S Only free options at this moment as we are on a tight budget! :)
Thanks in advance
You mentioned SSH, so I suppose the backups can be done also on other server than the database server itself. For Unix, you can use great tool Percona xtrabackup, which is free and supports online (without locking) backup of InnoDB database files and also incremental backups. Maybe it is possible to compile it also on Windows (part of it is written in C, part in Perl).
So you can setup weekly full backup and daily incremental backups. The tool will keep track of which pages of the InnoDB datafile has been changed and will copy only those.

SSIS Performance on Sql Server 2008 R2

I have a very odd performance issue with an SSIS package in Sql Server 2008 R2.
Here the facts:
Recently we migrated from a Sql Server 2005 (on Windows Server 2003 R2 32bit) to Sql Server 2008 R2 (on Windows Server 2008 R2 64bit).
Everything seems to be fine except some performance issue on one SSIS package.
If i run it from my PC it runs fine in some minutes (around 4/5) and the same seems to happen if i connect to Integrations Services through SqlServer Management Studio and start the package from there.
However when i run it from Sql Server Agent i have execution time that goes from 5 minutes to more than one hour... I had no such problems with the old server! I also tried to run the package in 32bit mode, on some run it seems to be faster, but it's pretty random... However it never reach the good performance it had on Sql Server 2005.
I have no clue... initially i think it was a memory problem because i did not give maximum memory limit to Sql Server and some other package had problems to run at the same time, so I expanded the RAM used by the server (it runs on VMWare) and now the machine has 8GB of RAM and maximum server memory for Sql Server is 4GB. The other package has no crash now, but this is still giving random execution time...
Any guess?
Following a table of execution time through days
Start Time Execution Time
12/17/2010 06:15 00:49:43
12/16/2010 17:54 01:12:26
12/16/2010 17:18 00:06:29
12/16/2010 16:53 00:05:23
12/16/2010 16:10 00:24:23
12/16/2010 06:15 00:19:26
12/15/2010 06:15 00:07:19
12/14/2010 06:15 00:11:26
12/13/2010 06:15 00:17:30
12/12/2010 06:15 00:44:59
12/11/2010 06:15 00:11:59
12/10/2010 06:15 00:34:19
What else is running? Do you have users running queries (who may lock tables) or other packages touching related tables when this package is scheduled to run? When you run it, do you see blocking locks or anything else like that?
It's more likely to me that the production batch execution environment isn't as nice and quiet and controlled as your development environment.
A user or related package holding data locks might explain the random distribution of execution times.
I found a solution to this.
The problem was a memory issue with the buffer creation on the server.
I partially solved it increasing the default buffer size (both in MB and rows number) and completely solved it removing all the Sort and Merge component i used replacing them with Lookup on custom Cache built with Transform Cache component.
I still do not understand why the allocation in Sql Server 2005 with Windows Server 2003 and in development works fine, however now the package is fixed!

How to Get Transactional MySQL data into a SQL Server database

I'm working on a project that has a MySQL transactional database backing up a web application. The company uses SQL Server for back office and reporting applications. What is the best way to update SQL Server with the data from MySQL? Right now, we are performing a dump of the MySQL data and doing a full restore. This may not be feasible much longer due to the increasing size of the database.
I would prefer a solution that copies only newly inserted and updated rows. I also need the SQL Server database to be static after the updates are applied. Basically, it should change once a day. I can update SQL Server from a local copy of MySQL (i.e. not production) Is there a way to apply MySQL replication to a slave server at specified intervals? A perfect solution is to run a once daily update on MySQL that syncs the database as of a point in time.
Can you find a way to snapshot the mySQL DB and then do the copy? It would make an instant logical copy of the database which would be frozen in time.
http://aspiringsysadmin.com/blog/2007/08/13/consistent-mysql-backups-using-zfs-snapshots/
ZFS filesystem can do this - but you haven't mentioned your hardware/OS.
Also, perhaps you could restrict the data you are pulling - whatever is time sensitive so that your pull will only get data that is older than 1 hour if your pull takes 45 minutes. Or to make things a little safer - how about just pulling the day before?
I believe SSIS 2008 has a new module called 'maintain' table that does the common task of getting updated/inserted records and optionally deletes.
Look into DTS, Microsoft's ETL tool. It's rather nice. Do the mapping, schedule it as a cron job, and Bob's your uncle.
Regardless of how you do the import to SqlServer from the MySQL clone, I don't think you need to worry about restricting MySQL replication to specific times.
MySQL replication only requires one thread in the master server and basically just transfers the transaction log to the slave. If you can, put the master and slave MySQL servers on a private LAN segment so that replication traffic does not impact the web traffic.
if you have SQL Server Standard or higher, SQL Server will take care of all of your needs.
use ssis to grab the data
use agent to schedule your timed tasks
btw - I'm doing the exact same thing that you are doing. SQL Server is awesome - it was easy to setup (I'm a noob to SSIS) and it worked on the first shot.
It sounds like what you need to do is to set up a script to start and stop replication on a slave database. If you can do that via a script, then you can establish a workflow in SSIS such as follows:
Stop Replication to Slave MySQL Database
If Replication has Stopped, then Take Snapshot of Slave MySQL Database
If Snapshot has been Taken, then
a= Start Replication to Slave MySQL Database
b= Import Slave MySQL Database Replica into SQL Server
NB: 3a and 3b can run in parallel.
I think your best bet in such a scenario would be to use SSIS to enable and disable MySQL database replication to the slave as well as to take a snapshot of the slave database. Then you can drive the whole thing from the SQL Server Agent mechanism.
Hope this helps