Archive for 2014


You may receive the following error with MariaDB on a Windows platform when attempting to create a table using the federatedx engine. 1 queries executed, 0 success, 1 ERRORS, 0 WARNINGS QUERY: CREATE TABLE t1 ENGINE=FEDERATED CONNECTION=”server” Error CODE: 1286 UNKNOWN STORAGE ENGINE ‘FEDERATED’ Execution TIME : 0 sec Transfer TIME : 0 sec Total […]

Bash script to execute a MariaDB query multiple times

This simple bash script will execute a query 100 times against a MySQL instance. It also uses the time command to report how long the entire process took. I use this for some very simple bench-marking. The query used here creates a temporary table and inserts 100K rows into it. You need the sequence engine […]

TSQL: Restore a multiple file backup

Just a follow up post using the backup files created in TSQL: Backup a database to multiple files. Here’s the script I used… ?View Code TSQLSET STATISTICS IO ON; SET STATISTICS TIME ON; GO   — Single file restore RESTORE DATABASE dbname FROM DISK = ‘\\path\to\backup\location\tmp\single_file_backup.bak’ WITH RECOVERY, MOVE ‘dbname’ TO ‘d:\SQLData\dbname.mdf’, MOVE ‘dbname_log’ TO […]

Copy date stamped backups with a regex & scp

Lets assume you have a directory of date stamped backups you want to scp to another location… backup_20141003.tar.gz backup_20141004.tar.gz backup_20141005.tar.gz backup_20141006.tar.gz backup_20141007.tar.gz backup_20141008.tar.gz backup_20141009.tar.gz scp can accept a regex like below to do this as a one-liner. Note the quotes are required for the expression to work. ?View Code BASHscp "user@hostname:/data/backup/backup_2014100[3-9].tar.gz" /path/to/location/ You should see […]

TSQL: Backup a database to multiple files

I wanted to see how much I could reduce backup times by specifying multiple files in the BACKUP TSQL command. Here’s a script I wrote to do this and I present a summary of the results below. The times are based on a database that produced a backup file(s) of approximately 51GB. You mileages will […]