[how to] Different social network user information |
- Different social network user information
- How does security context propagate between schemas within a database?
- PAGELOCK Conversion Deadlock From Update to Intent Exclusive
- How can lots of ram (128 GB) be used to improve MySQL 5.5 index creation?
- how to make a particular field into seperate columns?
- Fatal NI connect errors
- confused over encoding/locale in postgresql
- Inserting into mysql table with archive engine "duplicate key" error
- How do I generate a SQL script from my diagram in MySQL Workbench?
- In MySQL if column X has unique values what's the difference between UNIQUE index and B-Tree index
- An error was encountered in the transport layer - SSAS 2012 from Excel 2013
- DB2 Insert and Deadlocks
- hi all i need to sum the M,X,L and C values, how can i do it? help please [on hold]
- DB2 Communication link failure issue
- When is a Dynamic Port "dynamic"?
- fighting filter (nested loops) execution plan from Oracle
- Oracle Database 10g JRE Error
- How to migrate SQL Server to MySQL
- How can I migrate a sybase database to mysql?
- SQL Server to MySQL migration - how can I remove UCS-2 surrogate pairs in SQL Server?
- Efficiently Filter Large Set With Disjunctions
- search in mysql with like statement
- GROUP_CONCAT with ORDER BY , but results are not ordered
- SQL Server Decimal(9, 0) vs INT
- Converting a large SQL Server database to MySQL. Database corruption? Can't access data after transferring
- Practices to keep SQL Server databases easy to port to MySQL?
- How do you migrate a database from SQL Server 2008 to MySQL?
- SQL Server Cannot drop database <dbname> because it is currently in use... but no sessions displayed
- How do I list all databases and tables using psql?
Different social network user information Posted: 06 Aug 2013 07:17 PM PDT I am designing a website with social network login from various sites. The requirement is to allow the easy addition to the list of which social network login methods are supported. If I want to store information about users from the social networks they are logging in from in a relational database such as MySQL, this will be different from social network to social network. My question is: should I set up my relational database as follows: Although I am quite new to this, this seems to me that I will need to do two DB queries: 1. Find out what social network the user uses 2. Query the desired table for social network information I have read that using joins is much more efficient than sending multiple queries. Is there any other way to lay this out or is this the best way? Any help will be much appreciated! Thanks in advance. |
How does security context propagate between schemas within a database? Posted: 06 Aug 2013 06:49 PM PDT We have a I have created a user ID and have granted it access to only It works if I execute the How does security propagate between schema's within a single database? Here is a rough example of what I am trying to do, please let me know if I can explain this better, as for Im not remotely close to a dba. Error message received: |
PAGELOCK Conversion Deadlock From Update to Intent Exclusive Posted: 06 Aug 2013 03:23 PM PDT A customer of ours is experiencing frequent deadlocks. The deadlocks are mostly on the same We captured a deadlock trace using the trace flag 1222. The SQL Server log shows many, many deadlocks with the following pattern (in bottom-to-top order): Both processes are running the same UPDATE statement to set a flag on this tempdb table. This tempdb table holds information that needs to persist between client calls until the client is done. The table has a fairly long index that starts with a GUID representing a unique process ID. I am having difficulty understanding and simulating this deadlock. I have tried various amounts of records with simulated data. My questions: Why are these processes acquiring U locks and then converting to IX? I would expect the DELETE to acquire IX locks to begin with. How can I prevent the deadlock? The statement causing the deadlock is below. The process has just done a lookup of costs for a list of items at a single store. It is trying to note that there was a cost found. Note that there is a deprecated (NOLOCK) on an UPDATE table. Would this be a contributing factor? The customer's server @@version is:
So far I have not been able to capture the query plan used at the time of the deadlock, and the normal ways I try to retrieve the query plan are not returning anything(sys.dm_exec_query_plan and sys.dm_exec_text_query_plan both return NULL). |
How can lots of ram (128 GB) be used to improve MySQL 5.5 index creation? Posted: 06 Aug 2013 02:11 PM PDT This is similar to another post of mine, but now I have a different table structure, and it's still unclear what MySQL parameters should be changed to take advantage of the extra ram my machine has---so if it seems like a duplicate, let me know how best to rephrase what I'm asking. I have the following table: I plan to add an index on the first column ( Note: the engine type does not need to be MyISAM if that makes a difference. |
how to make a particular field into seperate columns? Posted: 06 Aug 2013 03:17 PM PDT Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production. I have this table in the below format: No | User | Value 01 | Port | Funds 01 | Vip1 | Systems 02 | Port | Bank 02 | Vip1 | Authority This is how I want it: No | Port | Vip1 01 | Funds | Systems 02 | Bank | Authority Now the problem is, in this table, the User column has 6 other entries besides Port and Vip1. So I would want 6 columns and their respective values. I also want a query that I can use in other similar tables that have different User column entries. This is what I was trying to do without any success: Please let me know what you think. |
Posted: 06 Aug 2013 01:43 PM PDT I'm wondering if there are any auditing processes I can enable to see what is causing these errors, like sql statements being run, or any other metadata that I could use to track down the source of these errors? I am aware of DBA_AUDIT_TRAIL (which uses SYS.AUD$), but it isn't giving me what I need. Fine Grained Audit Trail may be what I need? Not sure.... Here are my auditing settings for your review, anything I can change here to give me more to work with? |
confused over encoding/locale in postgresql Posted: 06 Aug 2013 01:18 PM PDT I am a little confused over the difference between encoding and locale as it pertains to the postgresql database. When initializing the database, you can specify both an encoding and a locale. Correct me if I am wrong but I assume the encoding defines what the database is actually stored as on the computer. So if I specify UTF8, all the characters in the UTF8 character set would be valid characters. If I specified WIN1252, all those characters would be valid characters. What I dont get is where the locale comes into play. If I specify my encoding as UTF8 and then specify my locale as English_United States.1252, what does that exactly mean? I think the WIN1252 character set is a subset of UTF8 so is the locale just specifying the subset of characters to be used from the UTF8 character set? From what I have read is that UTF8 can be used with ANY locale so what is the point in specifying different encodings if UTF8 is so ubiquitous and the locale is really the one specifying the specific character set to be used? Also, on Linux, the locale can be specified like so: en_us.utf8. So the database encoding is specified in the locale? If the encoding is specified in the locale, why even have a -encoding flag when initializing the database? |
Inserting into mysql table with archive engine "duplicate key" error Posted: 06 Aug 2013 02:20 PM PDT I am trying to archive some files using mysql archive engine. I am using this query to insert file contents: After inserting 2 records, I get "duplicate key" error from mysql for a key that doesn't exist in the table. I checked it like 5 times but the record is not there. I selected count(*) for the duplicate id and the result is 0. I checked the same code with an innodb engine and it works fine. Can anyone tell me what the problem is with the archive engine? |
How do I generate a SQL script from my diagram in MySQL Workbench? Posted: 06 Aug 2013 12:36 PM PDT I've created an EER diagram with tables, foreign keys, etc in MySQL Workbench and now I want to generate a ".sql" script that will create this database. How do I do that? |
In MySQL if column X has unique values what's the difference between UNIQUE index and B-Tree index Posted: 06 Aug 2013 02:40 PM PDT Let's assume that I have table Now, let's assume that data_id has unique values. Is there any difference(space, performance, memory) between having B-Tree index on |
An error was encountered in the transport layer - SSAS 2012 from Excel 2013 Posted: 06 Aug 2013 12:25 PM PDT When connecting to an SSAS 2012 tabular model from Excel 2013 (Data... From Other Sources... From Analysis Services... fill in Server Name... click Next), I get the error:
Excel, SQL Server, and SSAS are all running on the same server (Windows Server 2012). Because the server needs to be accessed from the Internet, there is a DNS entry for the server In the Excel (on the server's desktop) connection dialog, if I use I have added a hosts file entry so that |
Posted: 06 Aug 2013 06:11 PM PDT My application has 4 different threads doing inserts into the same DB2 table simultaneously. Could this cause a deadlock / lockwait situtation? Theoretically I don't see a problem here; as one insert statement is not going to lock a row required by another insert statement because all are independent insert statements. Also, I commit after each insert so transaction log wouldn't fill up. I'm looking for a high performance model while avoiding any potential lock situtation. Please provide your thoughts. |
hi all i need to sum the M,X,L and C values, how can i do it? help please [on hold] Posted: 06 Aug 2013 11:31 AM PDT |
DB2 Communication link failure issue Posted: 06 Aug 2013 12:15 PM PDT I would like to get your valuable suggestions for the below problem. My Perl application connects to a DB2 database and keeps inserting data into a table. The application successfully inserts data for a while and after sometime I start seeing the below Error 1. Error 1: Error 2: Error 1 occurs only once, after that Error 2 occurs repeatedly till I restart the application and establish new connection to the database. It's been confirmed that the database is running healthy and able to accept connections and even the network connections are healthy. Background on Error 1: Error "CLI0108E" Suggests that "The connection between the driver and the data source failed during execution of this function." And "SQLSTATE=40003" suggests that "The statement completion is unknown." Is it possible that something going wrong in an insert statement actually closes the connection? Or leaves the connection stateless? This actually breaks my Perl application. What are the best options to handle this situation? |
When is a Dynamic Port "dynamic"? Posted: 06 Aug 2013 12:01 PM PDT I was having a discussion today about First question: If the Second question: This is the one I'm most curious about. We have an instance that has had the same port (the value in the |
fighting filter (nested loops) execution plan from Oracle Posted: 06 Aug 2013 02:30 PM PDT My query is: The resulting execution plan is like this: Where FILTER is, essentially, NESTED LOOP JOIN which never finishes as NESTED LOOPS often do on large tables. (the two subqueries on the small table return, say, 100 rows each). I am looking for a way to tell Oracle to NOT use the stupid FILTER here. I've tried sticking USE_HASH hint everywhere including some places I'd rather not talk about now.... GROUPING SETS seem to play a role in this, but getting rid of them is very difficult here. The one reasonable thing that works is to replace OR with a UNION, but it doesn't cover all cases either. |
Posted: 06 Aug 2013 12:03 PM PDT I am trying to install Oracle Database 10.2 on OEL5U6(Linux System). I followed all the instructions from HERE. When I am executing installer this return:
But Java is already installed on my system. |
How to migrate SQL Server to MySQL Posted: 06 Aug 2013 01:49 PM PDT I'm trying to migrate a SQL Server db to MySQL, and I'm having a tough time. I've tried:
Anyone have suggestions? |
How can I migrate a sybase database to mysql? Posted: 06 Aug 2013 01:38 PM PDT I've been tasked with migrating a fairly complex legacy Sybase database into a MySQL database and I have no idea where to start. I can't use any off the shelf software, so I'm going to have to write some sort of script that takes all the info out of the Sybase database and puts it into MySQL. Does anyone have any resources or thoughts on how to do this quickly, as I have very little experience with Sybase or MySQL. |
SQL Server to MySQL migration - how can I remove UCS-2 surrogate pairs in SQL Server? Posted: 06 Aug 2013 01:54 PM PDT I have been tasked with migrating a SQL Server 2005 database to MySQL 5.6 (these are both database servers runnig locally) and would really appreciate some help. -------Edit - Answered------- This issue has now been resolved. I used Remus Rusanu's suggestion for finding the rows with these surrogate pair characters using -----------------------------
I decided to use the database migration toolkit in the latest version of the MySQL workbench. at first it worked fine and migrated everything as expected. But I have been totally tripped up upon encountering UCS-2 surrogate pair characters in the SQL Server database. The migration toolkit copytable program did not provide a very useful error message:
It also did not provide any field/row information on the problem-causing data and would fail within chunks of 100 rows. So after searching through the 100 rows after the last successful insert I found that the issue seemed to be caused by two UCS-2 characters in one of the nvarchar fields. They are listed as surrogate pairs in the UCS-2 character set. They were specifically the characters DBC0 and DC83 (I got this by looking at the binary data for the field and comparing byte pairs (little endian) with data that was being migrated successfully). When this surrogate pair was removed from the SQL Server database the row was migrated successfully to MySQL. Here is the problem: I have tried to search for these characters in a test SQL Server table (this chartest table is just various test strings an nvarchar field) to prepare a replacement script and keep getting strange results... I must be doing something incorrectly. Searching for Will return any surrogate pair character (whether or not it uses DC83), but obviously, only if it is the only character (or part of the pair) in that field. This isn't a big deal since I would like to remove any instance of these anyway (I dont like to remove data like this but I think we can afford it). Searching for Will return every row! Regardless of whether it even has a unicode character present in the field let alone the DC83 character. Is there a better way to find and replace these characters? Or something else I should try? I have also tried setting the target databse, table, and field character set to UCS-2 but it seems as though it does not make a difference. I should also mention that this migration is using live data (~50GB database!) while one of the sites that feeds it is taken offline so any solutions to this need to have a quick running time... I would appreciate any suggestions very much! Please let me know if there is any information I have left out. |
Efficiently Filter Large Set With Disjunctions Posted: 06 Aug 2013 08:21 PM PDT Let's say I have a single table In this example I want users to be able to create "partially ad-hoc" queries against this table. I say partially because a few parts of the query will always fixed:
The user can optionally filter on any of the other columns. They can filter on none, one, or many. And for each column the user may select from a set of values which will be applied as a disjunction. For example: Now assume the table has 100,000,000 rows. The best I can come up with is a covering index that includes each of the "optional" columns: This gives me a query plan as follows:
It seems pretty good. About 80%-90% of the cost comes from the Index Seek operation, which is ideal. Are there better strategies for implementing this kind of searching? I don't necessarily want to offload the optional filtering to the client because in some cases the result set from the "fixed" part could be 100s or 1000s. The client would then also be responsible for sorting and paging which might too much work for the client. |
search in mysql with like statement Posted: 06 Aug 2013 12:17 PM PDT Imagine I have this table named Now if I search the database using this: It will return : |
GROUP_CONCAT with ORDER BY , but results are not ordered Posted: 06 Aug 2013 01:05 PM PDT The following query works fine but the Structure for table project Structure for table project_photos |
SQL Server Decimal(9, 0) vs INT Posted: 06 Aug 2013 08:52 PM PDT One of our customers uses for some columns the datatype According to the MSDN library, the storage space of the I can think of two "benefits" of using
but these aren't real benefits in my opinion:
This makes me wonder: what is the added benefit of a |
Posted: 06 Aug 2013 01:44 PM PDT I have gigabytes of tabular data stored in a SQL Server database. I've been trying to migrate it to MySQL using the Migration Toolkit from Oracle. I didn't have any mapping errors and fixed all the syntax mismatches, so now the rows are being transferred. But when I go to PHPMyAdmin and try to browse, it keeps saying I researched a bit and increased the buffer size from 16M to 160M in my.conf. But I can't fix this problem. Some things I noticed (red marked in the status page): Innodb_buffer_pool_pages_dirty: 376 Innodb_buffer_pool_reads = 92 k Handler_read_rnd = 41 Handler_read_rnd_next = 59 k Any advice? This database will be read-only. Also the server specs: dedicated, 8GB RAM, Debian 6, 500GB HDD, ~2.8GHz Quadcore Intel |
Practices to keep SQL Server databases easy to port to MySQL? Posted: 06 Aug 2013 01:46 PM PDT We've developing an ASP.NET Web application that is to be designed for MS SQL Server 2008. I'd like to minimize my future dB admin's headaches should there be a need to migrating over to MySQL. With that goal, are there any specific design patterns or features we should avoid on MS SQL? Issues that trip over the MS SQL -> MySQL migration tools? |
How do you migrate a database from SQL Server 2008 to MySQL? Posted: 06 Aug 2013 01:41 PM PDT I'm just getting into MySQL, so forgive me if this is a basic question. For my application I need to migrate my database from SQL Server 2008 R2 to MySQL. Is there any mechanism or technique or suggestion or tips or magic tricks for migration? |
SQL Server Cannot drop database <dbname> because it is currently in use... but no sessions displayed Posted: 06 Aug 2013 12:08 PM PDT When I try to drop a database I get the error "Cannot drop database "dbname" because it is currently in use". However, when I run Why is this happening? |
How do I list all databases and tables using psql? Posted: 06 Aug 2013 12:14 PM PDT I am trying to learn PostgreSQL administration and have started learning how to use the When I log in with I have tried |
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