[how to] SQL Database Hosting Solutions? |
- SQL Database Hosting Solutions?
- SQL Server 2005 onwards- Capturing Baseline
- Finding rows for a specified date range
- How does Log shipping knows to keep track
- GeomFromText in trigger has error
- How does Log shipping knows to keep track [duplicate]
- How can we check for data integrity when we upgrade from MySQL 4.1 to MySQL 5.5?
- School database design
- Postgres database locked up
- Check existence with EXISTS outperform COUNT! ... Not?
- Constraint based rules engine
- Oracle schema migration to new database with zero downtime
- MySQL HDD activity with empty process list
- How do I use subquery on the same table in MySQL?
- InnoDB Tablespace critical error in great need of a fix
- Getting "BadImageFormatException" when attempting to connect through Visual Studio to Oracle
- phpMyAdmin Error After Upgrade to 3.5.8.1
- SHOW TABLE STATUS very slow on InnoDB
- Syncronize mysql databases between local and hosted servers automatically
- SELECTing multiple columns through a subquery
- Designing Simple Schema for Disaggregation of Demand Forecast
- SQL Server BPA 2008R2
- MySQL optimization - year column grouping - using temporary table, filesort
- oracle local partition index
SQL Database Hosting Solutions? Posted: 14 Jul 2013 05:30 PM PDT I have a client who is running a local SQL Server (for 2 computers) for a client application. They are considering upgrading the local DB to a hosted database. In all the places i look Amazon RDS, Azure, etc, all the prices seem to be expensive. Their database has about less than 1,000 records. Any suggestions? Am i looking in the wrong places? |
SQL Server 2005 onwards- Capturing Baseline Posted: 14 Jul 2013 10:30 AM PDT I want design a process by which I can capture the baseline data of multiple SQL servers( 2005 onwards) in a single database from where I can get all the info and alerts ..as of now I want to capture the info about below counters: 1) Free space available on disks 2) Database File and Log space available 3) Wait statistics 4) CPU and memory counters Is there any free tool that I can refer to and modify if needed or any useful article that can help me to set up the same. As of now I am referring to the article by Erin Stellato in SQLServerCentral.com. Any help would be greatly appreciated. Thanks Subhro |
Finding rows for a specified date range Posted: 14 Jul 2013 02:08 PM PDT I have a table which stores which teacher ( CREATE TABLE `pupilgroupteacher` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `groupid` smallint(5) unsigned NOT NULL, `startdate` date NOT NULL, `teacherid` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `date` (`groupid`,`startdate`), KEY `teacher` (`teacherid`), KEY `group` (`groupid`), CONSTRAINT `fk_pupilgroupteacher_2` FOREIGN KEY (`groupid`) REFERENCES `pupilgroup` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_pupilgroupteacher_1` FOREIGN KEY (`teacherid`) REFERENCES `employee` (`personid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin Having a teacher ID and a month, I need to find all groups for which this teacher worked (or is going to work) at least one day in the given month. Note: For a given |
How does Log shipping knows to keep track Posted: 14 Jul 2013 12:39 PM PDT I have set up log shipping between 2 SQL Servers (SQL Server 2008 and SQL Server 2012). At first i took a full backup of the first one and restored it on the other one and than i set up the log shipping. The databases first backup-restore took a few hours and below are my questions that I need to understand :
|
GeomFromText in trigger has error Posted: 14 Jul 2013 05:50 PM PDT I have this trigger: when I insert a row with this query: this error has occurred: |
How does Log shipping knows to keep track [duplicate] Posted: 14 Jul 2013 01:21 PM PDT This question already has an answer here: I have set up log shipping between 2 SQL Servers (SQL Server 2008 and SQL Server 2012), At first i took a full backup of the first one and restored it on the other one and than i set up the log shipping, The databases first backup-restore took a few hours and i wish to know:
Thanks |
How can we check for data integrity when we upgrade from MySQL 4.1 to MySQL 5.5? Posted: 14 Jul 2013 02:57 AM PDT By data integrity, I mean:
Checksum was an option, but since the storage format for some data types in MySQL 5.5 has been changed, it won't be reliable. Another option is to parse the XML file generated by mysqldump. Since the file is too large (in GBs), is it worth it? Any other way you have confirmed it? |
Posted: 14 Jul 2013 02:56 AM PDT I am trying to design a database management system with my PHP and intermediate MySQL knowledge, keeping normalization in mind. These are the assumptions:
As an intermediate programmer, it all got twisted. I was able to create the following tables and columns This is how far I have gone. Now I want to show a table where a student can be linked to all the subjects he/she is taking and a teacher linked to all the grades (no need to specify classes) he is teaching. How can I do that? I will appreciate it if I can be pointed in the right direction. |
Posted: 13 Jul 2013 10:10 PM PDT I was running a process to update a bunch of rows in postgres database and it locked up. Now I can't select anything out of it. None of my processes are "idle in transaction" when I execute Also the output of my locks select is: but I'm not sure what I can with that info. I also restarted my db and no luck. Any ideas? |
Check existence with EXISTS outperform COUNT! ... Not? Posted: 14 Jul 2013 07:26 PM PDT I've often read when one had to check existence of a row should always be done with EXISTS instead of with a COUNT. Yet in several recent scenarios I've measured a performance improvement when using count. I'm not familiar with methods to tell what's happening "inside" SQL Server so I was wondering if there was a unheralded flaw with EXISTS that gave perfectly sense to the measurements I've done (could EXISTS be RBAR?!). Do you have some explanation to that phenomena? EDIT: Here's a full script you can run: On SQL Server 2008R2 (Seven 64bits) I get this result
|
Posted: 14 Jul 2013 10:03 AM PDT I am evaluating software systems which configure products that tout constraint based versus rules based engines. Can someone explain (with maybe an example or two) to a non-expert what the difference is? My guess is that a constraint based engine is rules defining relationships between objects, and rules based engines are more like the WHERE clause of a SQL language query. |
Oracle schema migration to new database with zero downtime Posted: 14 Jul 2013 07:03 AM PDT I have a problem: I have two production schemas on one database each serving two different appplicaitons. I need to migrate (move) one schema to an entirely new database that will be dedicated for that application with zero downtime. SO EXPORT/IMPORT can not be used. I have license to even active data guard. But if I setup data guard from current database DB to new DB, should I switch over OR failover or what else so that the current primary will continue to be primary in its role and only the new DB will change its role from standby to fully operational primary. Then we simply direct the application to new and start the new db. Thanks for your help. |
MySQL HDD activity with empty process list Posted: 14 Jul 2013 01:04 PM PDT What does this mean and how can I understand what is mysql doing? I use InnoDB, my database is huge. This happens when I disconnect my app. Thanx. |
How do I use subquery on the same table in MySQL? Posted: 14 Jul 2013 06:03 AM PDT I have a query like this which takes a really long time to run. The table is around 4 million rows. I'm hoping I could create an index for (value_was, value_now) so I could do something like This table doesn't have primary key. It has two composite keys. And I guess I cannot use the same table in subquery, but how do I improve the performance of the first query? Thanks very much any suggestion would be much appreciated. |
InnoDB Tablespace critical error in great need of a fix Posted: 14 Jul 2013 05:03 AM PDT Link to screenshot : http://www.nouvellesduquartier.com/i/1/p/Munin_%20Critical_MySql_InnoDB_.JPG (The value reported is outside the allowed range - Byte free, free, gauge, warn, critic) Question: Could the error shown on the screenshot be the reason why my site is very slow? If so, I really need help to fix it since I am far from beeing an engeneer! Thank you in advance. |
Getting "BadImageFormatException" when attempting to connect through Visual Studio to Oracle Posted: 14 Jul 2013 05:04 PM PDT I get the following message: "Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed." when I attempt to create a connection from both Visual Studio 2008 and 2012 to Oracle from my Windows 8 64bit workstation. I'm not running a web app when this message happens. I'm only trying to establish an Oracle connection with Visual Studio. Any solutions posted on the internet that I have seen that resolve this issue with others, doesn't seem to apply to my circumstances.
My environment is
Any suggestions would be appreciated. |
phpMyAdmin Error After Upgrade to 3.5.8.1 Posted: 14 Jul 2013 06:23 AM PDT Im Nubie in mysql, I use that only for PHP. to the point, I try to upgrade myphpadmin 3.5.8.1, after I that, I cant accses my database and have error like This: My Other ALL DB have error like that. Anyone can help me? Im very Appreciated for your answer. |
SHOW TABLE STATUS very slow on InnoDB Posted: 14 Jul 2013 03:04 PM PDT Recently we've been migrating from MyISAM to InnoDB and I understand that MyISAM uses meta information against each table to track information and such - however, the database is about 1.8gb with 1+ million records across 400+ or so tables. The problem comes with software like PHPMyAdmin runs "SHOW TABLE STATUS FROM dbase;" where it can take up to 50 seconds to execute that command. Is there a way to optimise this? (MySQL or MariaDB) Thanks! |
Syncronize mysql databases between local and hosted servers automatically Posted: 14 Jul 2013 04:03 AM PDT We have many website with Development , Staging and Production Server. we have many developers for many projects, we need a solution to synchronize the database with developer database with staging database. after that one is works we can move to live database. That one is need to be fully automatically synchronize so that developer dont need to run that tool each and every time |
SELECTing multiple columns through a subquery Posted: 14 Jul 2013 08:03 AM PDT I am trying to SELECT 2 columns from the subquery in the following query, but unable to do so. Tried creating alias table, but still couldn't get them. Basically, I am trying to get the The above query works, but seems overkill as same row is fetched twice. Moreover, the |
Designing Simple Schema for Disaggregation of Demand Forecast Posted: 14 Jul 2013 02:04 PM PDT I am doing a simple database design task as a training exercise where I have to come up with a basic schema design for the following case: I have a parent-child hierarchy of products (example, Raw Material > Work in Progress > End Product).
Demand Forecast is usually done at the higher level in hierarchy (Raw Material or Work in Progress level) It has to be disaggregated to a lower level (End Product). There are 2 ways in which demand forecast can be disaggregated from a higher level to lower level:
Forecast shall be viewable in weekly buckets for the next 6 months and the ideal format should be: PRODUCT_HIERARCHY table could look like this: ORDERS table might look like this: where,
How to store forecast? What would be a good basic schema for such a requirement? My idea to select orders for 26 weekly buckets is: But this will give weekly buckets starting from today irrespective of the day. How can I convert them to Sunday to Saturday weeks in Oracle? Please help designing this database structure. (will be using Oracle 11g) |
Posted: 14 Jul 2013 12:04 PM PDT I have been using SQL server BPA for getting good information from Microsoft. I was using its 2005 version in which i used to export the results in csv format but recently I got two new servers which has got SQL Server 2008 R2 installed on it and I know I can't run BPA 2005 on these, so chose the R2 version of it, but it doesn't have an option to save the report on csv format, only xml, I have tried the excel to convert it into csv but no use, even-though it display the details but can't narrow down the results any idea of converting the results to csv format? |
MySQL optimization - year column grouping - using temporary table, filesort Posted: 14 Jul 2013 04:04 PM PDT I have a transactions table which is having 600,000 records, I need to list the count for the dashboard on financial year basis. The table used is MyISAM. I tried adding index for the transaction date ( SELECT COUNT( * ) AS cnt, CASE WHEN MONTH( tran_date ) >=3 THEN concat( YEAR( tran_date ) , '-', YEAR( tran_date ) +1 ) ELSE concat( YEAR( tran_date ) -1, '-', YEAR( tran_date ) ) END AS financial_year FROM `transactions1` WHERE tran_date >= '2010-06-01' GROUP BY financial_year Showing rows 0 - 4 (5 total, Query took 1.2095 sec) id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE transactions1 range PRIMARY,tran_date tran_date 8 NULL 346485 Using where; Using index; Using temporary; Using filesort Keyname Type Unique Packed Field Cardinality Collation PRIMARY BTREE Yes No tran_date 205720 A tran_ID 617162 A coupon_No BTREE No No coupon_No 617162 A account_typeBTREE No No account_type 3 A prodCode BTREE No No prodCode 430 A tran_date 308581 A tran_date BTREE No No tran_date 205720 A cust_ID BTREE No No cust_ID 3265 A tran_date 308581 A account_type 308581 A points_earned 617162 A Update : Tried adding partition which is not that much helpful in comparison with non partitioned one. Does replication help in this case for reading this table?. There will be more grouping based on the dates (using the date functions) when reading the data. Edit: I altered the query and reduced the query execution time. The query I used is, SELECT SUM( count ) FROM ( SELECT COUNT( * ) AS count, CASE WHEN MONTH( tran_date ) >=3 THEN concat( YEAR( tran_date ) , '-', YEAR( tran_date ) +1 ) ELSE concat( YEAR( tran_date ) -1, '-', YEAR( tran_date ) ) END AS format_date FROM transactions1 GROUP BY tran_date ) AS s GROUP BY format_date Showing rows 0 - 4 (5 total, Query took 0.5636 sec) id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 229676 Using temporary; Using filesort 2 DERIVED transactions1 index NULL tran_date 8 NULL 617162 Using index But when using SELECT COUNT( * ) AS count, CASE WHEN MONTH( tran_date ) >=3 THEN concat( YEAR( tran_date ) , '-', YEAR( tran_date ) +1 ) ELSE concat( YEAR( tran_date ) -1, '-', YEAR( tran_date ) ) END AS format_date FROM transactions1 GROUP BY tran_date Showing rows 0 - 29 (229,676 total, Query took 0.0006 sec) gives less time without using the |
Posted: 14 Jul 2013 05:31 AM PDT I have a table like this: Are these statements the same? Thanks, |
You are subscribed to email updates from Recent Questions - Database Administrators Stack Exchange To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment