[how to] Mailing list system database schema design |
- Mailing list system database schema design
- Database utilizing the whole of swap space
- MySQL Grouping Order
- Dynamic SQL is not allowed error for creating function in MySQL
- Run Multiple Scripts In One Transaction Across Multiple Servers
- SQL Server 2012 High Availability on VMware virtualization
- Which databases can have row and column level security based upon Active Directory?
- After subscribing to a replication set, why can't I see the replicated tables on the local database?
- Ghost Cleanup process has high CPU usage in SQL Server 2012 SP1
- ERROR: text search configuration name "english" must be schema-qualified
- MySQL - unique constraints design
- multiple line text values in mysqldump text export file
- Relations, dependencies and normal form
- MySQL: ERROR 126 (HY000): Incorrect key file for table
- MySQL Access Denied, tried a few things, pulling hair
- Setting up SQL Server service broker from one database to multiple databases
- Why does my SQL Server show more than half a million active tasks?
- What's stored in data_dir/base of postgresql
- View with fallback (performance/optimization question)
- Altering the location of Oracle-Suggested Backup
- Database restructure - beneficial?
- MYSQL Timezone support
- replication breaks after upgrading master
- Need to suppress rowcount headers when using \G
- 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'
- MYSQL 5.5 Fail start Fedora 16
- Sql Anywhere 11: Restoring incremental backup failure
Mailing list system database schema design Posted: 16 Aug 2013 05:16 PM PDT I'm working on a simple mailing list system so to store messages and keep track of each message recipients so i have 3 tables:
The problem is: when sending messages to a large number of recipients like 1000 ,i have to add 1000 rows to the Mails-Recipients table then to get the recipients info for a single message i have to use join query with 1000 rows and with a large number of message this table will grow rapidly causing performance issues. Is there any better schema design for this system that can help maintain a good performance? |
Database utilizing the whole of swap space Posted: 16 Aug 2013 04:29 PM PDT When I load my progress database, it almost instantly eats up all available RAM, as well as swap space. I've been told that adding extents might fix this, but I'm not sure of how/where to identify if this is true. I additionally need to identify where/how to add extents. I did find some documentation, but without being able to identify the source of the problem I don't think I can execute it. I would post some additional data, but unfortunately I don't even know what is of use. Thanks |
Posted: 16 Aug 2013 03:29 PM PDT Is it possible to force the order in which a result set is grouped? I have a table with multiple languages in it, and I'm doing a GROUP_CONCAT to get a comma separated list of the product name in each language, for each product_id. However it doesn't seem possible to get MySQL to return that concatenated string in any particular order of language_id's. What I'd like is to be able to order the grouping by language id, so that they'll always come out in a pre-determined order. Is this possible? If so, how? If not possible within the SELECT statement, is there a modification I can make to the table to adjust how the GROUP BY would order the result? |
Dynamic SQL is not allowed error for creating function in MySQL Posted: 16 Aug 2013 01:35 PM PDT According to this question and answer of Angelo I create a MySQL function as below: But It has following Error: What should I do? |
Run Multiple Scripts In One Transaction Across Multiple Servers Posted: 16 Aug 2013 05:22 PM PDT We have deployment scripts that we need to run on databases that are spread across multiple servers. One script only runs on one database, but the scripts depend on each other. We are looking for a way to run all of the scripts as one big transaction so that all scripts either commit or rollback as a whole. How do I do this? I would prefer a way to do this from ADO.NET, but SSMS is cool, too. My current solution (that does not work) is that I begin transaction in every database, run all my scripts, and then commit/rollback once everything is good. However, I can't run all my scripts since cross-database dependencies are blocking indefinitely. |
SQL Server 2012 High Availability on VMware virtualization Posted: 16 Aug 2013 02:15 PM PDT We're going to host a large SQL Server 2012 under a VMware virtualization and we need it to be highly available. These are the three options I found supported, but couldn't find a lot of info and comparison on who's better and why (and mostly - what's the disadvantages):
That's pretty much it. I would appreciate any info you may have about this, and would appreciate even more recommendations (hopefully based on test cases). ~Thanks. |
Which databases can have row and column level security based upon Active Directory? Posted: 16 Aug 2013 01:27 PM PDT I have various database types, Oracle 11g, MySQL 5, Sql Server 2012. I have direct access. I can have other databases if I need them such as PostgreSQL. What I'm doing is protecting data at the database and table level as opposed to the application level though I there will be some mixing. What I'm hoping to do is control all the security from Active Directory. I don't want to do security in MySQL, security in Oracle, etc. That is a lot of duplicate entry. I will have a webpage send credentials to the database engine to determine which bits of data the user can see. Thanks for ideas. |
After subscribing to a replication set, why can't I see the replicated tables on the local database? Posted: 16 Aug 2013 12:16 PM PDT I'm pretty new to databases in general (about two weeks), but I'm learning fast. If I'm using the wrong terminology anywhere, let me know in the comments. Bear with me. :) BackgroundThe company I work for is using PostgreSQL 9.1 (with pgAdmin III) to manage their data. The scenario is this. Say we have a master database M. Only M will be receiving direct submissions of data. However, on a regular basis (or even a push-notification basis?), another database, T, needs to pull the data from M such that specific tables of M are replicated in T. As far as this problem is concerned, this is one-way communication. The (slight) catch: T is not read-only. Changes in T still need to be persistent to T and T only. So, this problem is not strictly replication, but I believed it was a start. (In my mind, T could replicate M but not push its own changes to M, thus preserving integrity.) If there is a better way to go about this, please don't hesitate to comment some links or keywords. :) Problem StatementI need to set up Master-Slave replication of a subset of tables in the Master database. That is, specific tables from the master must always be pushed onto the slave, but the slave is free to make its own local changes. I am using pgAdmin III with Slony-I. On the master, I've set up a Slony cluster and added my admin node, my master node, and my slave node. I believe I correctly made paths and listens for open communication between the master and the slave. I'll post their configuration as screenshots at the end. I've created a table in the I created a new replication set and created a new replicated table, At this point, after refreshing, I do not see the replication set show up on the pgAdmin instance on the slave node. This is odd because the nodes themselves do show up. If I connect to the master database 'normally,' the set (and table) show up, obviously. From the requirements though, I don't believe I'll be able to connect directly to the master database. Thinking 'Oh, it's because I'm not subscribed,' I went on to create the subscription. I was only able to create it on the Master database though. Even after creation, I was left depressingly data-less. Is there an extra step I'm missing? I'm hardly CLI averse, but pgAdmin/Slony was advertised to the development team as completely workable through the GUI. I'm getting the feeling it's not, but I cannot find any documentation that makes it clear where pgAdmin stops and the terminal begins. What is left to be done? Master: Slave: |
Ghost Cleanup process has high CPU usage in SQL Server 2012 SP1 Posted: 16 Aug 2013 11:21 AM PDT Has anyone encountered this? We are using SQL Server 2012 Enterprise Edition with SP1. During a time of low/no activity, I noticed the Ghost Cleanup process is utilizing CPU at a very high rate, from 75% to 99%, these aren't bursts but sustained usage. Is this a bug with SQL 2012? I have seen this in SQL 2008 R2 and there was a fix for it but I haven't seen anything for 2012. |
ERROR: text search configuration name "english" must be schema-qualified Posted: 16 Aug 2013 11:06 AM PDT Trying to do some full text searching with postgres and when running the following command I'm getting the error: Is there something I'm missing? I've also tried Edit 1: Table EMAIL has the column "TEXT" in it. They are both in all caps FWIW |
MySQL - unique constraints design Posted: 16 Aug 2013 03:27 PM PDT I am using MySQL and looking to solve a problem with relational data. I am not sure it is possible but wanted to ask the community. Please consider the diagram: I would like to add a unique constraint such that only one
I am sure this problem has come up before with other database designs and would like know what the best approach may be. Also here is a link to sql fiddle to play around schema and some sample data. |
multiple line text values in mysqldump text export file Posted: 16 Aug 2013 10:19 AM PDT I'm trying to export +100mil record table into txt file. My plan is split up txt file to small pieces by size or line then import. I have one text field has multiple line like blog post text, in txt export file it exported as multiple lines which I want it to be 1 line 1 row so I can process it by lines. I tried various fields-terminated-by, lines-terminated-by, fields-escaped-by parameters for export but nothing made that multiple line text into single, quoted and comma separated line. It does quote well when I export the data in sql format but I haven't succeeded to convert new line characters in the text field to \n\r or \n whatever those characters are. Even if I escape it, still exported as new line with the quote. |
Relations, dependencies and normal form Posted: 16 Aug 2013 02:54 PM PDT I have some issues in understanding about relations and dependencies. I will show two examples and what I want to know: Assume the relation or this one: Relation
I have never been able to understand this fully and always got confused by the tutorials I found. I appreciate all answers! |
MySQL: ERROR 126 (HY000): Incorrect key file for table Posted: 16 Aug 2013 09:46 AM PDT I've got '/tmp' directory mounted with 'tmpfs' and for some reason this is causing the following error: - Please note that the same query works fine when '/tmp' dir is mounted with ext4 file system. Regards |
MySQL Access Denied, tried a few things, pulling hair Posted: 16 Aug 2013 02:21 PM PDT I'm trying to get to know Django (my first attempts at a framework, or any backend work for that matter), and I'm seriously stumped by MySQL, and SQL in general. I'm trying to create a new database and I get: So I've tried the advice here: Access denied for user localhost Which might work, but using: Also, I have to run mysql using: Because: results in: I'm guessing that's related to the error above, right? I'm in a right mess here, SQL and the command line intimidate the heck out of me and it seems so easy to break stuff. If anyone could offer some pointers that would be great. EDIT: Update on the issue; Ugh, moved on to the next step of the Django tut. I get: raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb So I run: pip install MySQL-python and I get: /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10: fatal error: 'stdio.h' file not found isn't stdio.h something to do with C? I'm clearly not cut out for this back end stuff. I'm going back to JavaScript where it's all fluffy and forgiving! |
Setting up SQL Server service broker from one database to multiple databases Posted: 16 Aug 2013 09:55 AM PDT I would like to set a SQL broker service whereby DatabaseA sends the same data to DatabaseB and DatabaseC. In this case, all databases reside on the same instance. I have looked at the following examples, however, they only show me how to setup a SQL broker service between two databases:
I would be grateful if anyone could provide any assistance on this. |
Why does my SQL Server show more than half a million active tasks? Posted: 16 Aug 2013 06:21 PM PDT I ran the above statement on a SQL Server instance, and found it had about 633,000 records. How can I Close/Kill the useless tasks? The MDW data collector have about 4000 page allocate in tempdb per time. And this cause the IO pressure when server in busy time. This is production server, We do not want to restart the service. And the version number is 11.0.3000. Scheduler_Id is 0 - 47 and the amount of rows are average. and other columns are null. |
What's stored in data_dir/base of postgresql Posted: 16 Aug 2013 06:48 PM PDT I suddenly found found my postgresql out of space. It's a tmp instance running on ram disk. Limited space (around 800M) allowed. Data are not actually stored on it, all table will be dropped after some calculation done. I checked the folder and found tons of data under base folder: $ du -h 6.0M ./pgsql_tmp 706M ./16384 6.0M ./12780 6.0M ./12772 6.0M ./1 730M . My question is: what is inside that folder? Any change I can clean it out? |
View with fallback (performance/optimization question) Posted: 16 Aug 2013 03:57 PM PDT I have a table with tariffs for stuff; the tariffs table is not important in this scenario, the "tariff values" are. In this Demonstration SQL Fiddle the I have, for example, a default tariffplan (key = If have tariffs defined for items So, what I do is I select the This results, as expected, in: Because I want to abstract this away I want to put this into a table valued function so I can create a "dynamic view": This should result in a "virtual table" (or "dynamic view") similar to the This results in: All I need to do now is stuff this query into a TVF: And there we have it. We can call our function ("dynamic view") as intended (and also use it in selects/joins etc.) Now my first question is: I have a feeling all these So I'm hoping someone here has some ideas on how to improve this. My second question is: What if I had a product (tariff_type (Demonstrated in this SQL fiddle) In the above example I use another |
Altering the location of Oracle-Suggested Backup Posted: 16 Aug 2013 02:05 PM PDT On one database, the Oracle-Suggested Backup scheduled from Enterprise Manager always ends up in the recovery area, despite RMAN configuration showing that device type disk format points elsewhere. As far as I can see, the scheduled backup job is simply: Asking RMAN to If I run the script manually, the backupset is placed at the above location, when the script is run from the job scheduler the backupset goes to the RECO group on ASM, Why might Oracle still choose to dump the backupset to the Ultimately, how can I change the backup destination? |
Database restructure - beneficial? Posted: 16 Aug 2013 09:06 PM PDT I have a table for email messages. Then, I have a table that has the The At the time I used Parts to name the table and yet used field_id for the column. Just an FYI So for example, a My question is, will it be in my best interests to restructure the database? Id rather not. I was thinking about moving the Thanks |
Posted: 16 Aug 2013 04:06 PM PDT We are having a shared hosting plan and they are saying that do provide MYSQL Timezone support in a shared hosting plan. I can create timezone related tables in our database and populate them with required data(data from from our local MYSQL Timezone related tables. How to view the code syntax for MySQL "CONVERT_TZ" function? Thanks Arun |
replication breaks after upgrading master Posted: 16 Aug 2013 12:05 PM PDT I have a set up of replication with master 5.1.30 and slave 5.5.16 and the replication is working good Now i have upgraded mysql master to 5.1.47 As far as i know we have to turn off the log bin with sql_log_bin=0 before using mysql_upgrade program in order to up grade the replication setup as well but the problem here is the binary log was not turned off while mysql_upgrade program is running The reason i found is in 5.1 the sql_log_bin is a session variable and mysql_upgrade program runs in another session so how to upgrade the replication as well along with the server with any breakage on replication setup. any suggestions are really useful..... |
Need to suppress rowcount headers when using \G Posted: 16 Aug 2013 01:05 PM 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 to search whole MySQL database for a particular string Posted: 16 Aug 2013 05:06 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: 16 Aug 2013 03:05 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: 16 Aug 2013 06:06 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 |
MYSQL 5.5 Fail start Fedora 16 Posted: 16 Aug 2013 10:05 AM PDT I installed mysql and mysql-server from the repos (MySQL version 5.5). Then tried to start it, but got an error. Here is the log: Fresh installation, nothing changed prior to that, just ran yum update. Here is the systemctl status trace |
Sql Anywhere 11: Restoring incremental backup failure Posted: 16 Aug 2013 11:05 AM PDT We want to create remote incremental backups after a full backup. This will allow us to restore in the event of a failure and bring up another machine with as close to real time backups as possible with SQL Anywhere network servers. We are doing a full backup as follows: This makes a backup of the database and log files and can be restored as expected. For incremental backups I've tried both live and incremental transaction logs with a renaming scheme if there are multiple incremental backups: However, on applying the transaction logs on restore I always receive an error when applying the transaction logs to the database:
The transaction log restore command is: The error doesn't specify what table it can't find but this is a controlled test and no tables are being created or dropped. I insert a few rows then kick off an incremental backup before attempting to restore. Does anyone know the correct way to do incremental backup and restore on Sql Anywhere 11? UPDATE: Thinking it may be related to the complexity of the target database I made a new blank database and network service. Then added one table with two columns and inserted a few rows. Made a full backup, then inserted and deleted a few more rows and committed transactions, then made an incremental backup. This also failed with the same error when attempting to apply the incremental backups of transaction logs after restoring the full backup ... Edit: You can follow this link to see the same question with slightly more feedback on SA: http://sqlanywhere-forum.sybase.com/questions/4760/restoring-incrementallive-backup-failure |
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