[how to] MYSQL score by rank |
- MYSQL score by rank
- MySQL hogging memory
- Equivalent of MRG_MYISAM in databases other than MySQL?
- MySQL: logging queries which would execute without using indexes
- mysql: need help to optimize my query/table
- I'm trying to disable xp_Cmdshell and rpc_out and when i run the commands on query analyzer it shows its diabled
- Loading data in mysql using LOAD DATA INFILE, replication safe?
- MySQL Tables Require Daily Repairs - Server, Table or HD?
- Update "NULL" string to Actual NULL value
- Reinstall MySql but keep database tables and data
- Need ideas about OPTIMIZE TABLE
- Delete shared memory segments left over by an Oracle instance
- Pull Subscription: process cannot read file due to OS error 5
- Reducing Log Impact During Re-Indexing
- Time to apply transaction logs: does it matter how many logs?
- SQL pre-login handshake connection failure
- Single slave - multiple master MySQL replication
- Is it possible in Oracle to trace SQL statements that result in errors?
- Do I need client certs for mysql ssl replication?
- Custom sp_who/sp_whoUsers
- Need to suppress rowcount headers when using \G
- How can I replicate some tables without transferring the entire log?
- How to search whole MySQL database for a particular string
- multivalued weak key in ER database modeling
- Microsoft Office Access database engine could not find the object 'tableName'
- Foreign Key Constraint fails
- SSIS Row Count: Getting a null variable error where there is clearly a selected variable
- How do I copy my SQL Azure database to a local SQL Server instance?
Posted: 18 Apr 2013 07:52 PM PDT I am using MYSQL to create a rating system to implement my database. What I want to do is to rate each attribute by its percentage. Here is the example database: The output I want is: score's value will based on the rank so it becomes such as I have done the rank query but stuck with transforming it into scores. Here is the query I got so far: Thank you all guys :) |
Posted: 18 Apr 2013 07:26 PM PDT An installation of MySQL 5.6.10 on a virtualized Ubuntu 12.04 is exhibiting massive memory hogging: Usually, I am able to free ~ 3 GB by issuing While the system was swapping, I could observe rather high numbers for "swap out" counters (vmstat is showing ~1k pages/second during bursts) and hardly anything at all swapped back in (few dozens of pages per minute). I first suspected memory leakage but have not found anything supporting this hypothesis so far. What means do I have to identify the possible causes for the apparently unlimited growth? |
Equivalent of MRG_MYISAM in databases other than MySQL? Posted: 18 Apr 2013 05:57 PM PDT Does anyone know if other database have something equivalent to MRG_MYISAM (aka the MERGE table type/storage engine)? I know about fragmenting, but this is not quite the same AFAIK. We're using MRG_MYISAM to avoid large amounts of duplicate data across customer specific databases, so MRG_MYISAM is perfect. That said, I'd like to know if there are equivalent things in other DBs, particularly other open source DBs. |
MySQL: logging queries which would execute without using indexes Posted: 18 Apr 2013 05:24 PM PDT I am trying to use So given a table with the following structure a query I would expect the behavior of the latter query in the first case as well since the index is present. As is, it makes troubleshooting missing indexes rather tiresome. Ideas on how to approach this greatly appreciated. |
mysql: need help to optimize my query/table Posted: 18 Apr 2013 04:27 PM PDT I'm wondering if someone could help me optimize my tables/query to speed up a query. It is currently running ridiculously slow. I think a well-thought out index could help me. Any help would be really appreciated Tables URLS and TAGS mentioned below are 2 and 20 million rows respectively (will probably end up having 10x). A query like the one below already takes 10 seconds to run. An Example: http://whatrethebest.com/php+tutorials Tables and QUERY EXPLAIN I'm not sure what this shows So I think the problem is: certain tags like 'php have 34,000 entries, most of which only have under 5 saves. But in order to get the 20 most saved it is having to sort them all.Right? I can't really create a 'numsaves' column in TAGS and index on that because that number will be changing up and down, and that wouldnt make sense. Is it possible to create a cross-table index between urls.numsaves and tags.tag? Or a third table to use in my query somehow? Would this solve my problem? I know almost nothing about indexing. Any help would be really appreciated! Edits: Trying Ypercube suggestions* I tried making the index but not sure if it finished, is there any way to tell for sure? Here is that explain for your (very nice) query for php + tutorials When I run your query in php or phpmyadmin (I know, I know, gross, im new to this) it takes a long long time, but when I run it with explain in front it gives me the number of ROWS very quickly. What could this mean?? I will consider using a ID field. Its a good idea, Would it account for this much slowness though? I didn't think it was neccesary because the order of the rows doesnt matter and a lot will be deleted eventually and they only need to be unique on the hash of the URL .. but I could keep the hash for uniqueness and the other stuff is irrelevant |
Posted: 18 Apr 2013 04:43 PM PDT I'm trying to disable xp_Cmdshell and rpc_out and when i run the commands on query analyzer it shows its diabled But after this i need to run a security scan report which provides me the following report that its not disabled can anyone help me 5 Microsoft SQL Server Database Link Crawling Command Execution QID: 19824 Category: Database CVE ID:Vendor ReferenceBugtraq ID:Service Modified: 02/20/2013 User Modified:Edited: No PCI Vuln: Yes THREAT: Microsoft SQL Server is exposed to a remote command execution vulnerability. Affected Versions: Microsoft SQL Server 2005, 2008, 2008 R2, 2012 are affected. IMPACT: Successful exploitation could allow attackers to obtain sensitive information and execute arbitrary code. SOLUTION: There are no solutions available at this time. Workaround: Disable RPC_Out and xp_cmdshell for this issue. COMPLIANCE: Not Applicable EXPLOITABILITY: There is no exploitability information for this vulnerability. ASSOCIATED MALWARE: There is no malware information for this vulnerability. RESULTS: C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\Binn\sqlservr.exe Version is 2009.100.4000.0 |
Loading data in mysql using LOAD DATA INFILE, replication safe? Posted: 18 Apr 2013 04:21 PM PDT I am trying to load data into mysql database form CSV file. I found that we could use LOAD DATA INFILE command to do it. But as per the mysql documentation it is not replication safe. (See here) Is there a better way to do it rather than to do it via application? |
MySQL Tables Require Daily Repairs - Server, Table or HD? Posted: 18 Apr 2013 11:39 AM PDT I've been experiencing a weird issue with one of MySQL DBs. Every day, sometimes 2-3 times per day, I'll need to repair the tables. The MySQL DB has 25 tables with 5.6m rows in total. The bigger ones are: It seems table C needs to be repaired pretty frequently, Tables A & B not as much. When the table needs to be repaired, I'm not seeing it being marked as crashed or in use. But through other tools, I can see the data is not what it should be. When I do repair the table, I'll see a message similar to: or I've tried making adjustments in my.cnf but no difference. The server is a cloud server running both MySQL and Apache. Plenty of space available on all HDs: I'm not sure if this is a problem with the cloud HD, the server or the tables themselves. The problem didn't start happening until about 2 months ago and the size of the DB has only changed by 300-400MB until now. Any idea what I should be looking at to verify where the problem might be? Using MySQL v5.1.66 and MyISAM Thanks in advance. Best, Cent |
Update "NULL" string to Actual NULL value Posted: 18 Apr 2013 11:51 AM PDT I have a table that contains NULL values but the problem is that some of the values are actually string "NULL" and not actual NULLS so when you trying something like it will not return the fields that have the "NULL" string. What I am needing to do is run an update of the whole table that will convert all string "NULLS" to the actual NULL value. The "NULL" strings happen throughout all columns of the table so it is not just 1 column that needs to be updated. I am not sure how to approach this scenario. I'm thinking I might need to use a loop since i have many columns but then again there might be a simple solution without having to use a loop. What would be the best way to resolve this issue? |
Reinstall MySql but keep database tables and data Posted: 18 Apr 2013 10:37 AM PDT Please help! There are server issues and MySql is no longer running on our server (Ubuntu). The service is not recognized and needs to be reinstalled. Unfortunately, the database has not been backed up for 48 hours and that is a lot of information. How do I reinstall MySql AND keep all my database data? Please note - I can't access mysql at all. I can't use command line mysql nor phpmyadmin. Thanks in advance and let me know if I am missing important details. |
Need ideas about OPTIMIZE TABLE Posted: 18 Apr 2013 10:38 AM PDT Looking at a database with 10 tables and fairly active at by-the-hour changes. On the first of each month, I purge some rows from 3 tables to remove outdated material and keep the size down. All of these tables show highlighted (red) 'Overhead' in phpMyAdmin. Given these conditions, should the tables be Let's say the tables and current (mid-month) Data & Index sizes are: This question is in response to learning about indexes and efforts to reduce slow queries and learning about high counts for:
In reading articles about these items, it seems to be a 'learned' science and requires testing. Thanks for responding. |
Delete shared memory segments left over by an Oracle instance Posted: 18 Apr 2013 11:12 AM PDT We're using Oracle Enterprise 11rR2 running on Solaris. How can I delete/remove allocated shared memory segments using I'm getting this error: |
Pull Subscription: process cannot read file due to OS error 5 Posted: 18 Apr 2013 04:37 PM PDT I am trying to migrate a working pull subscription for transactional replication from one subscribing server to a new one. The subscribing server is at another site and is connected via a VPN tunnel. The serverName is resolvable via the hosts file. I am trying to capture the existing configuration precisely, but clearly am missing something. The error is Everyone has permissions to the UNC share and we haven't seen this problem with other subscriptions. The distribution process account is the SQL Server Agent, which I know is not best practice but matches the configuration of the existing working replication. I temporarily tried using a (local) Windows account Again, we have tried to configure the subscribing server exactly as the working server. What are we missing? We never saw this error when setting up the previous subscription. One note: the old subscription is still up and functioning, and uses the same accounts to connect to the distributor. I wonder if Access is Denied could be thrown due to a sharing conflict. |
Reducing Log Impact During Re-Indexing Posted: 18 Apr 2013 12:05 PM PDT We use Ola's maintenance solution and its great. Regardless of method for re-indexing a major friction point with IT is the amount of log generated during the weekly re-indexing process. For a 1TB DB upwards of 300 GB of log can be generated. This causes mirroring backlogs/delays and also cause Data Protection Manager to take a long time to sync up with its off-site DPM partner server (sometimes several Days!). As we approach a time where we will have a Second site on warm standby we know that this delay in having off-site backups available during the vulnerable period after Index maintenance could be the Achilles heal. We are considering a larger pipe between the sites for Avail Group but to generate less burst Log activity would be great. To mitigate this we have done 2 things with only minimal impact. First we spread out the weekly re-indexing by introducing Delays, purposely slowing a 3 hour process to about 8 hours or so. Secondly "some" key tables are maintained by a process that runs hourly resulting in Just in Time re-indexing. In a large and active OLTP DB with some LOB what are the rule of thumbs for re-indexing frequency, % of database affected, # indexes that should be rebuilt less frequently? Is weekly rebuild overkill? |
Time to apply transaction logs: does it matter how many logs? Posted: 18 Apr 2013 09:56 AM PDT When restoring from a backup in SQL Server, the procedure is to restore the Does it make a difference how many |
SQL pre-login handshake connection failure Posted: 18 Apr 2013 09:56 AM PDT I'm having an intermittent problem with one of my old SQL 2000 servers. Every once in a while it stops accepting logins. I fix the problem by bouncing sqlservr.exe and then it starts working properly for a few days. For example, running the PowerShell: Produces the error: Similarly, if I change the connection string to: I get a similar error, except the end of the error says: Checking I've checked the certificate store and there are no expired certificates in there. Checking the Windows event logs and SQL Server logs I'm not finding anything remotely useful there. Lastly, I've run some network traces. For a failed connection I show: A successful connection looks like: I've hunted around the registry to try to figure out which certificate SQL is using, but I haven't had any luck there yet. Any ideas on what to look for next? |
Single slave - multiple master MySQL replication Posted: 18 Apr 2013 05:10 PM PDT I need to replicate different MySQL databases from multiple servers into a single slave server. How can this be done? is there a way to define multiple master hosts? |
Is it possible in Oracle to trace SQL statements that result in errors? Posted: 18 Apr 2013 11:14 AM PDT We have Oracle 11g in production. Application system is still under active development. It will be very handy to get SQL statements which cause any error. Does Oracle provide a standard function to trace and log these statements and additional (debug) info? |
Do I need client certs for mysql ssl replication? Posted: 18 Apr 2013 01:51 PM PDT I'm setting up mysql replication using SSL, and have found two different guides. The first one creates both client and server certs, while the second one only creates server certs. I don't know enough about SSL to understand the implication of one option over the other. Should the slave be using the client certs or the server certs? |
Posted: 18 Apr 2013 03:02 PM PDT I need to allow a client in a dev DW SQL 2K8R2 environment, to view and kill processes, but I do not want to grant VIEW SERVER STATE to this person (he's a former sql dba and is considered a potential internal threat). When I run the following, it returns one row as if the user ran the sp themselves with their current permissions. Changing the "with execute as" to "self" (I'm a sysadmin) returns the same results. I've also tried the below instead of calling sp_who, and it only returns one row. It seems that the context isn't switching, or persisting, throughout the execution of the procedure. And this is to say nothing of how I'm going to allow this person to "kill" processes. Does anyone have a solution or some suggestions to this seemly unique problem? |
Need to suppress rowcount headers when using \G Posted: 18 Apr 2013 10:02 AM PDT Is there a command to suppress the rowcount headers and asterisks when using '\G' to execute a SQL statement? I am executing mysql with the |
How can I replicate some tables without transferring the entire log? Posted: 18 Apr 2013 11:02 AM PDT I have a mysql database that contains some tables with private information, and some tables with public information. I would like to replicate only the tables containing public information from one database to another, making sure that NO confidential information ever gets stored on the slave. I know I can use the Is there a way to ensure that only the public information is transferred to the slave? |
How to search whole MySQL database for a particular string Posted: 18 Apr 2013 01:02 PM PDT is it possible to search a whole database tables ( row and column) to find out a particular string. I am having a Database named A with about 35 tables,i need to search for the string named "hello" and i dont know on which table this string is saved.Is it possible? Using MySQL i am a linux admin and i am not familiar with databases,it would be really helpful if u can explain the query also. |
multivalued weak key in ER database modeling Posted: 18 Apr 2013 12:02 PM PDT I was wondering since i didnt find out any clarification for this. I want to store movies that exist in different formats (dvd, bluray etc) and the price for each format differs from each other as well as the quantity of each format, so i came up with this: Is this correct from a design perspective? Does this implies redundancy? I dont understand how will this be stored in a table. Would it be better to do it like this : Thanks in advance. EDIT : I add some more descriptive information about what i want to store in this point of the design. I want to store information about sales. Each movie that exist in the company i need to store format, price and stock quantity. I will also need to store customer information with a unique id, name, surname, address, movies that he/she has already bought and his credit card number. Finally i will have a basket that temporary keeps items (lets suppose that other items exist apart from movies) that the customer wants to buy. |
Microsoft Office Access database engine could not find the object 'tableName' Posted: 18 Apr 2013 04:02 PM PDT First a little background: I am using MS access to link to tables in an advantage database. I created a System DSN. In the past in Access I've created a new database, and using the exteranl data wizard, successfully linked to tables. Those databases and the linked tables are working fine. Now I am trying to do the same thing, create a new access db, and link to this same DSN. I get as far as seeing the tables, but after making my selection, I get the error, " The Microsoft Office Access database engine could not find the object 'tableSelected'. Make sure the object exists and that you spell its name and the path name correctly. I've tried creating another datasource (system and user) with no luck. Environment is Wn XP, Access 2007, Advantage DB 8.1 |
Posted: 18 Apr 2013 07:47 PM PDT I have the following tables: Trying to save the first table fails when I put in that foreign key constraint. Can't figure out why. Both of the columns referenced in the constraint have the same type, size, etc: They only have a difference default value. One has a default value of NULL, the other is AUTO_INCREMENT. I didn't think that made a difference for foreign key constraints but I could be wrong. Both tables are InnoDB and UFT8. What am I missing here? UPDATED: My specific error: |
SSIS Row Count: Getting a null variable error where there is clearly a selected variable Posted: 18 Apr 2013 02:02 PM PDT
From what I can tell, this error is thrown when a variable is not assigned to the VariableName property; however, I definitely have a variable assigned, as seen in the image below: I've deleted the Row Count component and remade it, but the error continues to show up. Here is a snapshot of the Data Flow in question: I'm not sure if its inclusion in a Conditional Split may be causing this error, but none of the other Row Count components seem to be throwing this error. |
How do I copy my SQL Azure database to a local SQL Server instance? Posted: 18 Apr 2013 12:10 PM PDT I have an OLTP database hosted on a SQL Azure instance. I want to pull a copy of the database down from the cloud so I can run some heavy extracts and OLAP-style queries against it without impacting the source database. How do I pull a copy of the database down to a local SQL Server instance? |
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