[how to] Get all the database in db2 through web |
- Get all the database in db2 through web
- Table design when one data is dependant of another and the second one has repeated values
- Hierarchical data best practices
- sysjobhistory "sql_severity" codes
- How to use and optimize subquery on 100 million rows
- Configuring MySQL (my.cnf) for MyISAM and InnoDB
- Can't Select a View on Informix
- MySQL - how can I make a select statement get blocked?
- Should we always prefer clustering over a master-slave configuration if the goal is high-availability?
- MySQL Slow query joining on subqueries with max
- SQL Server - Full text search migration 2005 -> 2012(.ndf file?)
- Merge Statement + Replication difference for SQL Server 2012
- If I fail over one database, do the others that share the same mirror endpoint fail over as well?
- What is the safest way to run SSIS on Multiple Named SQL Server Instances?
- How would I debug/test MongoDB stale connections?
- SQL Server Browser uses NT AUTHORITY\SYSTEM account and logon failure error in SQL Log
- DELETE failed because the following SET options have incorrect settings: 'ANSI_NULLS'
- Foreign key with multiple references
- mysqlslap chokes on strings that contain ";" delimiter?
- Writing with multiple psql processes to database seems to damage data
- SQL error "#1118 - row size too large" on the first row of the table only
- Hash in SQL query
- Oracle schema import is not importing all the tables present in the schema dump file
- SQL Server in a state of confusion: does the database exist or doesn't it?
- mysql better index?
- Increase in memory use when database server switches
- Queries getting stuck on very simple COUNT queries
- Cannot generate reports from SQL Management Data Warehouse
- User login error when trying to access secured SQL Server database
Get all the database in db2 through web Posted: 09 May 2013 07:35 PM PDT I would like to get all the database available in db2 instance from c# application. The CLP command to be used is "LIST DB DIRECTORY". I would like to know how can i fire this command from c# or is there other select statement i can use to get all the database in one db2 instance? Thanks. |
Table design when one data is dependant of another and the second one has repeated values Posted: 09 May 2013 06:14 PM PDT I have a products, and subproducts. Like:
As you can see, the subproduct identifier is not unique. My input is gonna be the product and the subproduct, and I need to return the names. I did this:
But I know that is wrong, I wanted to make 3 tables, products, subproducts and a relation between the two, but I don't know how to design it. If I was to save the product and subproduct into another table, I would have to save both values, that table would have to have the productID and subproductID columns, that's why I feel having a relation product subproduct table would be the best. But I'm having a hard time doing it. |
Hierarchical data best practices Posted: 09 May 2013 05:58 PM PDT I'm looking for a best practicies\databases to solve our problem: Currently we are using SQL Server 2008 R2 with HierarchyId. It works ok, but we have a lot of performance penalties due to this approach. Example (R = root): Current setup: We have around 100 tables and all of those tables reference HierarchyId. Simplified, these are some of the high-level problems: |
sysjobhistory "sql_severity" codes Posted: 09 May 2013 08:18 PM PDT Where can I find out what the different "sql_severity" codes mean in the sysjobhistory table? Eg what does 0 mean? I've inherited a report that excludes ones with a 0 as "0 is not a real error"? I googled and looked at MSDN etc etc.. but no real luck. |
How to use and optimize subquery on 100 million rows Posted: 09 May 2013 03:37 PM PDT What I'm trying to do is running a job on more than 100 million domains which haven't processed before. I have two tables, "domain" and "domain_setting", on every batch (10.000 domains per batch) I'm getting a list of domains from domain table by checking their status on "domain_setting". At first it was working fine but now approximately 10 million domain processed and it's getting slower. I know that my server is crappy for this kind of database, it has only 8 GB of memory and it's also shared with Apache web server (150 concurrent connections), some other small databases and some lightweight PHP applications. My innodb_buffer_pool_size is only 1 GB. Anyway, I would like to learn if there is a better way or thoughts to write this query more efficiently or any other approach for doing this job and speed up the process. Here is my SQL query: I must get domains which are not exist in domain_setting table OR has "is_keyword_checked = 0" value in domain_setting table. How can I optimize this query? Thanks in advance :) |
Configuring MySQL (my.cnf) for MyISAM and InnoDB Posted: 09 May 2013 06:18 PM PDT I want to convert some (not all) the MyISAM tables to InnoDB. Here is my current my.cnf: pastebin.com/FW8YXtLQ What would be the best configuration? (need to add InnoDB settings, byecause there are no InnoDB settings in my my.cnf) |
Can't Select a View on Informix Posted: 09 May 2013 03:20 PM PDT I'm using Informix IDS 11.50 Innovator-C edition running on Slackware Linux 12.0. I've been running a very small Database on it(less than 10000 records on the biggest table). I'm trying to select a view from a web service, and every time there's a high load user load queries are being dropped with messages like:
Or
The Web Service is using the .NET Informix Driver which relies on the Informix ODBC API. Searching for those errors on the web or in the online documentation I found that it's something related to DBTEMP environment variable and the DBSPACETEMP configuration parameter. Both are set. DBTEMP pointing to a directory with all permissions(rw), three dbspaces are listed on DBSPACETEMP. One regular dbspace and two flagged as temporary dbspace. Storage is not a problem, the directory and the dbspaces have a lot of free space left. The tables that the view Targets use R-tree indexes, and those are stored on a dedicated dbspace. One more thing I'm using a Geodetic Datablade on the database. |
MySQL - how can I make a select statement get blocked? Posted: 09 May 2013 01:17 PM PDT Hello I am trying to intentionally make a SQL select statement get blocked by another simple SQL delete or update statement, for the purpose of learning. I prefer only InnoDB tables. To prepare the test, I created a table and inserted 1,000,000 rows into the table. Now I will begin the test. In MySQL client #1, I deleted all the rows: While the delete is still executing, in another MySQL client #2, I try to select a row. The result is displayed instantly, the select was not blocked. Next I will try another test. I insert 1,000,000 rows into the table. In MySQL client #1, I update all the rows: While the update is still executing, in another MySQL client #2, I try to select a row. The result is displayed instantly, the select was not blocked. So now my question, how can I demonstrate a SQL select statement getting blocked by another simple SQL delete or or update statement, using InnoDB tables? Or does MySQL never have any blocking issues? PS I am not trying to simulate two processes deadlocking each other, just one large update or insert blocking a select. |
Posted: 09 May 2013 12:29 PM PDT Given: I have two virtual machines on a SAN that I can use to host RavenDB. Question: If my goal is high-availability, then should I always prefer clustering over a master-slave configuration? From my vantage point, master-slave seems like more of a maintenance headache. Clustering seems much easier. [But perhaps I'm missing something.] |
MySQL Slow query joining on subqueries with max Posted: 09 May 2013 12:36 PM PDT I'm creating a report based on user input (i.e. a search tool) that grabs data from eight tables and will output them to the screen. Here are the create table statements. I'm very aware of how badly some of these tables were made, but I don't have the option of changing them any time soon. Here is the query. Note, it contains a MASSIVE in statement. This is generated based on user input and will be changed in the future. It slows things down a bit, but not as much as some of the joins are. Here's the explain for the query. I'm very certain that the three tm joins ( tm1, tm2, tm3 ) are the culprit. If I remove the subquery and do a simple join on those tables, the query is much faster. As it is now, I don't know how long the query takes to run. I gave up after about five minutes of waiting. How would you recommend rewriting this? |
SQL Server - Full text search migration 2005 -> 2012(.ndf file?) Posted: 09 May 2013 12:15 PM PDT So I'm trying to figure out the details for migrating from sql server 2005 to sql server 2012.
(PS. I atttached only .mdf and .ldf files, not sure how to attach a specific text search catalog file because it's multiple files) I might have missed something but any suggestions will be helpful, thanks! |
Merge Statement + Replication difference for SQL Server 2012 Posted: 09 May 2013 11:36 AM PDT We have a SSIS package that will pull from a source database and run a merge statement to put the data into a "Master" database. (Eventually the "Master" database will be the source of truth, but we are a while away from that.) After the Master Database gets the data, it replicates it down to several other databases. With Sql Server 2008 R2 this all worked great. But with SQL Server 2012 we are noticing that there are a bunch of delete statements for these tables being replicated. The Merge Statement in the SSIS Package does not delete anything. So I am left to wonder why this is happening. Could SQL Server 2012 be translating my NOTE: We turned off replication of delete statements and the problem stopped, but I want to know what is going on. Why would I be seeing so many deletes when the source seems unchanged? Is there a way I can see the transactions posted against a table? NOTE: I tried doing a SQL Trace, but it did not show any deletes. Only the merge I described above. |
If I fail over one database, do the others that share the same mirror endpoint fail over as well? Posted: 09 May 2013 01:29 PM PDT We have two databases setup for mirroring on a single SQL Server instance: a test database and a production database. Both get mirrored to another server using the exact same endpoints. If I go into the Database Properties for the test database and click the "Failover" button, will it fail over the production database as well since both databases share a mirror endpoint and their Server Network Addresses properties are the same? I am concerned because when I set up mirroring for the 2nd database, I did not have to configure anything new. It just used all the existing information. If I use the "Failover" button from the Database Properties, will it result in failing over all databases that use that endpoint, or just the specific database that I am viewing the properties for? |
What is the safest way to run SSIS on Multiple Named SQL Server Instances? Posted: 09 May 2013 09:54 AM PDT I have an Active/Active SQL Server 2008 R2 cluster. There are two named instances on each node and no default instance. I need to deploy SSIS packages to the different instances. To do this, I needed to modify the MsDtsSrvr.ini.xml file to add the instance names so they would be seen by BIDS and SSMS. I put all 4 instance names in that XML file (on both nodes) and restarted SSIS on both nodes. I can now see the folder for each instance when connecting to any instance in SSMS through an Integration Services connection. However, clicking the 2 instance names that are on the other node generates a login failure since they are not active on the current node. Maybe this is just an inconvenience, but am I going to run into any issues with this setup? Or is there a way to do it that makes more sense? |
How would I debug/test MongoDB stale connections? Posted: 09 May 2013 09:12 AM PDT I am running into a problem with stale connections in mongo and am not sure how to debug or resolve it. I performed some heavy load testing earlier in the day (3pm) and then later that night our staging site was failing (around midnight) because of connection timeout issues. Which leads me to believe that I am getting stale connections. I am not sure whether the issue is in my database or in my mongoid pool code? Any suggestions how I could debug this, or can someone shed some light on mongo and pooling. ps. I am using Ruby/Rails with an Object Relation Mapper, Monoid2, and mongo-ruby driver 1.6. Backtrace |
SQL Server Browser uses NT AUTHORITY\SYSTEM account and logon failure error in SQL Log Posted: 09 May 2013 09:22 AM PDT Using SQL Server 2012 on Windows 2008 R2 I have been getting errors in SQL Logs for failed login for NT AUTHORITY\SYSTEM. All of SQL Server's services are running under their own Domain accounts, except for SQL Server Browser service. Once I had shut down this service, the errors immediately stopped and so I believe this was the cause. I believe there are three(3) solutions to this:
However, here are my questions :
Thank you! |
DELETE failed because the following SET options have incorrect settings: 'ANSI_NULLS' Posted: 09 May 2013 09:24 AM PDT I have inherited a few scripts that are pumped through a c#.NET custom app to update a SQL2005 SP3 database. One of these scripts does a deletion on a user table called Here is the SQL: This script errors with the following error message: I have done a lot of Googling on the issue, and have played around a lot with the set statement in an attempt to get it to work. In testing, in SSMS, the script did not produce an error, at least not before shipping it. I am not sure if I am missing something, but it seems that the settings are not properly set when run through the app. Am I missing something in the script? |
Foreign key with multiple references Posted: 09 May 2013 03:17 PM PDT I have the following three tables in mysql database named "THE_COLLEGE" If a new row want to be inserted into the table "users", that row must be found in students table or staff table. Which means a staff or a student can be a user. Is it possible? I tried with following foreign keys. But the user table is allow to insert a row, if the row found in both tables (Student and Staff). But I need to allow if the row found in any of the table (Student or Staff). |
mysqlslap chokes on strings that contain ";" delimiter? Posted: 09 May 2013 08:46 PM PDT I'm having a problem passing preexisting files full of SQL statements into mysqlslap. For example, I have a file named I also have a file called And I run: I get the error: Which is consistent with MySQL terminating the statement at the ; that's in the middle of a string. What can I do to make mysqlslap take |
Writing with multiple psql processes to database seems to damage data Posted: 09 May 2013 06:42 PM PDT I have a couple terabytes of CSV data that I am trying to import into a PostgreSQL 8.4 database (on a RedHat 6.2 server), whose data directory is initialized on a multipath hardware RAID. There are four folders of CSV data that need to be imported, and the import script acts according to what it finds in those directories, so right now it's simplest for me to run the import script separately for each server. I have run these scripts serially on a Debian server (without multipath) before, waiting for each script to finish, and that worked. However, when I had to re-import later on this RedHat system, I decided to fire up four There should be a postgres data directory here with ownership What's going on here? I was assured the multipath drivers and mounts for the RAID volume in question is working, so I don't think it's the hardware at this point. For reference, each script adds about 105,000 points every couple seconds to a table in the database. Here's the import script code: Sample script output: |
SQL error "#1118 - row size too large" on the first row of the table only Posted: 09 May 2013 09:30 AM PDT I ran into a problem using a mySQL database. I have some columns as type text but when I try to enter data into the first row I get the error code "#1118 - Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs" for anything with more than 15 characters. This only occurs for the first row, all the other rows in the column and table work just fine. Help! Field Type Collation Null Default Extra pid int(11) No None AUTO_INCREMENT 3 text utf8_general_ci Yes NULL 6 text utf8_general_ci Yes NULL 7 text utf8_general_ci Yes NULL 8 text utf8_general_ci Yes NULL 9 text utf8_general_ci Yes NULL 10 text utf8_general_ci Yes NULL 21 text utf8_general_ci Yes NULL 22 text utf8_general_ci Yes NULL 23 text utf8_general_ci Yes NULL 24 text utf8_general_ci Yes NULL 25 text utf8_general_ci Yes NULL 26 text utf8_general_ci Yes NULL 27 text utf8_general_ci Yes NULL 28 text utf8_general_ci Yes NULL 29 text utf8_general_ci Yes NULL 30 text utf8_general_ci Yes NULL 31 text utf8_general_ci Yes NULL 32 text utf8_general_ci Yes NULL 33 text utf8_general_ci Yes NULL 34 text utf8_general_ci Yes NULL 35 text utf8_general_ci Yes NULL 36 text utf8_general_ci Yes NULL 37 text utf8_general_ci Yes NULL 38 text utf8_general_ci Yes NULL 39 text utf8_general_ci Yes NULL 40 text utf8_general_ci Yes NULL 41 text utf8_general_ci Yes NULL 42 text utf8_general_ci Yes NULL 44 text utf8_general_ci Yes NULL 45 text utf8_general_ci Yes NULL 46 text utf8_general_ci Yes NULL 47 text utf8_general_ci Yes NULL 48 text utf8_general_ci Yes NULL 49 text utf8_general_ci Yes NULL 50 text utf8_general_ci Yes NULL 51 text utf8_general_ci Yes NULL 52 text utf8_general_ci Yes NULL 53 text utf8_general_ci Yes NULL 54 text utf8_general_ci Yes NULL 55 text utf8_general_ci Yes NULL 56 text utf8_general_ci Yes NULL 57 text utf8_general_ci Yes NULL 58 text utf8_general_ci Yes NULL 59 text utf8_general_ci Yes NULL Indexes: Keyname Type Unique Packed Field Cardinality Collation Null PRIMARY BTREE Yes No pid 61 A Server Version: 5.5.9 |
Posted: 09 May 2013 06:06 PM PDT I saw few sql queries with ### appended before and after column name in where clause like What is significance of these hashes? |
Oracle schema import is not importing all the tables present in the schema dump file Posted: 09 May 2013 09:06 AM PDT I have exported an existing oracle schema from another machine and then imported it in my local machine. Import was successful, but some tables which are present in the export dump file are not imported. Here are the export and import commands i have used. The Oracle we are using is 10g EE. What could be going wrong ? Can you please suggest a solution to this issue. |
SQL Server in a state of confusion: does the database exist or doesn't it? Posted: 09 May 2013 12:37 PM PDT Got a really weird, annoying problem.. Somehow the instance of SQL Server 2008 R2 running on our server has gotten somewhat corrupted. First, we noticed that the database we created yesterday was missing. So, we looked around and found that it was still there, but detached. So, we tried to attach the mdf but got a message which was something like I thought that was odd, so restarted SQL Server. Same thing... okay, time for drastic measures... so, I stopped the service, zipped up the mdf, started the service, unzipped it and then tried to restore it. The above message was gone, but then I got:
Ouch. Of course it's not showing in the database explorer, so no idea what's going on... last resort: Of course that didn't work.. that tells me the database does not exist. So, I'm stuck... at one point SQL Server thinks the database does exist and at another point it thinks the db does not exist.. obviously it's in a state of confusion. Has anyone seen this before? Got any ideas on how to fix it? |
Posted: 09 May 2013 02:06 PM PDT Hi i am not sure where should i add primary index in my table salas order. Table have invoice date where is lets say 50 values added every day and i need to search them this column is date datatype or add index to invoice number where lets say is 40 values added every day with same invoice number but this column is varchar datatype and values looks like this a100,a100,a100,a101,a102,a102 etc what will be better for search of invoices. Selec* from salesorders where date ... or where invoicenumer ... |
Increase in memory use when database server switches Posted: 09 May 2013 12:06 PM PDT I have an ASP.NET 4.0 application running on Window Server 2008 and a Oracle 11g database server running on Linux. There are two database servers with the same virtual IP. Recently somehow one database server went down and another database server starting working. Every thing went perfectly on the database server site with a small problem with the Oracle listener. But on my application server, memory started increasing and went up to above 15 GB, almost 99% use. Normally it uses 2 Gb of memory. I am using ADO.Net to connect to Oracle. My application has properly closed database connections. I was not able to figure out what is the problem and what should I do in my application. Can any one suggest me what should I do? |
Queries getting stuck on very simple COUNT queries Posted: 09 May 2013 05:06 PM PDT process list: The table only has around 2500 rows, only ~1000 need to be scanned. Table is InnoDB. This started happening last night. I was not able to run UPDATEs on the table run without error (it is frequently updated), it just seems to be anything that selects from it that use COUNT(). I am able to Explain: MySQL is using Percona Server Any ideas on what is causing this? Thanks a lot. EDIT: Rolando: you say to increase Excerpt from Full status: innodb% variables |
Cannot generate reports from SQL Management Data Warehouse Posted: 09 May 2013 01:29 PM PDT I'm running SQL Server 2008 R2 and have installed the MDW on one server and have a Data Collector collecting and uploading the server activity, query results, and Disk activity data to the MDW. When I select any of the reports from the MDW with Data Collection > Reports > Management Data Warehouse I receive the error:
This occurs for all 3 reports and after I've waiting some time and data has been uploaded from the data collector. I do not have SSRS running, but read that isn't necessary. Any suggestions? |
User login error when trying to access secured SQL Server database Posted: 09 May 2013 12:26 PM PDT We have a username that was recently renamed from one username to another (think getting married). The Active Directory admin renamed the user because "it has always worked in the past". One vendor package we use uses the built-in MS SQL Server security. Each module has three groups:
So we can add a person to one of these groups an they get the appropriate access. I don't have the actual error message in front of me anymore, but it said that they are not authorized to table CriticalVendorTable. It worked before the rename. The admin removed the person from each group and re-added them. Still no go. I even restarted the server and it still doesn't work. My best guess is that there is UUID (or unique id) somewhere that is causing problems. The vendor's response is to delete the user and then re-add them. I have only had time to do some brief searching, but I found this page; AD User SID Mis-mapping. Would this be worth trying? Would it be better to just delete the user and recreate them? |
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