[how to] Storing different countries' administrative divisions |
- Storing different countries' administrative divisions
- index mysql concatenated columns
- 10g to 11gr2 upgrade causes SYS.UTL_HTTP malfunction
- How do you link to MAMP with PHP
- MySQL: Row size too large (> 8126)
- What are the information contained over these objects? [on hold]
- Is there a name for this type of query, and what is an efficient example?
- Two primary keys to one foreign key
- What if I want to keep using MyISAM
- Log Shipping for SQL Server 2005
- user permission cache in session or check from database?
- How to properly index hstore tags column to faster search for keys
- If there exist multiple similar Values than show Sum of a another column else Show simple Value [on hold]
- Upgrade path - Oracle Standard to Oracle Enterprise
- How to provide a access to the data base if the user is not having the privilleges
- MySQL Continue Handler Problems inside a Function
- Data sharing between client and server two ways
- How can I query data from a linked server, and pass it parameters to filter by?
- Handling expiration in a course registration or ticketing system
- MySQL performance tuning + queries stuck on "Copying to tmp table"
- How to find when last reindexing happened in sql server?
- Deriving formulas for input/output
- innobackupex is failing while exporting backup
- "Could not find stored procedure' even though the stored procedure have been created in MS SQL Server Management Studio
- How to search a MySQL database with encrypted fields
- SQL Server 2008: How do I change the default schema of the dbo?
- What are the main differences between InnoDB and MyISAM?
Storing different countries' administrative divisions Posted: 06 Jul 2013 08:37 PM PDT I'm designing a data base which should relate users to their administrative division for statistical purposes, considering that every country has its own type of divisions. Chile, for example, is divided in regions which are divided in provinces which are divided in communes, while Angola is divided in provinces which are divided in municipalities which are divided in communes. I thought a solution could be to have a column called I don't want to cover the entire world, countries will be added as they are needed. Is it posible to modelate such thing? Thanks beforehand. |
index mysql concatenated columns Posted: 06 Jul 2013 08:31 PM PDT I have a table for author names with two fields, first_name & last_name, both varchar(55), both nullable (for crazy business logic reasons) although in reality last_name is unlikely to ever be null. My where clause for the search screen contains: so that "Twain" or "Mark Twain" can be searched on. The table has about 15,000 rows & is expected to gradually grow, but won't ever be more than double that, and not for years. I understand that there are many other parts of my query that will affect this, but given just that information, how might I best index this? If it would make a great difference in performance, making last_name not nullable is an option, but not first_name TIA! |
10g to 11gr2 upgrade causes SYS.UTL_HTTP malfunction Posted: 06 Jul 2013 08:19 PM PDT After a 10g to 11gr2 upgrade, we are getting ORA-29273 error while using SYS.UTL_HTTP package, upgrade list requires ACL to be disabled.What is the possible way to resolve this problem without enabling ACL? Thanks, Kayhan |
How do you link to MAMP with PHP Posted: 06 Jul 2013 05:46 PM PDT I am very VERY inexperienced with PHP and databases, and I was wondering how to send and retrieve info from the MAMP database a created. |
MySQL: Row size too large (> 8126) Posted: 06 Jul 2013 03:58 PM PDT Here's the issue. I have a table which has 300 columns in it, each up to 255 bytes (there IS a business justification for this). When I try it create it using
After reading up on this, I tried to change the table to use Barracuda format by specifying The error I get is:
Please help! |
What are the information contained over these objects? [on hold] Posted: 06 Jul 2013 03:34 PM PDT What are the information contained over the following MSreplication_options |
Is there a name for this type of query, and what is an efficient example? Posted: 06 Jul 2013 01:44 PM PDT The purpose is to find a parent, given it's children. For example, say you have a marketing package (aka a "combo"), and want to match it based on the products in it. Example table/data: Given products 1,2,3, I want to get marketing_package 1. But given products 1,2 only I do not want marketing_package 1. Is there a name for this type of query, and what is the most efficient way to go about it? |
Two primary keys to one foreign key Posted: 06 Jul 2013 12:00 PM PDT I have 2 IDs from 2 different tables (racing_couple and breeding_couple) and they are primary keys. In 3. table (egg) I have IDpar which is foreign key and references ID in racing_couple and breeding_couple. Tables represents racing and breeding couple of pigeons, table "egg" represents egg of racing or breeding couple. And I'm using IDpar to identify which egg belongs to which couple. Note There are other fields in both database but they are mostly varchar and not so relevant to this problem. If I have something like this in both databases. How to know which IDpar has value from racing_couple and which IDpar has value from breeding_couple. I think I made mistake by making my database like this, but is there any way to make that work? |
What if I want to keep using MyISAM Posted: 06 Jul 2013 10:21 AM PDT In my current use of MyISAM the databases are extremely small and kept for a few weeks after which time they are deleted and completely rebuilt with a clean slate. The script uses MYISAM tables and other than lack of support in the latest MYSQL versions, I have never had a problem with the way they work. My question is: Does anyone know of a specific reason to change from MyISAM to MyinnoDB just to keep up with MySQL. If I can keep using what works for my own specific use, I see no reason to worry with testing and possible errors when there are more pressing issues that do need attention that have problems now. MyISAM does not have a problem at this time. |
Log Shipping for SQL Server 2005 Posted: 06 Jul 2013 12:25 PM PDT When I establish the log shipping on my fail over database the LS_Restore process runs for ~ 1 hour (it runs every 15 minutes) and then fails. I have found that it is looking for something that is in the backup Transaction log file which is compiled once an hour and copied to a different directory than the transaction logs. Since it is a backup file it has an different naming string. Applying the backup trans log through the restore gui gets the process running for an hour and then it fails again. Any suggestions? |
user permission cache in session or check from database? Posted: 06 Jul 2013 12:23 PM PDT On each page of my websites 2 or 3 permissions have to be checked and I use role-permission model. Which one is better? to check permissions of each user always through database directly or once calculate it and store in session of user(cache permissions in sessions)? which one is more common? |
How to properly index hstore tags column to faster search for keys Posted: 06 Jul 2013 10:47 AM PDT I imported a large area of OpenStreetMap's planet.osm file into a postgresql database. The database contains a table called nodes. Each node has a geometry column called geom and a hstore column called tags. I need to extract nodes along a line that have certain keys in the tags column. To do that I use the following query: $geom1 and $geom2 are geometries for start and end points of my line. The query given above works but it is too slow. I guess searching for a key in tags column takes too much time. I read about GIN and GIST indexes and I generated a GIN index using the following query: After creating the index I searched again for nodes using the same first query but there is no change in performance. How can I properly use GIN and GIST to index tags column so I can faster search for nodes that have a certain key in tags column? Thank you |
Posted: 06 Jul 2013 05:11 PM PDT I am having a probelm. I have a table of Invoice with different Invoices. Each Invoice has a unique Invoice Number and some amount. Invoices are of two type. One is of Invoice Type, and the other is of Settled type. If there's a invoice created, the entry in the table will be of invoice type, the amount will be in positive. If the user paid that invoice, another entry with the same invoice number will be entered in the table but with the negative amount because the user has paid that amount. |
Upgrade path - Oracle Standard to Oracle Enterprise Posted: 06 Jul 2013 07:03 AM PDT Could I start on Oracle Standard edition and easily upgrade to Oracle Enterprise? Or do I need to rebuild the entire server? how does the upgrade path work? |
How to provide a access to the data base if the user is not having the privilleges Posted: 06 Jul 2013 02:48 PM PDT In MS SQL Server 2008 R2 is installed by a user "A" and he has a data base named "DB1" . He left the company. Now the user "B" is trying to access the data base. He is able to see the data abse and but he is not having the privillege to read the data. We don know the password of sql authentication. Both users are tin the admin group in that machine where the sql server is installed . now is there any way by which the user is able to read the data |
MySQL Continue Handler Problems inside a Function Posted: 06 Jul 2013 10:49 AM PDT I am in process of writing a simple MySQL function that looks up a value in a table and returns it. In case there is not value found it returns null. However, even with a continue handler defined I still end up with a warning "No data - zero rows fetched, selected, or processed". My code is below, what am I doing wrong? I really want to get rid of this warning :) Update: MySQL Version 5.5.25 |
Data sharing between client and server two ways Posted: 06 Jul 2013 07:56 AM PDT One of my Silverlight applications is running. This Application is using one central database (SQL Server 2008) and three other client databases (SQL Server 2008) in server other locations. Our requirement is that with minor changing or without changing the Silverlight application, when we make changes in the central database (insert, update and delete in multiple tables) these changes automatically occur in all client databases. And when any change is made in any client database all client as well as central database should be updated automatically. For this I read some about Sync Framework and SQL Server 2008 Change Tracking. But I have no idea about how will I do this. Please help me. How can we achieve this? |
How can I query data from a linked server, and pass it parameters to filter by? Posted: 06 Jul 2013 06:49 AM PDT I have a really big query that needs to be run on multiple databases, and the results appended to a temp table and returned. The basic syntax looks something like this: The query runs quickly if run locally on the the individual servers, however it takes a long time to run if it's run from a linked server using the 4-part names like above. The problem appears to be it's querying the linked server for the unfiltered result set first, then joining it to the If I hardcode the Ids to filter the result set on the linked server, such as it runs quickly in just a few seconds. Is there a way to run this query so it filters the result set of the query from the linked server by the Some things to note
|
Handling expiration in a course registration or ticketing system Posted: 06 Jul 2013 05:34 PM PDT I want to restructure the database for a web application I inherited for handling summer camp registrations, but my question is relevant to any event registration or ticketing system. My question is about how to best handle the need for registrations to expire if unpaid for X amount of time. Currently the database design is something like this (some columns omitted for brevity): When payment is completed, the There are currently some bugs related to this, and anyway it seems to me to be a somewhat strange design given that the I've been researching potential database designs for this scenario and one thought I had was to add price info to the In this design, the FK Another option I thought of, inspired by this example (scroll down to "Data Modeling in the Sample Application"), would be to have a separate Finally, I considered what it would look like if I kept the So my specific concerns are:
|
MySQL performance tuning + queries stuck on "Copying to tmp table" Posted: 06 Jul 2013 09:49 AM PDT The latter part of the question's title (queries stuck on "Copying to tmp table") has been addressed many times, and I have spent a fair amount of time researching this. I would appreciate it if you guys could help me come to a conclusion - especially with my particular server set up in mind. Quick overview of server: The setup is in no way tweaked, so current config is to some extent way off. Hopefully your scolding could provide knowledge. The web application running on the server is a Magento site with 25.000+ products. The query giving the most headache is the one generating sitemaps. Currently, the following query has been stuck for a little over an hour on "Copying to tmp table":
Relevant config: Server buffers: Per thread buffers:
The above memory limits will allow me to use 130% more RAM than is physically installed on my system. Obviously, something must change. According to the MySQLTuner Perl script, I am currently in danger of using:
The two variables that seem to affect "Copying to tmp table" the most are: Mine are both set to 0.25G
There are two suggested fixes that seem to get mentioned more that others:
|
How to find when last reindexing happened in sql server? Posted: 06 Jul 2013 04:49 AM PDT I have set 'job' for re-indexing, I want to know when the last re-indexing happened in datetime. |
Deriving formulas for input/output Posted: 06 Jul 2013 08:49 PM PDT I'm currently enrolled in a DBS class and am having problem with an assignment. I've searched around and have been unable to understand what it is I'm meant to be doing with this derivation formula.
I've been using some software that was given with the assignment and it also asks what are the maximum number of blocks that are allowed and that is not given by the above brief. I'm not really sure how to derive a formula for this. I've assumed that because there are 3 records per block there are 4 blocks required and that a random heap file uses 1 disk i/o per write/read. If this is a larger topic than is worth explaining a link to a reliable few pages is also helpful. |
innobackupex is failing while exporting backup Posted: 06 Jul 2013 03:49 AM PDT I am using perl script which is working fine in one of my other box which used to take individual schema backups & finally take all schema together using percona innobackupex. I have following information in the Log(posting One day Log details): Full details are in /apps/dbbackup/backup.log. Named pipes are existing in the /tmp even after backup getting failed : Any idea, why the backup is failing? |
Posted: 06 Jul 2013 06:59 AM PDT I have created a table which I used the Microsoft SQL Server 2008 Management Studio. I created a stored procedure and are able to view the Stored Procedures on the I find it very strange when I receive the following error: when I execute the following SQL statement: What could it be missing? |
How to search a MySQL database with encrypted fields Posted: 06 Jul 2013 10:52 AM PDT Suppose I need to encrypt certain table-fields of a MySQL database. Additionally, I need to search some of those fields I did encrypt. How would one search those fields anyway? Decrypting each record step by step is no option: Suppose I have multiple of thousands of records. It would take too much time and space to decrypt each record and check if each single record matches the search. UPDATE 2012-09-07 Adding further details to the database schema would be OK, since I'm about to implement a new application. Furthermore, I need to extend applications currently running in production. But even for those application, adding further details would be OK. UPDATE 2012-09-08 Encryption is the kernel of this question. Access restrictions, as proposed by some answers, already apply - but do not fit the formal requirement to encrypt data. This formal requirement is not Payment Card Industry Data Security Standard [PCI]. |
SQL Server 2008: How do I change the default schema of the dbo? Posted: 06 Jul 2013 07:43 AM PDT When I attempt to change the default schema of the dbo in SQL Server Management Studio, the ALTER fails and states that the dbo account's schema cannot be changed. Are there any tricks that can make is possible to change the the dbo default schema of "dbo" to "xxx"? Thank you! |
What are the main differences between InnoDB and MyISAM? Posted: 06 Jul 2013 09:05 AM PDT What are the main differences between InnoDB and MyISAM? |
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