[how to] Restoring SQL_ASCII dumps to a UTF8-encoded database |
- Restoring SQL_ASCII dumps to a UTF8-encoded database
- Need a log based replication / CDC solution to publish postgres to oracle subscribers
- How to troubleshoot high cpu problems related to postgres and postmaster service?
- How to implement somthing similar to "pointer arrays" on MYSQL
- User roles and permissions
- Running two loops simultaneously to move a list to rows in two different columns of different lengths
- Difference between Sql server and Oracle [closed]
- /usr/sbin/mysqld was deleted and replaced by another mysqld with different inode
- SQL Server 2012 FileTable Missing sometimes
- Is it safe to remove an entry in a "config.mongos" MongoDB collection?
- Percona XtraDB Cluster and MySQL Replication
- Can I optimize this MERGE statement?
- How to change x-axis labels in a report
- Can I default to T-SQL only view in VS 2012?
- What signals do the DBWn processes send to LGWR?
- Query keeps on executing
- SQL Agent embedded PowerShell script in CmdExec step fails with import-module sqlps
- Need an idea for a complex SQL question
- How to optimize multiple self-JOINs?
- Efficient way to fetch records since a given criteria
- Is the key_buffer_size applicable to myisam tmp tables?
- Update one table from another table while sorting that table based on one column
- increasing mysql table open cache?
- select count(*) in mysql 5.5 innodb-- rewrite advice?
- Search every column in every table in Sybase Database
- Parameter Sniffing vs VARIABLES vs Recompile vs OPTIMIZE FOR UNKNOWN
Restoring SQL_ASCII dumps to a UTF8-encoded database Posted: 07 Jun 2013 03:53 PM PDT I've got a Postgres 8.4 environment where the encoding on all our databases is set to Unfortunately the text data in this DB is not clean -- Trying to restore the pg_dump to a utf8-encoded database throws errors about invalid byte sequences, even if I specify We have a LOT of data (upwards of a million rows with text/string elements), and auditing all of it by hand would be very time consuming (and error prone) so I'd like to automate this if possible. Is there an easy way to find the non-utf8-conforming strings/text fields in the database so we can fix them? Or am I stuck with a manual audit to straighten this mess out? |
Need a log based replication / CDC solution to publish postgres to oracle subscribers Posted: 07 Jun 2013 02:03 PM PDT We have a moderately large postgres 9.1 db that is currently 3TB and will likely grow much larger over the next couple of years. we need a reliable and fast solution for moving this data into either oracle 11G or sql server 2012 databases. we need a log based solution like replication or CDC with a minimal foot print of the postgres server and not looking for a code based ETL solution like SSIS or SAP Data Services. It should also be able to effectively handle blob / spatial data that is stored in postgres |
How to troubleshoot high cpu problems related to postgres and postmaster service? Posted: 07 Jun 2013 02:08 PM PDT I'm using an open source(RHCE 6.2) based machine running SIEM software , when i do the top command i see
both eating 96% of cpu usage? Is there a way to pin-point or see what causing these service to stack up? thanks. |
How to implement somthing similar to "pointer arrays" on MYSQL Posted: 07 Jun 2013 04:36 PM PDT While building a site I came across the following issue: I want to be able to have multiple containers and within each container have ids pointing to multiple items that lie on another table. (Scheme: http://i.stack.imgur.com/pb78k.png) I am using MYSQL and would like to stick with it. However I am open to other ideas. My questions are:
|
Posted: 07 Jun 2013 12:11 PM PDT Look at the attached graphic. I'm trying to keep this as simple as possible. Basically I want to have multiple admins(or superusers) who own regular users who own sites.
I don't know if I should have What's the best way to do this simply? P.S: I know the graphic has User2 under site1 and site2 but I don't need it that complex. Same users for same site but different roles is sufficient. No need for 1 regular user to edit 2 sites. |
Posted: 07 Jun 2013 12:11 PM PDT I need help in below table updation using SQL in Ms-Access 2007 database. I've a table called table1 which has below entries: table1: Using SQL, I want to change the above table (particularly the column col3 and col4 multiple values into individual multiple rows) as shown below: I found your answer in Ms-Access 2007-2010 SQL - from single row record how to create multiple rows and I was able to alter it to fit my needs. I am having trouble creating a nested loop. When I nest the loops I end up getting duplicated rows depending on whichever col i have running on the inner row. I cannot find a way to run the two loops simultaneously. I would really appreciate any help you can give me! |
Difference between Sql server and Oracle [closed] Posted: 07 Jun 2013 11:44 AM PDT What is the Difference between Sql server and Oracle? |
/usr/sbin/mysqld was deleted and replaced by another mysqld with different inode Posted: 07 Jun 2013 07:23 PM PDT This happened on three of our mysql server running on RHEL. While checking for open and deleted files, I found that mysqld in use is deleted (as seen in lsof) and was replaced by a similar mysqld (in /usr/sbin/mysqld) with a different inode. Size and blocks of both the files (deleted and current) are same. new mysqld (not in use) seems to be of the same version as the deleted one. I am trying to figure out what could have caused this (there are no cronjobs running on the system). I checked system logs, database logs and yum logs and found nothing relevant. Any input is appreciated. Thanks! |
SQL Server 2012 FileTable Missing sometimes Posted: 07 Jun 2013 03:41 PM PDT I have created 3 folders by using file table. One of the folder have ~392 GB data (with heavy data read/write) and it is not showing up sometimes and I need to restart to SQL Server 2012 to make it appear in explorer again. I don't see any issues other folders with less load. Please advise. |
Is it safe to remove an entry in a "config.mongos" MongoDB collection? Posted: 07 Jun 2013 10:39 AM PDT There are old entries in my "config.mongos"; they reference hosts which previously had "mongos" running on them but no longer do. Can I safely remove those entries? |
Percona XtraDB Cluster and MySQL Replication Posted: 07 Jun 2013 07:56 PM PDT I've setup a 3-node multi master replication with percona xtradb cluster, it works perfectly. Now I've tried to add some read-only slaves setting up replication as usual but it seems the binlog doesn't include the new inserts, I've set binlog_do_db on the master of a database, slave says the log position is the same as the master ones but the new data isn't there. Is there a special way to do replication on xtradb cluster? |
Can I optimize this MERGE statement? Posted: 07 Jun 2013 10:20 AM PDT I am attempting a single column merge between two tables. The first table ( In my development environment, the query takes just under 8 minutes. But in the production environment, it should take significantly less (much more powerful machine). However, I anticipate the query taking at least 2 minutes to run in production. I know that this query was causing timeouts for other developers in the development environment, which means it could easily cause timeouts for customers. Is there a safer and/or faster way to perform this query? |
How to change x-axis labels in a report Posted: 07 Jun 2013 10:15 AM PDT I am creating a trend report, in which the x-axis labels are first laywr as year (2014), second quarter (1,2), third period (month) (3,1), fourth week (3,4,5,1,2). I need to change these labels as All I need is to change the labels as they appear. |
Can I default to T-SQL only view in VS 2012? Posted: 07 Jun 2013 01:28 PM PDT When creating new tables in a database project in VS 2012, opened sql files default to a split view. One is the T-SQL text editor view, and the other is the Design view. I've never used the design view, and probably never will. I just prefer the text editor. Is there a way to tell VS to default to the T-SQL view? |
What signals do the DBWn processes send to LGWR? Posted: 07 Jun 2013 08:06 PM PDT I would really like to know what signals are in the following quote from the Process Architecture docs, and how does
|
Posted: 07 Jun 2013 10:38 AM PDT I'm executing below query, but it keeps on executing. In place of |
SQL Agent embedded PowerShell script in CmdExec step fails with import-module sqlps Posted: 07 Jun 2013 10:43 AM PDT SQL Server 2008R2 PowerShell 2.1 I am trying to create a SQL Agent job that dynamically backs up all non-corrupted SSAS databases on an instance without the use of SSIS. In my SQL Agent job, when I create a CmdExec step and point to a PowerShell script file (.ps1) like this: the job executes successfully (or at least gets far enough to only encounter logic or other syntax issues). This approach won't work for a final solution, because there is a requirement to keep the PowerShell script internal to SQL. So I have a different CmdExec step that embeds the PowerShell script like so: However, when executed with the embedded script, the job errors out quickly with the following response:
Why can't I reference the module from an embedded script, but doing so in a ps1 file works just fine? |
Need an idea for a complex SQL question Posted: 07 Jun 2013 12:04 PM PDT I have had my cup of coffee, but cannot come up with a good solution for the following problem - so I am here to pick your brain. ;-) Here is what I am trying to accomplish (for PostgreSQL):
So, what I am looking for are these rows for product that were rejected but never sent again correctly - it may happen that rows get send multiple times and rejected multiple times by our validation process. I have been at it for a couple of hours, but so far without much luck. |
How to optimize multiple self-JOINs? Posted: 07 Jun 2013 06:13 PM PDT I'm looking for advice on either optimizing multiple self-joins, or a better table/DB design. One of the tables looks as follows (relevant cols only): The With all values in a single column, self-joins seemed like the way to go. So I have experimented with various suggestions to speed those up, including indexing and creating new (temp) tables. At 9 self-joins, the query takes a little under 1 min. Beyond that, it spins forever. The new table from where the self-joins take place has only about 1,000 rows, indexed on what seem to be the relevant variables - creation takes about 0.5 sec: The I'd actually like to retrieve a few more variables, plus potentially join other tables. Now I'm wondering whether there's a way to run this more efficiently, or whether I should take an altogether different approach, such as using wide tables with indicators in different columns to avoid self-joins. |
Efficient way to fetch records since a given criteria Posted: 07 Jun 2013 08:24 PM PDT I'm trying to implement a logic where the user can say give me n records since a given id#. E.g. Performance is the biggest issue here, especially when you get into nested loops for complex joins. I've looked at the new Is there an alternate way to do this efficiently in SQL Server (2008 R2 and above)? Update: Complete SQL as generated by EF Code first Update: The real bottleneck turned out to be network latency caused by EC2 servers. |
Is the key_buffer_size applicable to myisam tmp tables? Posted: 07 Jun 2013 04:24 PM PDT I have a database about 750GB in size. It's all innodb. Larger analytical queries often need to group by several columns or use distinct so it's common that MySQL will have to create tmp tables. The tmp tables fit into memory. My cache hit ratio (Key_reads / Key_read_requests) is 0. When MySQL creates these tmp tables, I'm guessing it doesn't it create pseudo indexes to be used by key_buffer_size. |
Update one table from another table while sorting that table based on one column Posted: 07 Jun 2013 03:24 PM PDT This is the problem I'm trying to figure out in MySQL. We have an old table contains some forms submitted by our users. Somehow, the previous decision was each time a user comes to this survey, a new form will be submitted. So in the old table we easily have several rows with the same Firstname, Lastname, but different values in the other columns, and there's a timestamp column Date_Submission as well. Now we are trying to move everything to a new table, but this time, for each person we only keep one row. And we want to keep some of the the latest old data of that user (like email, phone number, etc) I could do the following:
Apparently this won't give me the "latest" old date for each person. So I tried this one:
But they MySQL will complain with:
So I'm wondering, what's the correct way to achieve this? |
increasing mysql table open cache? Posted: 07 Jun 2013 02:24 PM PDT I often read that it is best to increase this variable slowly. Can someone explain why? My status indicates that I should increase it... What is best practice / "slowly"? Thanks! |
select count(*) in mysql 5.5 innodb-- rewrite advice? Posted: 07 Jun 2013 10:24 AM PDT I need advice on how to rewrite a select count(*) query for innodb tables mysql 5.5. in new environment its very slow... the query execution plan looks simple enough but very slow |
Search every column in every table in Sybase Database Posted: 07 Jun 2013 08:24 PM PDT I'm been taxed with the task of creating an application that pulls data from our Micros Point of Sales system. The POS is using a Sybase database running on one of our servers. The database schema is very convoluted. I've been able to figure out most of the schema to gain access to the data I need, however, there are a few things still left to find. I know what they are called in the actual POS, but I can't seem to find them anywhere in the database (although I haven't actually looked through all 200+ tables). I'm wondering if there's any way to run a query to search for a specific string in all the columns in all the tables. BTW, I'm using the "Interactive SQL" application that comes with the Sybase Database Client software to connect to the database. |
Parameter Sniffing vs VARIABLES vs Recompile vs OPTIMIZE FOR UNKNOWN Posted: 07 Jun 2013 12:21 PM PDT So we had a long running proc causing problems this morning (30 sec + run time). We decided to check to see if parameter sniffing was to blame. So, we rewrote the proc and set the incoming parameters to variables so as to defeat parameter sniffing. A tried/true approach. Bam, query time increased (less than 1 sec), when looking at the query plan the improvements were found in an index the original wasn't using. Just to verify that we didn't get a false positive we did a dbcc freeproccache on the original proc and reran to see if the improved results would be the same. But, to our surprise the original proc still ran slow. We tried again with a WITH RECOMPILE, still slow (we tried a recompile on the call to the proc and inside the proc it'self). We even restarted the server (dev box obviously). So, my question is this... how can parameter sniffing be to blame when we get the same slow query on an empty plan cache... there shouldn't be any parameters to snif??? Are we instead being affected by table stats not related to the plan cache. And if so, why would setting the incoming parameters to variables help?? In further testing we also found that inserting the OPTION (OPTIMIZE FOR UNKNOWN) on the internals of the proc DID get the expected improved plan. So, some of you folks smarter than I, can you give some clues as to whats going on behind the scenes to produce this type of result? On another note, the slow plan also get's aborted early with reason In summary
UPDATE: See slow execution plan here: https://www.dropbox.com/s/cmx2lrsea8q8mr6/plan_slow.xml See fast execution plan here: https://www.dropbox.com/s/b28x6a01w7dxsed/plan_fast.xml Note: table, schema, object names changed for security reasons. |
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