[how to] How to know the user doing a delete action on an audit table, when using a shared login? |
- How to know the user doing a delete action on an audit table, when using a shared login?
- How to store column values on index in PostgreSQL?
- what server role that needs to be configured for the user to enable sql server agent
- Parsing the value and copying it to another column in postgresql
- Percona MySQL 5.5.33 not reading my.cnf?
- How does one query a SQL Server Linked Server when SQL Server Authentication is specified?
- Why does MySQL force the tradeoff between swallowing errors and leaking commits in transactions?
- Booted by MYSQL Error (2003) 10060 mid way through work
- Repository Creation Utility for Oracle Database 12c
- Understanding two NICs requirement for SQL fail over cluster
- Select the latest changed row in a table
- How to design DB for statistics service?
- SQL Server : openrowset problem
- SQL Server 2012 x64 - cannot safely allocate more than 50% RAM
- After RAM upgrade on 32-bit Oracle server, ORA-04031: unable to allocate x bytes of shared memory
- SQL Server 2005 - Query optimization for fetching large number of rows from table with 750 million rows
- Choose security group for restore-db-instance-to-point-in-time
- Sqlcmd command strips $ out of query variable
- Looking for help on a database-design to model a availability problem [closed]
- Tips on improving/refactoring slow query?
- SQL Server Designers, Failed Saves, and Generated Scripts
- The InnoDB log sequence number is in the future
- how to verify mysql backup file
- After 5 years of working, SQL Server 2k5 Table now locking without any changes made to DB
- Hierarchical Structure
- Why does that query cause lock wait timeouts?
- SQL Server 2005 not collecting logins in the log file
- Cast to date is sargable but is it a good idea?
- SQL Server 2008 R2 corrupted after changing MAXDOP
- Applying user-defined fields to arbitrary entities
How to know the user doing a delete action on an audit table, when using a shared login? Posted: 17 Sep 2013 07:58 PM PDT Background information:
The problem I ran into is that when a user deletes a record, I want to know who did it. Because it will done by the same login, I don't want to see that all action were done by service, I want to see which user did it. This isn't an issue on an update, because we have The question is: Is there a way to set the The "best" idea I have right now, though I'm not sure if it is a good idea yet, is that in the service I check to see if the current |
How to store column values on index in PostgreSQL? Posted: 17 Sep 2013 06:05 PM PDT As described here: https://devcenter.heroku.com/articles/postgresql-indexes#managing-and-maintaining-indexes indexes not store the entire row data on themselves. Is it possible to store the row with the index to fast retrieve? I don't care about space. (please, a good soul, edit and rewrite it in native English and remove this message? thanks!) |
what server role that needs to be configured for the user to enable sql server agent Posted: 17 Sep 2013 03:13 PM PDT I'm on SQL SERVER 2008, I want to enable the SQL Agent for a particular user, who has only read access to the database. I don't want to give sysadmin role? Is there any way, I can do this? |
Parsing the value and copying it to another column in postgresql Posted: 17 Sep 2013 02:45 PM PDT Column_1(varchar) has values with the format like 1024 MB , 2048 MB etc. There also exits Column_2(int). Now i would like to parse the value in column_1 and update the column_2 with values like 1024, 2048 . I am using postgressql. how do i do this ? I am fairly new to databases. Any help/suggestion s appreciated. |
Percona MySQL 5.5.33 not reading my.cnf? Posted: 17 Sep 2013 01:50 PM PDT At some point Percona MySQL on CentOS 6.4 seems to have stopped reading my.cnf, possibly after MySQL updated to 5.5.33 a few days ago. Selection from /etc/my.cnf: Some output from 'mysqld --help --verbose' Ok that seems good, matches my config. How about logging into mysql and doing some SHOW VARIABLES: Huh, well that ain't right. Slow log is off, error log has the wrong name, connection and heap sizes are wrong, and the server collation is wrong as well. Processes running I see the error log listed in the process has the wrong name right off the bat. I've tried manually restarting mysql from /etc/init.d, via 'service mysql restart', via restarting the entire server. Nothing seems to get MySQL to read the conf. Maybe something is breaking when mysqld_safe spins up a mysql instance? No problems reported in the error log when the server starts. Any ideas? |
How does one query a SQL Server Linked Server when SQL Server Authentication is specified? Posted: 17 Sep 2013 01:54 PM PDT I have established a linked server and am attempting to query a database to which I have a SQL Server username and password, however I can't find the syntax for specifying the userid/pw in the query and get the following error: Msg 18452, Level 14, State 1, Line 1 Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. I know from http://msdn.microsoft.com/en-us/library/ms175537(v=sql.105).aspx that windows authentication is preferred, but it is a vendor database and not up to me. Also from that link: "you must set up a local login mapping from a login that uses Windows Authentication to a specific login on the linked server that is not a Windows authenticated login. In this case, the remote login uses SQL Server Authentication if the linked server is an instance of SQL Server." |
Why does MySQL force the tradeoff between swallowing errors and leaking commits in transactions? Posted: 17 Sep 2013 01:50 PM PDT Referring specifically to the choice of whether to use What gives? This sounds... awful. |
Booted by MYSQL Error (2003) 10060 mid way through work Posted: 17 Sep 2013 12:28 PM PDT I was working on some querries and then my HeidiSQL froze, I tried to reboot the connection and I get good old MYSQL Error (2003) (10060). It worked just fine before that. I havent made any firewall changes, and I checked the "white list" of IPs on AWS it still was ine. I encountered this error code before but never during work with no changes. Thoughts? Edit 1I turned OFF firewall and still same error Edit 2It works all of a sudden, but I would like to know why such thing happened. Connection issues? |
Repository Creation Utility for Oracle Database 12c Posted: 17 Sep 2013 02:25 PM PDT I need the Repository Creation Utility for the Oracle Database 12c. I understand that since 12c the RCU is part of the Oracle Fusion Middleware Infrastructure Software. This brings me to the question: Where can I download the Oracle Fusion Middleware Infrastructure Software? (and yes, I really just need the link to the site where I can download it. And no, Google wasn't much of a help in the kafkaesque structure, the Oracle website/documentation is.) |
Understanding two NICs requirement for SQL fail over cluster Posted: 17 Sep 2013 11:27 AM PDT I am trying to make an SQL Server 2013 fail over cluster. I have two DB machines. I understand that both machines need 2 NICs each. In my organization the IP scheme assigned is something like 192.168.1.X So I want to know if I assign 1 IP to each NIC, will that be enough? Like assigning 192.168.1.50, 192.168.1.51, 192.168.1.52 and 192.168.1.53? Or two of the NICs in each machine have to have some private network scheme which will allow them to communicate directly? |
Select the latest changed row in a table Posted: 17 Sep 2013 04:20 PM PDT I have a Mysql table some names have multiple changedates. I can select all rows with How can I select only the newest rows of that table for each name? |
How to design DB for statistics service? Posted: 17 Sep 2013 01:42 PM PDT I'm going to create statistics on RoR. I have 3 models: User, Project and Channel. User owns Projects, whereas Projects have many Channels. Now I'm designing all these models using MySQL. The goal of the service is to provide user the variation in time of different parameters of each Channel. E.g.: Channel Google Adwords has 1000 show/day, 100 clicks/day and 2 people which came from Google Adwords bought something that day. So I could have just stored all the information in columns, like: Channel "Google Adwords", shows: 1000, clicks: 100, buyings: 2. But I need to make distribution by days, please, give me an advice how to design such database? Maybe I should use another solution, maybe NoSQL? Upd. Input: User daily fills in data about ads from different sources (I call them channels, e.g.: Google Adwords): number of impressions and clicks (later data will be imported automatically usiing API). Output: Various stats like graphs and CTR of different channels, all channels and so on. |
SQL Server : openrowset problem Posted: 17 Sep 2013 12:18 PM PDT I'm looking for a solution to use I know that I'm looking for something like |
SQL Server 2012 x64 - cannot safely allocate more than 50% RAM Posted: 17 Sep 2013 02:37 PM PDT We're running SQL Server 2012 (CU4) on a 64-bit 12-core, 2 socket server using NUMA architecture server. OS is Windows Server 2008 R2 x64. Whenever we allocate more than 50% of the physical RAM to SQL server, the machine becomes unstable or unresponsive. The symptoms are typical of OS memory starvation - i.e. process fail to start, GUI object fail to render, applications misbehave, remote desktop sessions become unresponsive, etc. We've seen this on 2 different machines – one with 198GB RAM, the other with 256GB RAM… as soon as SQL is given more than 50% of the respective physical total, the symptoms appear. Has anyone else seen this behavior? |
After RAM upgrade on 32-bit Oracle server, ORA-04031: unable to allocate x bytes of shared memory Posted: 17 Sep 2013 03:06 PM PDT We are in the process of upgrading our Oracle database server at work, from SUSE Linux Enterprise Server 10.4 / Oracle 10g / 4GB RAM (Intel 32-bit) to Scientific Linux 6.4 / Oracle 12c / 8GB RAM (Intel 64-bit). As the first step, the additional RAM has been installed, but due to some application-related issue we had to pend the rest of the planned upgrade. To clarify, the server is still running Oracle 10g and SLES 10.4. No change has been made on the software side Since the installation of the additional RAM, however, the only database instance on that machine has been running out of shared memory (with the error in the title) two afternoons in a row. The depletion was severe enough that the only way to recover was using No configuration change has been made, e.g. to the memory settings of the database: It seems that the extra RAM actually cause the Oracle database software to have less RAM available to itself than before, but how exactly is this happening? |
Posted: 17 Sep 2013 04:40 PM PDT Brief on application: This is audio fingerprinting application, being developed in Java with Microsoft SQL Server 2005 database. I have one application to create fingerprints of original songs and put these fingerprints in database. To store fingerprint in database I have table: The application processes song and takes 100 sample per second, so around 15000 samples for complete song. These sample values are stored in database, 1 row for each sample as {HASHKEY, NOTE_ID, TIMEOFFSET}. For fingerprint of complete song, I may have around 15000 rows in fp_core table. I am planning to put fingerprints of 50000 songs in database, so around 750 million rows will be in fp_core table. I have other application to process recordings and detect songs played in it. Process is, create set of HASHKEY from recording audio, same as for creating fingerprint of original song. Recording audio will generate around 20000-30000 HASHKEYs. Then application retrieves rows from fp_core table for all matching HASHKEYs generated by recording audio. To retrieve data from fp_core table by processing recording, I am doing is, filling these all HASHKEYs of recording in one more table, table is: then I am joining these two tables to retrieve all matching rows, the query is: I have following indexes: Problem: Retrieving data using above query is so slow, taking time around 40 seconds. Right now, here is stats: Query: Result: Plan: Can anybody help me? |
Choose security group for restore-db-instance-to-point-in-time Posted: 17 Sep 2013 12:26 PM PDT When using the AWS CLI restore-db-instance-to-point-in-time command, I can't figure out how to set the security group. The doc on this page says:
Is it possible to override this parameter to use the same security group as the original instance? |
Sqlcmd command strips $ out of query variable Posted: 17 Sep 2013 02:46 PM PDT What I am trying to do Restore a database from backup using sqlcmd. Sqlcmd is being called by PowerShell. What is the issue The server folder which contains the database backups has a $ inside of the name. ie Hostname$InstanceName. When I try to restore any databases I get an error and notice it is trying to restore from \\networkshare\Hostname\DatabaseName\Database.bak You'll notice that everything after the $ got stripped out. I believe this is due to sqlcmd's support of variables (-v parameter). I have tried to use the -x parameter (disable variable substitution) with no success. This process works fine with folders that do not have $ inside of their names. Does anyone know what I can try from here? Or see if I'm doing something wrong. Thanks Sample code |
Looking for help on a database-design to model a availability problem [closed] Posted: 17 Sep 2013 11:29 AM PDT I need to store and query information about disposability of cars in a care-sharing-community in which users can rent cars provided by other users. The data which is relevant for this query will be:
This query should be possible:
Any ideas how to store the information when a car is available or not available to query for all available cars? The query should have as less negative performance impacts through difficult/large queries or large joins as possible, because large data sets (1.000.000 cars and 50.000.000 or more bookings contracts per year) are expected. |
Tips on improving/refactoring slow query? Posted: 17 Sep 2013 04:26 PM PDT Let's play lotto! Ok. I have a I have a table with the Now, given that the I want to find out when was the last time every possible three-number permutation occurred. I'm using this: (Oh, and table Is there a better way to do what I'm trying to do here? This particular query is just very slow and I'm sure someone with better math/grouping skills could do better. Answers to comments - clarifications:
The primary keys: |
SQL Server Designers, Failed Saves, and Generated Scripts Posted: 17 Sep 2013 03:56 PM PDT I am a big fan of the simple diagramming tool that comes with SSMS, and use it frequently. When I save changes to the model, I have it configured to automatically generate the change scripts that go along with the save. I then save (and source control) the resulting change script. This works great and an important piece of the process my team(s) uses. What occasionally happens is that a save fails, and I still get the option to save my change script. I then fix the problem and save again (which results in another change script). I'm never clear what I need to do at this point to maintain a consistent set of change scripts. There seems to be overlap between the two scripts (the failed and the successful), but they are not identical. If I want to continue to use this feature, what should I be doing with the resulting script as soon as I get a failed save of the model? |
The InnoDB log sequence number is in the future Posted: 17 Sep 2013 07:21 PM PDT Our site was getting intermittent database errors and I asked my webhost to check what's happening. After some inspection they found that the database has few issues and tried repairing it. Finally I got following message from them-
Can someone tell me what'd be the best way to address this issue. I really don't want to lose out on any data and want the dB to be repaired. PS: If you need more information, please let me know and I'll get it from our web hosts. Would really appreciate your help. |
how to verify mysql backup file Posted: 17 Sep 2013 06:21 PM PDT Is There any tool to verify the backup taken using mysqldump without manual restoration ? I have to take full backup daily so it is difficult for me to verify the backups daily by restoring them. As it will take time and also temporary disk space. Please suggest me how to verify my backup online |
After 5 years of working, SQL Server 2k5 Table now locking without any changes made to DB Posted: 17 Sep 2013 04:12 PM PDT I have a table: For 5 years, only the odd Deadlock has occured. If it happened, it happened on indexes which was on The problem is that the table Could someone please help and see if they spot anything from the Logs: How can I get rid of the objectLock on the whole It is an One of the Indexes had the page and row locks removed (was not documented so I did not know of this - I apologize for stating that nothing changed in the title)- is it correct to say that if both the row and page locks for a Index is disabled that it would then lock the table which uses that index? (Yes, if row and page locks are turned off, then only the table lock is available.) |
Posted: 17 Sep 2013 05:21 PM PDT Every single user has say, 3 of I'm not an expert, but I've done research but it's all theoretical at this point of course, and I don't have hands on experience with the implementation that's for sure. I think my options are something like 'adjacency lists' or 'nested sets'? Any guidance into the right direction would be very much appreciated! |
Why does that query cause lock wait timeouts? Posted: 17 Sep 2013 02:21 PM PDT From time to time, I find a lot of these errors in my PHP error log: The problem persists for about 2 or 3 minutes. Thanks to stackoverflow, the reason was quite easy to find: What I do not understand is: Why? The locked table is very small, only 61 entries (about 30 new and 30 deleted per day, the auto-incremented primary index is near 800.000). No column is especially large. I use the InnoDB enging for this table (one key refers to another table with approx. 20.000 entries) and the problem occurs from time to time. RAM should not be an issue.The webserver and MySQL server run on the same (virtual) machine that usually does not suffer performance problems. Other transactions (there were thousands during the locked minutes) in large tables (1-2 mio. entries) did not make any trouble. Thanks for your hints! |
SQL Server 2005 not collecting logins in the log file Posted: 17 Sep 2013 01:21 PM PDT I am currently running SQL Server 2005 Standard Edition on a Windows 2003 server machine. I have gone to the properties of the server and confirmed that the Login Auditing is set to both failed and successful logins. For some reason though there is nothing in the logins for fails or successes in the SQL Server logs when I know there have been logins for both. I have searched out the reason for this and have not been able to come up with anything helpful, so I am hoping that someone here could give me a little direction. This is working on my other SQL Servers, so I know where to look for the results, but there are none there. |
Cast to date is sargable but is it a good idea? Posted: 17 Sep 2013 01:19 PM PDT In SQL Server 2008 the datatype date datatype was added. In this connect item you can see that casting a The other option you have is to use a range instead. Are these queries equally good or should one be preferred over the other? |
SQL Server 2008 R2 corrupted after changing MAXDOP Posted: 17 Sep 2013 04:21 PM PDT My SQL Server 2008 R2 doesn't work after changing the I have 6 instances located on the same physical server and I changed
In Event Viewer I didn't find anything useful, also error log wasn't updated when I tried to run instance. Also I noticed a strange thing. When I open the Configuration Manager and open properties of instance, I don't see the fonts of parameter's name in Advanced tab. In another tabs everything is fine. The screen is attached. Does anybody faced the same problem? I don't have any idea how repair this... upd: By the way, i tried start sql server manually from command line with -f or -m parameter but nothing.. I just see empty error window |
Applying user-defined fields to arbitrary entities Posted: 17 Sep 2013 08:21 PM PDT Currently we have an old (rather crude) system that has user-defined fields, which are mapped against rows in arbitrary tables. This was an after-the-fact modification based on a customer request, and it wasn't really designed to scale well. Our system has around 60 different types of entities, which makes things even more complicated. Essentially the implementation looks like this:
etc... This gets nice and fun when we generate our own ways to index compound primary keys, but that's another DailyWTF-worthy story. Obviously this is pretty hideous, and leads to some spectacularly horrific queries being generated, but it's worked alright for now because we limit each entity to a maximum of 5 user-defined fields. As a quick disclaimer, I wasn't with the company when this design decision was made! ;) Anyway, we're about to start a shiny new project and will inevitably need a better way of doing this, with no restrictions on the number of UDFs we can apply to entities, increased performance, and less horror in the generated query department. If we could run a NoSQL solution like Mongo or Redis I'd be happy and wouldn't need to bother you all, but sadly that's not an option. Instead, I need a way to do this from within SQL Server 2008 R2. So far, I've come up with the following options:
So, do any of these ideas have merit? Is there a better alternative? |
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