[how to] Deploying database changes in high availability environment |
- Deploying database changes in high availability environment
- Postgres ODBC driver versions
- Do I need to use -f to fix insufficient max server memory settings?
- mysql: commands like create/grant/drop always return "0 rows affected" if OK
- How can I get my linked server working using Windows authentication?
- MySQL multiple rows with same id meeting two different conditions at same time
- What can I add to a server to make SQL restores faster?
- How to write a query to find all tables in a db that have a specific column name
- Trying to find the last time that a value has changed
- Create primary keys based upon higher-level entity in access?
- Cannot run pgAdmin from the terminal: No such file libwx_gtk2u
- pgAdmin to display multiple result sets
- How do I maintain more audit history?
- Query mail logs for xp_sendmail
- CSV File Into MYSQL Merging - LOAD DATA on Duplicate Key?
- Nonclustered index is faster than clustered index?
- Central stored procedure to execute in calling database context
- How to add column to big table in MySQL
- Create a trigger to update table data on another Server's database
- How to properly clean Merge Replication Setup
- PostgreSQL LDAP authentication
- Tool to export data with all relational data?
- mysql: need help to optimize my query/table
- Replication on MySQL server
- Merge Replication identity field issues
- MySQL Slaves lag behind master
- MySQL replication between VPS and shared host
- Partition of tablespace
- How do I make a date set in Analysis Services Tabular Model
Deploying database changes in high availability environment Posted: 18 Jun 2013 07:22 PM PDT We are currently looking at our deploy process, which consists of an application tier and data tier for a web solution. We'd like to develop a deployment strategy that does not require downtime for our sites. From an application point of view this is simple enough - we have a load balanced environment, and can turn servers on and off as we deploy the code. However we are not really sure how to approach the database side of things, which at the moment is a bit of a single point of failure. The database is used for both reads and writes, and it is not really feasible (as far as we can see) to turn either off without bringing sites offline. So we need to keep the database in sync with whichever version of the application is currently servicing requests. We also need to allow enough time for the database deploys to be made, without causing any problems. Is this a solved problem in DBA circles? Does anyone have any tips, stories or resources that might help us approach this problem? At the moment we are not really sure what our first step in this process should be. |
Posted: 18 Jun 2013 06:44 PM PDT On the Postgres ODBC driver page the name for each file is of the form: I'm trying to make sense of the file names, and haven't been able to find any documentation. The |
Do I need to use -f to fix insufficient max server memory settings? Posted: 18 Jun 2013 07:07 PM PDT SQL Server Version: SELECT @@VERSION; /* Microsoft SQL Server 2012 - 11.0.2100.60 (X64) Developer Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1) */ Issue: So, I was playing around with max memory and I accidentally set max memory to 128MB and now, I cannot open a connection to SQL Server. When I tried to open a session and fix the mistake, I got this wonderful pop-up. In order to save myself, I decided to add the -f parameter to SQL Server and bounce the service. See more about that here: Server Memory Server Configuration Options and here: Database Engine Service Startup Options Once the service was re-started, I tried once again to connect. I got the following message: This was expected according to the information I had about the -f flag. I then was able to open a connection using the Dedicated Admin Connection (DAC). I was then able to run sp_configure and alter the max memory setting. Here is what I saw in sp_configure before I made a change. It appears that the running value is again infinity (or close enough). I ran this update to increase the max memory to 3GB: USE master; GO sp_configure 'max server memory (MB)' , 3072; GO RECONFIGURE; GO And then I removed the -f parameter and re-started SQL Server. At that point, the server became accessible in multi-user mode and I had a max memory value equal to 3GB. This is not the most elegant solution I have ever encountered; but, alas it worked; so I decided to share it here. Does someone have a quicker and cleaner solution? |
mysql: commands like create/grant/drop always return "0 rows affected" if OK Posted: 18 Jun 2013 07:39 PM PDT I was considering why some special commands in mysql like I know there are not standard queries, but if we do so it's countable in rather easy way. or am I missing sth? I verify above with a few mysql version 5.1-5.5. |
How can I get my linked server working using Windows authentication? Posted: 18 Jun 2013 02:29 PM PDT I'm trying to get a linked server to ServerA created on another server, ServerB using "Be made using the login's current security context" in a domain environment. I read that I'd need to have SPNs created for the service accounts that run SQL Server on each of the servers in order to enable Kerberos. I've done that and both now show the authentication scheme to be Kerberos, however, I'm still facing the error: In Active Directory, I can see that the service account for ServerB is trusted for delegation to MSSQLSvc, but I noticed that the service account for ServerA does not yet have "trust this user for delegation" enabled. Does the target server also need to have that option enabled? Is anything else necessary to be able to use the current Windows login to use a linked server? |
MySQL multiple rows with same id meeting two different conditions at same time Posted: 18 Jun 2013 05:17 PM PDT I am using OTRS helpdesk ticket management system. When i execute following Query: I get the following output: I need to modify the above query so I can only list rows of each ticket_id which has "%RAW% %new%" in name and at the same time same ticket_id has a row which has "%Close" in it. In other words, Three rows of ticket_id 3, Two rows of ticket_id 5 and Two Rows of ticket_id 8 should be displayed from the above output. |
What can I add to a server to make SQL restores faster? Posted: 18 Jun 2013 02:54 PM PDT I have a 2.8TB SQL database (mostly data files, some 400GB of log files) that currently takes around 9 hours to restore. This database is used for testing purposes and must be deleted and restored from a backup between each run, to make sure we're always starting from the same point. My question is, the server currently has 12 cores and 92GB of RAM, with a RAID 5 disk subsystem that the database is on. What areas usually cause bottlenecks for SQL restore processes? Is it the disk, memory, or CPU? |
How to write a query to find all tables in a db that have a specific column name Posted: 18 Jun 2013 05:08 PM PDT I've got a database with about 100 tables and I need to build a join query to get specific data from two of them. I know one but not the other. Basically I need something like:
How can I do this? |
Trying to find the last time that a value has changed Posted: 18 Jun 2013 06:09 PM PDT I have a table that has an ID, a value, and a date. There are many IDs, Values, and dates in this table. Records are inserted into this table periodically. The ID will always stay the same but occasionally the value will change. How can I write a query that will give me the ID plus the most recent time the value has changed? Note: the value will always increase. From this sample data: The result should be: (Because 00:05 was the last time |
Create primary keys based upon higher-level entity in access? Posted: 18 Jun 2013 01:45 PM PDT Is it possible to have access create primary keys for items by appending a string to the primary key one level above it? I am trying to create an inventory management database for my company's server ops team, to keep track of things such as switches, servers, UPS's, etc. I have things organized to separate our different locations, the different rooms in said locations, the different racks in said rooms, and finally a 1-1 relationship between an occupied rack U and a device. The primary key for locations would be a simple, 3-letter designation that we use as a site code. The primary key for a room would be that site code plus " To simplify, I would be manually inputting each entry down to rackU, and primary keys would look like: [Loc] = Then, when entering a new device, user would select Location, Room, Rack, and input a rackU number. I need some way to auto-generate the rackU primary key to be the linked Rack primary key plus the given U number. It's one of those things where I'm fairly certain I could make it work if I was writing this database from scratch in python or PHP, or if i was using an actual mySQL database, but I'm completely lost as to how to handle this in Access. |
Cannot run pgAdmin from the terminal: No such file libwx_gtk2u Posted: 18 Jun 2013 02:04 PM PDT (Probably irrelevant) I'm using Puppet to setup/manage a class of computers that are equipped with PostgreSQL and PostGIS, and this implies that each computer goes through an unattended install: PostgreSQL I should mention that, even though the install succeeds (exit code 0, at least), PostgreSQL does not appear under Applications. PostGIS When I now attempt to run running to no effect. I'm out of both ideas and pages of Google search results. I am running Red Hat Enterprise Linux 5 x86_64. |
pgAdmin to display multiple result sets Posted: 18 Jun 2013 01:58 PM PDT With MS SQL Query Browser I can run multiple queries at the same time and each result set will display in it's own window. Does PostgreSQL/pgAdmin have this functionality? Plugin perhaps? |
How do I maintain more audit history? Posted: 18 Jun 2013 11:23 AM PDT I created a SQL Server audit and when I view the audit logs I only see today's audit. I am saving it to a file and I want to store audit for one year. Is there a way to store database and server audit for one year? Does SQL Server store audits for only a day? |
Query mail logs for xp_sendmail Posted: 18 Jun 2013 10:29 AM PDT Using SQL Server 2008, I can query Is anything remotely similar available for querying email logs in SQL Server 2000? |
CSV File Into MYSQL Merging - LOAD DATA on Duplicate Key? Posted: 18 Jun 2013 11:53 AM PDT Hey Dba Stack Exchange, My question to you is with regards to mysql. Right now I have a medium to small sized csv with 25k lines I need imported into mysql for a client. Problem is, their is only 4411 unique key rows. Rest have the same primary key and thus are skipped. I cant replace into because all the columns are present in the csv. I need to do (in mongodb terms Upsert). Basically my question is what is the best method to update the existing columns like a ON DUPLICATE KEY during an insert for bulk csv file loading. Database is Mysql Data: goes on and on haha. Was thinking maybe since they are mainly tiny ints changing Am I on the right track here? |
Nonclustered index is faster than clustered index? Posted: 18 Jun 2013 07:23 PM PDT Both tables have same structure and 19972 rows in each table. for practicing indexing, i created both tables having same structure and created and and table structure Why clustered index takes 62% and non clustered 38%? |
Central stored procedure to execute in calling database context Posted: 18 Jun 2013 09:21 AM PDT I am working on a customized maintenance solution using the For example (code at bottom):
The reason I want this procedure specifically on database three is because I'd prefer to keep all maintenance objects within the same database. I'd like to have this job sit in the maintenance database and work as if it were in that application database. Code: |
How to add column to big table in MySQL Posted: 18 Jun 2013 10:45 AM PDT I'm php developer so dont be strict. I have a big table ~5.5gb dump. Our PM decided to make new column in it to perform new feature. Table is InnoDB So what i tried:
What are other options to accomplish this and speed performance(i can do it with php script, but it will took ages). What will be performance of Thanks for any advance. |
Create a trigger to update table data on another Server's database Posted: 18 Jun 2013 06:36 PM PDT I am creating a trigger in MySQL and I need a little help. I have 2 websites, 2 databases (same name) on 2 different web servers, S1 & S2. These databases have the same tables names. I want both the user data on both the websites to be the same. So if one user registers on S1, then that user registration information should be passed to S2. If a user registration information is updated on S1, the same information should be updated on S2. And the same applies for S2. How can I create a trigger so that every time there is an insert / update / delete in database on S1, then the user table on S2 also gets automatically updated. And every time there is an insert / update / delete in database on S2, then the user table on S1 also get automatically updated. Is this possible? Could you provide some examples? |
How to properly clean Merge Replication Setup Posted: 18 Jun 2013 12:46 PM PDT What is the proper way to completely clean Merge Replication setup ? I have tried to delete the subscriptions, then delete the publication then "Disable Publishing & Distribution" & delete the distribution database then started setting up the replication again. unfortunately, after that I discovered that dbo.msmergesubscriptions table still have old records about old subscriptions I used to have before 2 years !! Is there any official documentation about how to properly & totally clean Merge Replication setup? |
PostgreSQL LDAP authentication Posted: 18 Jun 2013 09:15 AM PDT We are setting up a PostgreSQL 9.1 database at work. There are no classified data in the database, but we want to know who is doing what. We are using LDAP authentification on the network, so we would like to use that for the database as well, but according to the documentation, all users anyhow need to be defined as database users. We could of course do a "dump" of users to the database, but we would prefer if it could be possible to define users in the database as soon as they have authenticated in LDAP. This would not be too difficult using a wrapper script, but is it somehow possible to do this directly? (Most users log in using |
Tool to export data with all relational data? Posted: 18 Jun 2013 04:32 PM PDT Is there a tool to export data from selected rows in a table with all data stored in other tables in other tables linked by relational design? The purpose is to ease migrations of bits of data between servers for adhoc migrations. I am looking specifically for a tool for MySQL InnoDB with defined foreign keys. |
mysql: need help to optimize my query/table Posted: 18 Jun 2013 09:32 AM PDT I'm wondering if someone could help me optimize my tables/query to speed up a query. It is currently running ridiculously slow. I think a well-thought out index could help me. Any help would be really appreciated Tables URLS and TAGS mentioned below are 2 and 20 million rows respectively (will probably end up having 10x). A query like the one below already takes 10 seconds to run. An Example: http://whatrethebest.com/php+tutorials Tables and QUERY EXPLAIN I'm not sure what this shows So I think the problem is: certain tags like 'php have 34,000 entries, most of which only have under 5 saves. But in order to get the 20 most saved it is having to sort them all.Right? I can't really create a 'numsaves' column in TAGS and index on that because that number will be changing up and down, and that wouldnt make sense. Is it possible to create a cross-table index between urls.numsaves and tags.tag? Or a third table to use in my query somehow? Would this solve my problem? I know almost nothing about indexing. Any help would be really appreciated! EDITS BELOW RESPONSE TO YperCube: Thank you, Thank you, your suggestions have sped up my queries by a factor of 10-20X . This is an immense improvement. I can't thank you enough. I'm posting my current queries and tables with execution times in case you or anyone else has any more optimization suggestions. I am worried that as my table grows I may not be able to keep my search times under 3 seconds, which would be a killer. New Query Example 1 Neq Query Example 2 (seems to be slower) Using Query Example on a Single Tag (slower by a lot) I'm not sure why this one is so much slower? Do you have any ideas of a query to optimize for querying a single tag? My Current Tables Thank you again |
Posted: 18 Jun 2013 02:32 PM PDT I had to stop the slave server to test something. After I started the server again there is a problem with replication on MySQL server On the problematic server on the problematic server: on the main server: according to what I've read, there is a need to execute the following command om the main server: What will happen then? if there is any application connected to it - will it disconnect it also? |
Merge Replication identity field issues Posted: 18 Jun 2013 01:32 PM PDT One of our clients is using our software with merge replication of a database on a SQL Server 2008 R2 machine. There are two production environments in separate geographical locations only one of which is live at any one time, so basically one and live one on standby. Only the live database is updated by teh applications. Every couple of months they failover between the datacentres and the standby environment become the live centre. There is an instance of SQL Server 2008 in each datacentre and merge replication is used to keep them in sync. This was all working ok until the beginning of the year when we started getting replication errors with some The errors were like this one:
Then after the last failover we noticed we had an issue with the |
MySQL Slaves lag behind master Posted: 18 Jun 2013 03:32 PM PDT I have one master and four slaves. Sometimes all my slaves lag behind the master. I have implemented the I saw the slow queries (for today) on the master and I found that the slowest query (DML) was taking 138 seconds. But the slaves were lagging about 1400 seconds and there were also no slow queries on the slaves for DML (update, delete, insert, etc.). Points to be taken into consideration:
What may be the reason for lag? |
MySQL replication between VPS and shared host Posted: 18 Jun 2013 05:32 PM PDT I have a VPS where I have ssh access and shared host with CPanel. Both have MySQL. I need to create a master/slave setup among the two server. As per this tutorial: How To Set Up Database Replication In MySQL, I will need to modify the Is it possible to achieve this with the following permissions on both the servers?
|
Posted: 18 Jun 2013 08:32 PM PDT My postgres server is running in a windows server and three tablespace are created. Postgresql server is installed in C: drive and the tablespaces are in D: and E: drive. So how to take a backup and restore. Is it similar to normal backup and while restore, in another machine, do i need to have the same setup or i can restore it in a single drive? From the tablespace folder, is it possible to retreive information for only one table which is huge? |
How do I make a date set in Analysis Services Tabular Model Posted: 18 Jun 2013 10:51 AM PDT In SQL Server 2012 Analysis Services Tabular, how do I make a Rolling 12 Month set so a user can select it? |
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