[how to] Problem using merge into a remote table over dblink |
- Problem using merge into a remote table over dblink
- Software for working with SQL Server databases in Windows Server 2008
- Export from phpMyAdmin and import later from another phpMyAdmin fail
- MySQL randomly refuses to use index
- Publishing database changes with SSDT that include altering data types of columns
- Error On Collection_set_2_upload, SQL Server 2008 R2
- before insert trigger for insert duplicate rows into another table
- MySQL looking up more rows than needed (indexing issue)
- Data structure for storing synonyms
- Best way to handle temporary data
- Server Wide DDL Trigger Permissions Issue
- The ordinal position for a column changed without my knowledge
- How to avoid locks by large transactions?
- Securely remove columns (and traces thereof) from a SQL database
- picking consecutive or sequential number in a resultset
- Data Gateway for ODBC Connect Problems with ORA-28513
- How to track if employees are late which has more than one work schedules or shifts?
- Data Base Testing [on hold]
- Configure Email to be sent on restoring a database
- Looking for a database-design to model a availability problem (large data sets are expected) [on hold]
- SQL Query too slow on SUM function
- Selecting from an excel spreadsheet into SQL Server table
- How do I track why my SQL Azure occupied space pulsates?
- Scaling of PostGIS vs MySQL cos/sin calculations
- MySQL Continue Handler Problems inside a Function
- Data sharing between client and server two ways
- Database table design question
Problem using merge into a remote table over dblink Posted: 04 Sep 2013 08:02 PM PDT I'm attempting to perform a merge into a remote table, let's say on server A (over a dblink), using a local table on server B. Source and target databases are both on Oracle 10.2.0.3. We already have a similar existing merge that works fine (but with the query running on server A and merging into a table on server B) so I'm a bit flummoxed as to what could be causing the problem. I've reduced the case to the simplest - having identical tables and using the entire content of the local table for the merge, and still the merge fails with ORA-02064 "distributed operation not supported": Any idea what I should be checking next? Many thanks in advance |
Software for working with SQL Server databases in Windows Server 2008 Posted: 04 Sep 2013 08:41 PM PDT We have an ASP .NET project that uses SQL Server that we host on a Windows Server 2008 machine. What software can I use to interact with this database manually? I'm willing to use built-in tools and command line tools. (Command line tools would even be preferable.) |
Export from phpMyAdmin and import later from another phpMyAdmin fail Posted: 04 Sep 2013 03:46 PM PDT I have a MySQL Server and a phpMyAdmin in a server at office, I exported a database using the phpMyAdmin export feature. I come home and try to import the exported .sql and get this error:
what should I do in order to import the file without problems in my server? |
MySQL randomly refuses to use index Posted: 04 Sep 2013 09:00 PM PDT Mysql randomly refuses to use indexes for even simple queries. 1 example from slow-query log:
This is a MYISAM table with lead_id as primary key The same query run on an identical server with similar data size uses the index. Also, not all such queries on this server turn up as table scans. What could be the problem?
|
Publishing database changes with SSDT that include altering data types of columns Posted: 04 Sep 2013 02:04 PM PDT I have a SQL Server Data Tools (VS2012) project that's published automatically during the build process. A column was recently updated from an
I understand why I'm receiving that error, and I know it could be resolved by disabling the "Block Incremental Deploy if Data Loss May Occur" flag. However, there's very strong opposition to disabling that feature, so it's not going to be an acceptable solution. The only other solution I can think of is to do the following:
That seems horribly clunky and inefficient, though. Is there a better alternative? |
Error On Collection_set_2_upload, SQL Server 2008 R2 Posted: 04 Sep 2013 11:29 AM PDT The following error appears in the Job history Log in SQL Server An error occured while trying to access the cache directory: "D:\". Inner Error ------------------> Access is denied. Process Exit Code 4. The step failed.,00:00:00,0,0,,,,0 Has any one experienced this error before? This is occuring during MDW collection_set_2_upload Because of this the database log Becomes full. Any suggestions? Thanks! |
before insert trigger for insert duplicate rows into another table Posted: 04 Sep 2013 04:14 PM PDT I have a table called I have list of questions
ERROR response is |
MySQL looking up more rows than needed (indexing issue) Posted: 04 Sep 2013 04:15 PM PDT In our MySQL 5.5 database, we have following InnoDB table with 30M+ rows: The combination participant_id + question_id + given_answer_id is unique. At the moment we have following keys: PRIMARY KEY (in this order)
INDEX KEY
For this table, we have two kinds of select queries in our application: and Normally, every participant_id has between 0 and <100 rows with different question_ids. The other way around, every question_id can have unlimited (usually not more than 100 000) rows with different participant_ids. The first query is executed way more often than the second one. When we execute following query, it shows us that 32096 rows where looked up: Whereas, when we execute the same query without EXPLAIN only 18732 rows are returned. What indexes do we need on this table in order to prevent this overhead but still performing for both kinds of queries? Here's is the code to create this table: CREATE TABLE `example` ( `participant_id` BIGINT(20) UNSIGNED NOT NULL, `question_id` BIGINT(20) UNSIGNED NOT NULL, `given_answer_id` BIGINT(20) UNSIGNED NOT NULL, `status` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`participant_id`, `question_id`, `given_answer_id`), INDEX `question_id` (`question_id`) ) ENGINE=InnoDB; |
Data structure for storing synonyms Posted: 04 Sep 2013 10:50 AM PDT Hello all I am new to this forum and also fresher in computer science industry so this question may seem unstructured to you. I am asking this question as i have to include it in my project. Even if you could not help me by exact answers i request you to show me path to reach to my answer. Question I am in process of finding self evolving data structure for alignment of Terms and phrases (synonyms under some rules) . For example mobile and cell will be synonyms if the query fired to find synonyms of mobile will also include some calling related part (Rule will be calling here) . Neither meaning of Mobile and cell can also be different. Mobile can also be also mobile library , mobile hospital etc. and cell can be biological term. Work by Me I have explored somewhat NOSQL and neo4j graph database . They are indeed great but was unable to find any useful concepts that can relate to my above question. Thanks in Advance . Any help would be appreciated |
Best way to handle temporary data Posted: 04 Sep 2013 10:56 AM PDT Say I have a table When the server detects that there are 50 prices or more, then the server calculates a median of those temporal prices and update the table The first idea that came to my mind was have two tables with the same schema but different names ( I don't know if this is a good/common practice. I am missing something? Also, what mechanism should I use to trigger the server to inspect the table Thanks. |
Server Wide DDL Trigger Permissions Issue Posted: 04 Sep 2013 11:03 AM PDT I am trying to implement a server wide DDL Trigger that will audit the DDL changes across the databases on the server using script very similar to the article found here The trigger will log the DDL events into one table within one database, however I am coming up against permissions issues and some users, even myself with sysadmin privileges, receive the following error message. I've read about using the Could someone advise on the correct method to implement a trigger of this kind and what permissions are required to users or to a specific login to be used in the WITH EXECUTE AS? EDIT: Some further info The server is running SQL Server 2008 R2 and the DDL Trigger is set to DDL_EVENTS as follows: The above script is how I originally created the trigger and this worked fine for me and some other users, though a user who had db_owner role to a particular database kept receiving the error message above. After trying to implement the WITH EXECUTE AS I found that the trigger would not work for myself. |
The ordinal position for a column changed without my knowledge Posted: 04 Sep 2013 10:00 AM PDT I have a column that is out of order (ordinally, not in terms of select statement), and I just can't figure out how it got that way. I've been researching this for quite some time and am coming up empty. I also could not reproduce it in testing. I have informed the developers that they are not allowed to run queries that do not explicitly name columns, for exactly this reason. In the mean time, though, it's driving me crazy that I have no idea how we came to this state of affairs. |
How to avoid locks by large transactions? Posted: 04 Sep 2013 10:03 AM PDT We have a large application running, that requires cleanup for performance reasons. This was however not forseen when designing the application. Basically, the delete is executed from a stored procedure, which first does a couple of selects to define the data to be deleted, after which it starts deleting from different tables. As the link between this data is essential for the deletion, it has to be avoided to delete for example and order without deleting some dependencies. Therefore it has to run in one transaction. Problem is, whenever the script is running, the application itself become not unusable: timeouts when getting data from the web, or trying to update a certain record. Al those queries are blocked by the sessions that runs the transaction The data being deleted is not relevant anymore, and should thus not be updated by the application. I've tried running the transaction in different isolation levels, including snapshot, but it still doesn't work. How can I avoid these locks? Should I use READ_COMMITTED_SNAPSHOT? Thanks in advance... |
Securely remove columns (and traces thereof) from a SQL database Posted: 04 Sep 2013 09:47 AM PDT I've come upon a database that has previously held sensitive data (think "passwords/credit-card-numbers" kind of sensitive) in plain text. All of the sensitive data in question has been deleted, but I'm concerned that if accessed by someone with malicious intentions, the data might be recoverable through backups and/or transaction logs. Is there a way to permanently and securely delete certain columns out of transaction logs and/or backup files while maintaining the integrity of all other data in a SQL database? |
picking consecutive or sequential number in a resultset Posted: 04 Sep 2013 08:07 AM PDT I have a mySQl database containing tables that contain all of the possible 5 number combinations for the take 5 lottery (pick 5 numbers: 1-39), organized by the sums of the 5 number combinations. EX. { (sum table: 15 - 1,2,3,4,5), (sum table: 17 - 1,2,3,4,7 | 1,2,3,5,6)} ... FOR SUMS 15 THROUGH 185. I need a way to be able to filter my queried results to those results that contain at least two sequential numbers for a selected sum table. Ex. For sum 17, this would be: RESULT: 1,2,3,4,7 | 1,2,3,5,6 First I query the table for everything. using a query of a query I query the above resultset for rows containing numbers that are consecutive or sequential. I need to put some kind of code or regular expression in the query to select just those rows containing 2 or more consecutive numbers. the table is organized as follows: col: num1 to num 5 as integers and are currently in numerical order ascending the tables have an auto increment and a row ID as a primary key, and an regular index on the entire row. Q) Is it possible to use a regular expression? If not what is the best solution vector? |
Data Gateway for ODBC Connect Problems with ORA-28513 Posted: 04 Sep 2013 07:54 AM PDT We try to connect from an Oracle 11g (11.2.0.3.0) data base server to a MS-SQL Server running on some other server. Our machine has Windows 2008 R2 Enterprise 64 Bit. We use dg4odbc for our link to MS-SQL, and configured it as follows: Before anything, we ran the script As a thrird step we created a new file for our heterogenous service (dg4odbc) and added a suitable configuration to Oracle's listener and TNS config files. The configuration of our ODBC data source for dg4odbc is contained in a file named Our Also in this directory we edited the We receive an error message when we try to execute a select statement (we only tried to select so far) which also creates a trace file in the and the log file contains the following lines We already checked all file access rights of some users, but can not single out the real reason of this problem. Any hints are appreciated. |
How to track if employees are late which has more than one work schedules or shifts? Posted: 04 Sep 2013 05:43 PM PDT I have designed a MySQL database for an employee monitoring system, it was working perfectly well until I was asked to put a new work schedule for some of the employees. The new schedule was what they called a broken schedule because an employee would have different shifts in one day, for example, an employee could be given a work schedule for a given day starting from 7:00AM-11:00AM and then continues at 3:00PM-7:00PM... The problem I encountered now is, I am confused on how to keep track if the employees are late of not now that some employees have two or more work schedules... Could anyone help me pls? addendum: for more clarity, lets say we have employee A. employee A for example has the following work schedule for a given day - 5 days in a week. then, lets say employee A logged in at these different scenarios: how do I check that employee A's log info at scenario #1 is not referencing shift2 or shift3? |
Posted: 04 Sep 2013 08:07 AM PDT We have 5000+ Dbs (on MySQL - Unix Machine) each having similar 30-40 tables. We are performing Migration activity from one machine to another (again same on MySQL - Unix Machine). Could any one suggest best possible solution to validate all the data is migrated properly. Also what other things should we consider while testing this activity? Thanks in advance! -- C.F. |
Configure Email to be sent on restoring a database Posted: 04 Sep 2013 11:10 AM PDT Is there a way to configure Email in SQL Server such that an Email is sent when a particular database is restored. |
Posted: 04 Sep 2013 08:24 AM PDT I am looking for a database-design to store and query information about disposability of cars in a to be designed care-sharing-community, where users can rent cars provided by other users. There will be a (proximity) search which should only show all available cars. I'll expect to have following data: Car data with general availability - set by the car owner. Rent contracts for a specific or recurring date/time, which reduces the availability. Here some example queries that should be possible:
No matter if SQL or NoSQL is used for the model, any ideas are welcome. Important: The database-design should scale well, as large data sets are expected. |
SQL Query too slow on SUM function Posted: 04 Sep 2013 02:18 PM PDT I've a table with around 32 million rows having clustered unique index on CountryID,RetailerID,ProductID,DateID,EventID,TypeID and query is The query plan is showing 88% time on Clustered Index seek on EventPL table but still its taking around 15 seconds to complete. Is there any way I can optimise it to around 1/2 seconds? |
Selecting from an excel spreadsheet into SQL Server table Posted: 04 Sep 2013 11:18 AM PDT This question has been asked before but I tried giving full admin rights to the SQL Server user on So for the following code snippet: EXPANDED SQL STATEMENT I get this error:
|
How do I track why my SQL Azure occupied space pulsates? Posted: 04 Sep 2013 12:18 PM PDT This is inspired by this StackOverflow question. I have this code: for detecting database space consumption and it returns exactly the same result as SQL Azure management portal pie chart. The problem is the number fluctuates greatly without apparent reasons - sometimes it's around 35% and sometimes it's around 54%. This is kinda worrying - I don't get what happens and the major concern is that we suddenly consume all the space and our service comes to a halt. I seriously tried to look into What data should I use to find the root cause of the fluctuations? |
Scaling of PostGIS vs MySQL cos/sin calculations Posted: 04 Sep 2013 05:53 PM PDT I need to sort database rows according to GPS coordinates (or any other geographical representation). The way I've understood it, MySQL Spatial Indexes are too buggy at the time of writing (at least articles and my own tests indicate so). So I can either switch to PostgreSQL to use PostGIS which seems to be working excellently, or I can do it mathematically in MySQL: I'm not asking for a PostgreSQL vs MySQL debate, but simply how the performance of the MySQL expression scales as rows grow compared to using PostGIS/PostgreSQL. It's a drastic step to switch database system, so the upside better be significant. |
MySQL Continue Handler Problems inside a Function Posted: 04 Sep 2013 08:18 PM 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: 04 Sep 2013 09:18 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? |
Database table design question Posted: 04 Sep 2013 03:04 PM PDT Firstly, database novice here. I'm trying to create a system for processing Sales Orders into Purchase Orders and then split the Purchase Order into Shipping Containers. The systems needs to be able to split a Sales Order Line Item into 2 or more Purchase Orders and a Purchase Order Line Item into 2 or more Shipping Containers. There will be some(a lot of) adjustments back and forth where once a Sales Order Line Item gets split and put into multiple Purchase Orders it might get split differently later on. And same when a Purchase Order Line Item is processed into Shipping Containers. I can't for the life of me how to best handle this operation. If it helps, here are the tables I have so far with some details excluded for brevity: I'm thinking to create additional association tables between Sales Order Line Item and Purchase Orders and for Purchase Order Line Item and Containers to keep track of this kind of back and froth splitting? Help appreciated! |
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