[how to] How do I deal with FK constraints when importing data using DTS Import/Export Wizard? |
- How do I deal with FK constraints when importing data using DTS Import/Export Wizard?
- What should be Performance Tuning Approach?
- Is it possible to force delete of mysql tables with FK?
- More CPU cores vs faster disks
- Setting mysql slow query to less than 1 second
- When should tables NOT be compressed
- Combining data from two databases with same structure into one database
- Label data according to percentile
- All users missing after a detach/reattach
- How to design indexes for columns with NULL values in MySQL?
- Postgres 9.2 select multiple specific rows in one query
- Default values for a table, how to refactor?
- WITH ROLLUP WHERE NULL = x
- Database migration, how to
- Booking system structure
- why would command text not execute at all?
- loading a csv file which is on local system in to Mysql DB which is on remote server
- Avoiding performance hit from GROUP BY during FULLTEXT search?
- AWS performance of RDS with provisioned IOPS vs EC2
- sp_startpublication_snapshot Parameter(s)
- Input requested on localization setup for DB
- query processor ran out of internal resources and could not produce a query plan
- TRUNCATE TABLE statement sometimes hangs
- Binlog has bad magic number
- Passing path from batch file to mysql
How do I deal with FK constraints when importing data using DTS Import/Export Wizard? Posted: 25 May 2013 07:37 PM PDT I am trying to use the SQL Server Import and Export Wizard to copy data from my production db to my dev db but when I do it fails with the error "The INSERT statment conflicted with the FOREIGN KEY constraint" i have over 40 tables with lots of FK constraints, is there some easy way to deal with this without having to write a drop constraint/add constrat script? |
What should be Performance Tuning Approach? Posted: 25 May 2013 04:11 PM PDT As a DBA when the client reports a performance slowness issue what should be the Approach in solving the issue. Meaning that we can not always suspect the Database for performance slowness, many a times it is because of network, application miss behaving. i would appreciate any expert DBA can spot light on What should be Performance Tuning Approach?
In general the DBA's are blamed for performance slowness issues even without knowing if it is a database issue. |
Is it possible to force delete of mysql tables with FK? Posted: 25 May 2013 07:04 PM PDT For deleting a table in which a Is there a short way to delete a table, and its all child tables (in which they have For example, and id is a |
More CPU cores vs faster disks Posted: 25 May 2013 11:21 AM PDT I'm part of a small company so as usual covering a number of different roles. The latest of which is procuring a dedicated SQL Server box for our .NET web app. We've been quoted on a dual Xeon E5-2620 (six core) 2.00 GHz CPU configuration (12 cores in total), with 32 GB of RAM. This has left us with a limited budget for the disk array, which would essentially consist of two 2.5" SAS 300 GB drives (15k RPM) in a RAID 1 config. I know that the disk setup is sub-optimal for SQL Server and I'd really like to push for RAID 10 so we can put the database, log files and tempdb on their own drives. In order to make this compatible with our budget should I consider reducing the number of CPU cores? or would I get better bank for buck keeping the cores and using fewer drives, perhaps 4 in a dual RAID 1 setup? Here are some additional stats
|
Setting mysql slow query to less than 1 second Posted: 25 May 2013 08:26 PM PDT I have a heavily loaded LAMP system serving about 40 requests per second and doing about 300 mysql queries per second. Here is the output of mysqladmin status However, the global status show about 5-10% table lock contention. So, i want to figure out the queries that are taking longer time. Is it possible to set the slow query log to less than one second? For my queries, even execution time of 100ms is high. |
When should tables NOT be compressed Posted: 25 May 2013 07:01 AM PDT We have two servers. One we just compressed, but I took over this little project and this guy says some tables are not good candidates. As with many others, performance is -critical-. Is it accurate to say that some tables shouldn't be compressed? If so, what is a general threshold to look for? I ran his script to check for each objects reads/writes, but since this looks like a history, not what's occurred during a time frame, this might not be an accurate way to gauge that. |
Combining data from two databases with same structure into one database Posted: 25 May 2013 09:44 AM PDT I have five SQL Server databases with the same schema in five different geographical locations. These locations send periodic backups to the central server which I restore in the five respective databases. The requirement now is that data from these five databases MUST be combined into one database for consolidation. Any suggestion for the solution is most welcome. |
Label data according to percentile Posted: 25 May 2013 10:16 AM PDT I have a table name Some sample data is included at sqlfiddle |
All users missing after a detach/reattach Posted: 25 May 2013 08:43 PM PDT After detaching and reattaching a database to do a copy operation, all of the user objects are now missing from the database (I should add that the copy failed; according to the logs, there was an issue with a number of views. I didn't get a chance to really look it over before I discovered my much bigger problem). At a glance, the data itself seems to be intact - our most recent entries are present, etc., but the security->users folder looks like a virgin database - it contains DBO, guest, INFORMATION_SCHEMA, and Sys users, and that's it. All of the logins still exist at the service level, but they're no longer associated with the database itself. I've also noticed that the performance of the database seems to be hindered. I do weekly full backups, and nightly differential backups, and I have the transaction log from today, so my current plan is to simply restore from backup and roll forward to just before the error occurred. That said, for my own edification, I would still like to know if there is anything else that could be done to actually repair this. It seems like some system table must have been corrupted. Is there any sort of repair function (other than restoring from backup) that could remedy this? |
How to design indexes for columns with NULL values in MySQL? Posted: 25 May 2013 07:32 PM PDT I have a database with 40 million entries and want to run queries with the following
Amongst others, I designed an index Why is the index with |
Postgres 9.2 select multiple specific rows in one query Posted: 25 May 2013 04:03 PM PDT I have a table with three columns,
I want to select the values based on a range of days ie. from two days ago until now. The table may contain one or two rows per day, if it does contain two rows, I want to select the second row plus all the rows following it in the period of time. To clarify: If I wanted to select the values from day 26 (only the second row) plus all the values until day 29 and so on, can it be done in one query? |
Default values for a table, how to refactor? Posted: 25 May 2013 01:10 PM PDT I've created two tables, one listing the default prices of work for a lesson of given length ( Note that the salary in effect is the salary calculated by the newest entry for which CREATE TABLE `commonrates` ( `minutes` SMALLINT(5) UNSIGNED NOT NULL , `topic` SMALLINT(5) UNSIGNED NOT NULL , `individual` ENUM('false','true') CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL , `price` DECIMAL(7,2) UNSIGNED NOT NULL , `startdate` DATE NOT NULL , UNIQUE INDEX `minutes` (`minutes` ASC, `topic` ASC, `individual` ASC, `startdate` ASC) , INDEX `topic` (`topic` ASC) ) and CREATE TABLE IF NOT EXISTS `employeerates` ( `userid` INT(10) UNSIGNED NOT NULL , `minutes` SMALLINT(5) UNSIGNED NOT NULL , `topic` SMALLINT(5) UNSIGNED NOT NULL , `individual` ENUM('false','true') CHARACTER SET 'utf8' COLLATE 'utf8_bin' NOT NULL , `price` DECIMAL(7,2) UNSIGNED NOT NULL , `startdate` DATE NOT NULL , UNIQUE INDEX `userid` (`userid` ASC, `minutes` ASC, `topic` ASC, `individual` ASC, `startdate` ASC) , INDEX `user` (`userid` ASC) , INDEX `topic` (`topic` ASC) ) Now I see two similar tables. How to refactor it? I think it should be re-factored for better managebility, but I don't know how exactly to do this. Please help. |
Posted: 25 May 2013 12:10 PM PDT I tried to find this question somewhere else on here, and found a couple that were similar to it -- but all the answers seemed pretty convoluted, and I think it was surprising to me because I just imagined that SQL would have a way easier way to do this. Essentially, I'm using a Is there an easy way to substitute something saying if "NULL" is in the "Person" column, then make And if that's weirdly complicated, I'd be totally fine with just calling all of them "Total." Thanks! |
Posted: 25 May 2013 03:10 PM PDT I have two databases DB1 and DB2. In both databases exists this two tables mo_sms and mt_sms. This is the structure of those tables: I have some values in DB2 that should be migrated (inserted) in DB1. My problem here is I don't know how to get the records from DB2.mo_sms tables and those relations from DB2.mt_sms and then insert to DB1.mo_sms and DB2.mt_sms. For example I'll get all the records from mo_sms with |
Posted: 25 May 2013 10:10 AM PDT I am making a room booking system for a friends business. Background: 3 rooms, multiple clients, bookings available 9-5, bookings last 1 hour. For the database, is this too simple? Booking record table
Client table
Room table
Thanks for your help Nathan. |
why would command text not execute at all? Posted: 25 May 2013 05:10 PM PDT in my report i have:: i am using sql server profiler to see exactly what statement is being set. i have set only two filters:
yet after running the report, no statement gets intercepted. i suspect that because i am a beginner at SSRS, i am missing something crucial here. for what reason would commandtext not be executed at all? i did follow this question, to make sure that i am using sql profiler correctly, and indeed, i am: http://stackoverflow.com/questions/9107383/sql-server-profiler-capture-calls-to-your-databases-stored-procs-during-ssrs another bit of important information is although the chart shows no data: i actually am indeed showing data when i run the commandtext from ssms! |
loading a csv file which is on local system in to Mysql DB which is on remote server Posted: 25 May 2013 02:10 PM PDT Can we directly load a CSV file ( which is on the local system) on MYSQL DB ( which is installed on the Remote server ) ? 'load data infile into table name' command can only be used for loading in local system only. |
Avoiding performance hit from GROUP BY during FULLTEXT search? Posted: 25 May 2013 09:10 AM PDT Is there any clever way to avoid the performance hit from using group by during fulltext search? In this example it's fetching the lowest post_id for unique topic_ids that match the text. With the group by to find the min, it's taking 600ms in a million row database, with about 50K rows examined. If I remove the MIN but leave the GROUP BY, it's the same slowness, so it's the GROUP hit. I suspect this is because it can only use one index, the fulltext ? Without the GROUP BY it's 1ms so this has to be filesort speed? (I've removed ORDER BY and everything else to isolate where the hit is) Thanks for any insight and ideas. (using MyISAM under mariadb if it matters) |
AWS performance of RDS with provisioned IOPS vs EC2 Posted: 25 May 2013 11:10 AM PDT Has anyone done a performance comparison of AWS RDS with the new provisioned IOPS vs EC2? I've found plenty of non-high IOPS RDS vs EC2 but nothing with the new high IOPS feature in RDS. |
sp_startpublication_snapshot Parameter(s) Posted: 25 May 2013 06:10 PM PDT I am creating a stored procedure that:
Here is my new brick wall... On this DB server, I have a 'shell' db that they will be running the SP from, that has a history table so I can keep track of who created/deleted databases using my SP's... The only parameter for sp_startpublication_snapshot is @publication... I can give it the publication name, but since I am not running it from the publishing database, how do I specify the publishing database? i.e.: the publication shows up as: but I am running the script from the database [WC_QACatalog] Any ideas about how to accomplish this? Thank you, Wes |
Input requested on localization setup for DB Posted: 25 May 2013 07:42 PM PDT I am building an ASP.Net site that will pull dynamic data from SQL server. The site will be built with localization/globalization foundations in anticipation that in a year or so the site will start holding translations for non-English speaking users. I already know how accomplish this in ASP.Net for the static content but I would like some suggestions on a DB design for the dynamic data. I have toyed with the following 3 ideas and would like some input on them and any thoughts on other ways.
|
query processor ran out of internal resources and could not produce a query plan Posted: 25 May 2013 07:01 PM PDT This is showing up in the logs several times a night. How do I find the query causing the issue? SQL Server 2008 R2 Sp1. Thank you |
TRUNCATE TABLE statement sometimes hangs Posted: 25 May 2013 02:34 PM PDT Why does the I am migrating from MySQL to MariaDB. This problem doesn't happen with MySQL, only with MariaDB. The hanging statement is simply: What can cause this to happen, and how could I fix it? Another one observation is if the table have some data, may be one or two rows, then the truncate query works successfully. Else the table have a lot of data, query becomes hang. |
Posted: 25 May 2013 09:10 PM PDT I keep getting this error whenever I start MySQL. I have already tried this. I have an EasyPHP 12.1 setup on Windows 7x64 PC. |
Passing path from batch file to mysql Posted: 25 May 2013 08:10 AM PDT My batch file will contain some thing like this : Content of DBQuery1.sql will be : I am not sure this is the way to pass path to the SELECT query inside DBQuery1.sql. This code is not working. I looked at other posts on passing path to batch file, but whatever I tried, I am not able to solve this issue. When I execute the batch file, I am not sure if the path is getting passed into the sql file and if yes, why @2 is not getting the path passed. Could anybody kindly help on this. |
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