[how to] Special syntax sth.name() in the CREATE FUNCTION statement, what does it mean? |
- Special syntax sth.name() in the CREATE FUNCTION statement, what does it mean?
- Linux 32b MySQL periodically crashing with signal 11 and OOM errors
- Correct use of VOLATILE COST (and ROWS) indications in Postgresql stored procedure
- PostgreSQL CREATE EXTENSION file not found error on Mac OS
- Unable to run union in parallel on SQL Server
- Generate script to automate renaming of default constraints
- Limit connection rights on SQL Server
- php cannot talk to mysql from apache [closed]
- SELECT every second row without auto_increment
- Modeling a ticket system based on a set of disparate kinds of tickets?
- Can the OUTPUT clause create a table?
- Why can't we write ddl statement directly into the PL/SQL block
- sql replication conflicts after migration from 2000 to 2008
- Materialized view log not updating
- SQL Server Sandbox
- Backup Access Database Daily/Weekly
- PostgreSQL EXCLUDE USING error: Data type integer has no default operator class
- sql replication conflicts after migration from 2000 to 2008
- IntelliSense alternative using SSMS 2012 in a contained database as a contained user?
- Does the SQL Server Backup Database Command also backup views from a Database?
- postgres backup / restore: restored database much smaller?
- Primary Key efficiency
- SQL Server split mdf into multiple files
- Even when user has 'bulkadmin' role, query says user does not have role - SQL Server 2012
- Table Size Analysis on SQL Server 2000
- MySQL General log not working on Mac OS X
- Handling growing number of Tenants in Multi-tenant Database Architecture
- MySQL Replication Troubleshooting
- SQL Server 2008 - Cross database performance on same physical machine and server instance
Special syntax sth.name() in the CREATE FUNCTION statement, what does it mean? Posted: 22 Mar 2013 08:26 PM PDT In this SO question about stored procedures in For example: Looking in this book in the "Part IV: Programming with PostgreSQL" I have found no mention of this type of creation declaration with a function name in two parts. In the postgresql documentation, at the create function section, the only similar thing is when they deal about So, what is this syntax related to ? |
Linux 32b MySQL periodically crashing with signal 11 and OOM errors Posted: 22 Mar 2013 08:33 PM PDT I have a MySQL DB with mostly InnoDB tables that I'm fairly certain isn't tuned properly based on what's happening, but I don't have enough know how to pinpoint what to change. The server is a 8G 32b Linux system with the following in my.cnf: Currently, here are the non-zero global status stats: And finally, Does anything pop out that is clearly mis-configured? |
Correct use of VOLATILE COST (and ROWS) indications in Postgresql stored procedure Posted: 22 Mar 2013 08:21 PM PDT While looking at several examples of ie: Searching for more information about As I have understood, this indication helps the query plan optimizer to decide how to set priorities in short-circuit boolean operations. Is it premature optimization if I start to give an estimate I know about the command |
PostgreSQL CREATE EXTENSION file not found error on Mac OS Posted: 22 Mar 2013 08:02 PM PDT On PostgreSQL 9.2.3 when trying this: I get this error:
Running |
Unable to run union in parallel on SQL Server Posted: 22 Mar 2013 03:40 PM PDT I am unable to get this fairly simple query to parallelize the union operation: Running with MAXDOP 1 gives an expected .8s (.5 + .3). I was hoping that increasing MAXDOP to 2 would optimize for the biggest gain by using one processor for each side but that is not the case. Maxdop zero on a lightly loaded 12 Cpu machine all ~4% only results in parallel execution about 10% of the time. Is there a way to weight the hints so that parallelization at the union point is the most important? Does the syntax support separate MAXDOP's for each side? I have tried (concat/hash/merge union) with little change. Match values is usually a small table (~10 rows). |
Generate script to automate renaming of default constraints Posted: 22 Mar 2013 03:03 PM PDT Background: Some of our default column constraints were generated without explicit names, so we get fun names that vary from server to server like: I would prefer to have them all manageable with a consistent naming like I've got a script that mostly works for what I want: But this just gives me a resultset, and not something I can actually pass into an exec or whatever. How can I make this so I can just execute those |
Limit connection rights on SQL Server Posted: 22 Mar 2013 01:55 PM PDT I have an app to deploy in production that uses 'honor system' security. That is, all users connect to the DB using a SQL user/passwd credential and the app manages permissions itself. The latter part doesn't bother me as much as the fact that the connection object contains embedded credentials and can be copied around freely. I'm try to find some way to limit connections to a more limited set of clients. I can create firewall rules to limit by IP, of course. Is there any way to 'prequalify' SQL logins either by Machine account or domain membership? |
php cannot talk to mysql from apache [closed] Posted: 22 Mar 2013 12:46 PM PDT I have loaded a new centos system that I have installed php 5.4.13, apache 2.2.24. and mysql 5.6.10. I get an error from mysqli_connect() that it cannot connect. However, a 500 error is given. However, I can connect from the same program run from the command line without error. |
SELECT every second row without auto_increment Posted: 22 Mar 2013 02:17 PM PDT How can I select every second row in MySQL, without using any data of the table or some auto_increment? Thank you! |
Modeling a ticket system based on a set of disparate kinds of tickets? Posted: 22 Mar 2013 11:42 AM PDT I'm working on a project that allows for the creation of "support tickets." These are not confined to something that needs fixing, however, so in a way they could more accurately be called "jobs." For the frontend of the project, the tickets are to be created out of predefined "templates." I've listed three examples below:
Of course, each kind of ticket would share common attributes like the name of the ticket (a short summary of the issue/assignment), the issuer's user_id, the deadline, whether or not it has been resolved, etc. I am trying to model this system relationally, but I am not sure if it's appropriate. The biggest struggle I'm having is how I can model and relate the different "kinds" of tickets. This seems perfect for some kind of inheritance, but should this be stored in a relational database? It has felt natural to try some sort of EAV model, but I've heard that this should be avoided like the plague (I don't know whether or not this is an accurate evaluation). Here is a diagram of my current attempt: I've included the rest of the relations in the image for context. The accompanying (generic) SQL code as generated by SQLEditor: So the idea was to store all of the possible attributes in One of the reasons I felt like it would be necessary to include the concept of a template is for privileges: only certain users can see certain templates. For instance, only I would appreciate any advice regarding my naive attempt and whether or not the relational model is a good fit for this project. Is a document store more appropriate? |
Can the OUTPUT clause create a table? Posted: 22 Mar 2013 11:49 AM PDT I'm doing an update like this: And I want to use the OUTPUT clause to back up my changes. What I want to know is if there is a way for the OUTPUT clause to create the table OutputTable or do I have to make sure it already exists before running the statement? |
Why can't we write ddl statement directly into the PL/SQL block Posted: 22 Mar 2013 01:51 PM PDT Why can't we write ddl statements directly in PL/SQL block, for example when i write But, Why second one executed successfully ? |
sql replication conflicts after migration from 2000 to 2008 Posted: 22 Mar 2013 10:32 AM PDT I got a suggestion over at Stackoverflow to post here....greatful for any and all help. Please bear with me I think this might take a while to explain. For many years now my company has hosted a solution for a client involving a complex web application with smaller mobile solution consisting of IIS 6 for the web app, SQL 2000 on its own server and Visual Studio 2005 Pocket PC app replicating with SQL via Merge Replication. This whole time the mobile solution has been very solid and did not require many updates so we have replicated with sscesa20.dll the entire time. We recently migrated this entire solution as follow:
The new web box received the 64 bit version of SQL Server Compact 3.5 tools and we now call sqlcesa35.dll from the mobile device to perform merge replication. The basic idea of the entire process is that mobile field users get assigned safety inspections to perform on buildings. When a facility in the system needs an inspection an inspection record is created via the web app in the DB. A status flag is set such that the HOST_NAME() is utilized to make sure only records for a given inspector with this particular status will let them show up on their mobile device. The user can synch multiple times in the field sending their data up to the SQL Server/web app and receive more inspections down or other updates such as look up table data...typical merge replication here and has been working great for years. Once the field user changes the status of the inspection, it will travel from mobile device to SQL DB and be removed from their iPaq. The inspection has additional work flow on the web app from here on out. Now on to the problem. We migrated everything Publishing the exact same subset of tables with the same joins/filters. Same settings on the publication as far as I can tell are the same. However; when a user gets a new inspection down to the hand held for the very first time, enters data, then synchronizes back to the DB every record has a conflict. Since we have default conflict resolution the publisher wins and the data collected in the field it lost. The inspection now looks blank just as it did when it first came down to the mobile device. If the user synchs again with or without changes on the mobile (subscriber) all is well. Any future changes from the mobile device are intact. It is as if the web/db data is newer then the hand held data. I am 100% sure it is not. I have looked at table triggers, web app logic, etc. We were very careful not to include any application changes to DB/web app/mobile app with respect to data manipulation during this migration. Here is a summary of the order of operation: New record created in the DB>>Mobile user receives data>>mobile user updates data>>synchronizes - Data is lost. Conflicts show up for all data lost. From here on out any additional mobile changes are captured. Merge replication works in both directions flawlessly. Thanks for taking the time to read please help. I am stuck after 3 days. |
Materialized view log not updating Posted: 22 Mar 2013 12:26 PM PDT Under what conditions would a materialized view log not update? I must be missing something. I've got a 10gR2 database. I can create the following MV logs: Then if I do an insert: I see my insert in the MV Log: Not really sure what to make of the 1/1/4000 snaptime. As soon as I create a materialized view: The materialized view log on LINKED_T1 is emptied, and will no longer track any DML! Why is that? I have not made any changes to T1 for this test. I should mention that this MV was suggested by DBMS_ADVISOR.TUNE_MVIEW. |
Posted: 22 Mar 2013 02:34 PM PDT I'm attempting to set up a sandbox for our report developers to their work in. My current plan is to "reset" the database every evening but I'm not sure how to go about doing so. What I mean by reset is that I want to essentially drop any user tables, views, stored procedures, etc from all but one database on the server. I suppose another option would be to drop and recreate the database as well but I'm pretty sure that'd mean regranting access to all of the appropriate AD groups/people too. I really don't know what would be the best way to go about doing this so I'm hoping some of you will be able to provide some good ideas/suggestions. Thanks. For clarity, we essentially want to do this with our database: http://try.discourse.org/t/this-site-is-a-sandbox-it-is-reset-every-day/57. Only difference being is that we don't want to recreate our users every day. Version: SQL Server 2008 |
Backup Access Database Daily/Weekly Posted: 22 Mar 2013 08:36 PM PDT We have a Microsoft Access database split into backend/frontend. What I am looking for is to be able to automatically backup these files on a daily or weekly basis - what is the best way to go about this? We don't want to have to worry about backups for the database, just know that it is occuring automatically on a schedule. Thanks. |
PostgreSQL EXCLUDE USING error: Data type integer has no default operator class Posted: 22 Mar 2013 07:48 PM PDT In PostgreSQL 9.2.3 I am trying to create this simplified table: But I get this error: The PostgreSQL docs use these this example, which does not work for me (http://www.postgresql.org/docs/9.2/static/rangetypes.html): And this one, which does not work for me either (http://www.postgresql.org/docs/9.2/static/btree-gist.html): I am able to create this able without any problem: and this: I've spent quite a bit of time searching for hints about figuring out how to make this work, or figuring out why it won't work. Any ideas? |
sql replication conflicts after migration from 2000 to 2008 Posted: 22 Mar 2013 02:12 PM PDT Please bear with me I think this might take a while to explain. For many years now my company has hosted a solution for a client involving a complex web application with smaller mobile solution consisting of IIS 6 for the web app, SQL 2000 on its own server and Visual Studio 2005 Pocket PC app replicating with SQL via Merge Replication. This whole time the mobile solution has been very solid and did not require many updates so we have replicated with sscesa20.dll the entire time. We recently migrated this entire solution as follow:
The new web box received the 64 bit version of SQL Server Compact 3.5 tools and we now call sqlcesa35.dll from the mobile device to perform merge replication. The basic idea of the entire process is that mobile field users get assigned safety inspections to perform on buildings. When a facility in the system needs an inspection an inspection record is created via the web app in the DB. A status flag is set such that the HOST_NAME() is utilized to make sure only records for a given inspector with this particular status will let them show up on their mobile device. The user can synch multiple times in the field sending their data up to the SQL Server/web app and receive more inspections down or other updates such as look up table data...typical merge replication here and has been working great for years. Once the field user changes the status of the inspection, it will travel from mobile device to SQL DB and be removed from their iPaq. The inspection has additional work flow on the web app from here on out. Now on to the problem. We migrated everything Publishing the exact same subset of tables with the same joins/filters. Same settings on the publication as far as I can tell are the same. However; when a user gets a new inspection down to the hand held for the very first time, enters data, then synchronizes back to the DB every record has a conflict. Since we have default conflict resolution the publisher wins and the data collected in the field it lost. The inspection now looks blank just as it did when it first came down to the mobile device. If the user synchs again with or without changes on the mobile (subscriber) all is well. Any future changes from the mobile device are intact. It is as if the web/db data is newer then the hand held data. I am 100% sure it is not. I have looked at table triggers, web app logic, etc. We were very careful not to include any application changes to DB/web app/mobile app with respect to data manipulation during this migration. Here is a summary of the order of operation: New record created in the DB>>Mobile user receives data>>mobile user updates data>>synchronizes - Data is lost. Conflicts show up for all data lost. From here on out any additional mobile changes are captured. Merge replication works in both directions flawlessly. Thanks for taking the time to read please help. I am stuck after 3 days. |
IntelliSense alternative using SSMS 2012 in a contained database as a contained user? Posted: 22 Mar 2013 11:59 AM PDT According to this answer about contained database disadvantages:
So is there any way to get IntelliSense-style functionality? Can anyone vouch for a product that will work in this scenario? |
Does the SQL Server Backup Database Command also backup views from a Database? Posted: 22 Mar 2013 11:28 AM PDT I have a backup job (SQL Server Agent job) which will iterate through all of our SQL Server databases in SSMS, invoke the EDIT: The server running the The jobs report success in the SQL Agent job history so I'm wondering whether or not these jobs should also backup and restore the Views in the databases (as they haven't seemed to) or if this is an indication that the scripts aren't quite working? |
postgres backup / restore: restored database much smaller? Posted: 22 Mar 2013 09:02 PM PDT I am worried that my restored database is very different from the original: The original db is many times larger than the restored one. What is going on here? As far as i can tell, the website that test_db serves is still working perfectly well, after a restore, but i need to know what's up before i use a backup in live context. FYI if i run vacuumdb on each database there seems to be no change in database size. [Addendum, added later] in the tradition of RTFM I have gone hunting in the manual for PostrgeSQL. Here are some more pieces to the puzzle Gratefully following up on @craig-ringer's advice to look into I will follow @chris-travers advice and map out the number of rows in tables from each version of the database. I think in my case it'd be fair to say that VACUUM FULL will relieve the pressure on disk space, and it'll make original_vs_restored look better but there's still this red flag of excessive bloat. I think autovacuum isn't doing anything and that's a worry! Thx for the guidance so far, it's fascinating. |
Posted: 22 Mar 2013 02:55 PM PDT If I need a table to hold Point of Sales transactions, and am told I need to store: Now, in this case, the uniqueness would be: Country ID, Store Number, POS Terminal Number, Transaction Date, Item Code I am always unsure if it's best to have a identity colmn as the primary key - in this case, maybe Or, should a primary key be created across all the unique fields? The benefit of the |
SQL Server split mdf into multiple files Posted: 22 Mar 2013 02:05 PM PDT I have a database called I have another database file on the same SQL Server that has the same issue. Why does this happen? Does this affect the performance? How can I prevent or stop SQL Server from splitting my |
Even when user has 'bulkadmin' role, query says user does not have role - SQL Server 2012 Posted: 22 Mar 2013 11:02 AM PDT I am facing a weird issue with SQL Server 2012. I have a user (say Now when i run this query
output is 0. But when i execute this query
I can see Can someone please help me understand how is the output differing or is it BUG in SQL Server 2012? (Can't be a BUG as same query with different user works fine) |
Table Size Analysis on SQL Server 2000 Posted: 22 Mar 2013 05:02 PM PDT Our SQL Server 2000 database The results were as follows:
|
MySQL General log not working on Mac OS X Posted: 22 Mar 2013 12:47 PM PDT I want to log all queries to the database running on my MacBook Pro (Mac OS X 10.8.1). I created a file I restarted MySQL and tried some queries on the mysql command line, but nothing gets logged. The file is not getting created. I also created the file myself afterwards to test with When I check, MySQL did read my settings: Is there anything else I need to do? I suppose any query I type on the command line should get logged, right? I am using MySQL 5.5.24 |
Handling growing number of Tenants in Multi-tenant Database Architecture Posted: 22 Mar 2013 07:34 PM PDT Handling a modest number of customers (tenants) in a common server with separate databases for each tenant's instance of the application is relatively straightforward and is normally the correct way to do this. Currently I am looking at the architecture for an application where each tenant has their own database instance. However, the problem is that this application will have a large number of tenants (5,000-10,000) with a substantial number of users, perhaps 2,000 for a single tenant. We will need to support growing the system by several tenants every week. In addition, all tenants and their users will be presented with a common login process (i.e. each tenant cannot have their own URL). To do this, I need a centralised login process and a means to dynamically add databases to the system and register users.
|
MySQL Replication Troubleshooting Posted: 22 Mar 2013 03:23 PM PDT Here's what I did. On the master, change Save and restart mysql, then log in. On the slave, change Save and restart mysql. Create a database on the slave (Snapshop master). Move data from master to slave. On the master: On the slave: My problem is: I forget answer command belows. when I start the slave. The error is What does the error mean, and how can I solve it? |
SQL Server 2008 - Cross database performance on same physical machine and server instance Posted: 22 Mar 2013 12:38 PM PDT Is there any performance hit when doing a select across another DB on the same physical machine? So I have 2 databases on the same physical machine running within the same SQL 2008 instance. For instance in SomStoreProc on_this_db I run SELECT someFields FROM the_other_db.dbo.someTable So far from what I have read on the internet, most people seem to indicate NO. |
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