Index Management And Effects On Database Availability
May 26, 2008
Hello
I'm working on an application which is mainly used to look up compressors and their data which are held in documents.
This is a simplified representation of the tables of importance:
Document
--------
Id (int, identity) (PK)
Number (nvarchar(50))
Compressor
----------
DocumentId (int) (PK, FK)
Id (int, identity) (PK)
Name (nvarchar(50))
CompressorData
--------------
CompressorId (int) (PK, FK))
Id (int, identity) (PK)
Value (nvarchar(50))
The tables are linked as follows:
Document -> Compressor -> CompressorData
Non clustered indexes are created on Document.Number and Compresor.Name because these fields are used for querying.
At certain points corrections will be released on compressors which
will result in:
- Creating new documents with new document numbers (note that a non clusterd index exists on Document.Number).
- Copying affected compressors of existing documents into the new documents (note that a non clusterd index exists on Compressor.Name).
- Copying the data of the affected compressors into the new documents.
This can result in creating ten's of new documents and copying hundreds compressors and thousands compressor data records.
My question:
Will the users still be able to query for compressors while corrections are released (thinking about indexes which need to be modified) or will their be so many locks held that the database becomes unusable?
I'm working on an application which is mainly used to look up compressors and their data which are held in documents.
This is a simplified representation of the tables of importance:
Document -------- Id (int, identity) (PK) Number (nvarchar(50))
Compressor ---------- DocumentId (int) (PK, FK) Id (int, identity) (PK) Name (nvarchar(50))
CompressorData -------------- CompressorId (int) (PK, FK)) Id (int, identity) (PK) Value (nvarchar(50))
The tables are linked as follows: Document -> Compressor -> CompressorData
Non clustered indexes are created on Document.Number and Compresor.Name because these fields are used for querying.
At certain points corrections will be released on compressors which will result in: - Creating new documents with new document numbers (note that a non clusterd index exists on Document.Number). - Copying affected compressors of existing documents into the new documents (note that a non clusterd index exists on Compressor.Name). - Copying the data of the affected compressors into the new documents.
This can result in creating ten's of new documents and copying hundreds compressors and thousands compressor data records.
My question:
Will the users still be able to query for compressors while corrections are released (thinking about indexes which need to be modified) or will their be so many locks held that the database becomes unusable?
Hi,Does a database restoration perform anyupdate-statistics/defragmentation by default. We observed a markedimprovement in performance when we restored the a database from an highend machine to a low machine.Could someone shed some light on this.Regards,Thyagarajan Delli.
We have multiple SQL 2012 SQL servers setup in an alwaysOn availability groups. Where should we schedule the re-index? We have Server1 as the primary and 2 secondaries Server2 and Server3. Are their any tricks to have it run on which ever one is the primary?
We are using SQL2005. I have a stored proc that runs a Select query based on a complex view. The sproc has two input date parameters (StartDate and EndDate). We are experiencing SQL timeout problems when the sproc is run with certain Start and End Dates. We have run the SQL Profiler and created a trace (trc) file (We've used the 'Default' trace configuration). We have used the trace file in SQL Server Management Studio to try and automatically create indexes on some of our tables. Unfortunatly SQL Server Management does not make any index recommendations. I think we are not capturing the right information in our trace file to allow SQL Server Management Studio to do its job. How do I use SQL Profiler to capture a trace of my sprocs query, so that it can be used by SQL Server Management Studio, to recommend index changes? Any help appreciated. Reagrds, Paul.
I'm trying to use a udt in a table creation, and everything works as expected, right until the moment where I rightclick on [Indexes] to create a new index.
Then I get this error:
TITLE: Microsoft SQL Server Management Studio ------------------------------ Cannot show requested dialog. ------------------------------ ADDITIONAL INFORMATION: Cannot show requested dialog. (SqlMgmt) ------------------------------ Object reference not set to an instance of an object. (SqlManagerUI) ------------------------------ BUTTONS: OK ------------------------------
CREATE FULLTEXT INDEX ON table_name [(column_name [TYPE COLUMN type_column_name] [LANGUAGE language_term] [,...n])] KEY INDEX index_name [ON fulltext_catalog_name] [WITH {CHANGE_TRACKING {MANUAL | AUTO | OFF [, NO POPULATION]}} ]
But where and how can I create it graphically in management Studio for 2005?
I have a large db that goes through regular maintenance every week. The problem seems to be that while the db is re-indexing some of my key tables I get time out errors. Are there any suggestions on how I can combat this problem. Management has tasked me with having 24 hour access to the db because if people aren’t completing there transactions we don’t get paid. I have also noticed the timeout issue when we are running in files that create new records. Is this a basic problem with the way the db is structured? Are they any tools that I can use to change our process so that we can maintain the 24 hour access to the db. How are other companies maintaining 24 hour access to there db?
i want to check the new username check availability from database in a same page ,i did in normal coding i need ajax or java scripts method because this page look and feel is not good thanks, @mbi
I am developing a .Net application for a Guest house for my final year project. I'm using C# and SQL Server. I want a way to look up if a room is available or not on a particular date.
First I came up with... Room: Room_id(PK), Room_type, Room_rate_pp, Room_availability
but how can I distinguish whether a room is available on a particular date? I think Room_availability is useless in this table because it can't do this. Do I need some sort of calendar table or something?
Your help with this would be greatly appreciated. it's annoying me so much, and I can't move on with the project until I have my database finalised :eek:
I been trying to learn availability groups since I have not implemented it.
From my understanding you can have more than one group.
Lets pretend we have two groups in one instance:
1. Accounting 2. Engineering
From my understanding you can't make a database in two AG because it wouldn't make sense.
But lets pretending there is one database that both are used by accounting and engineering.
Would you have to make a third AG for future fail overs so that other databases in the other two group don't failover when not needed because when you fail over an AG all the databases inside it fail over.
SQL 2012 EnterprisePrimary server and 2 x secondary serversWindows 2012 R2
I have removed one of the database from availability group by mistake. Luckily I am still operational with primary server. database on secondary servers are on restoring mode.
I have done full backup of database from primary (prod) server and restored on secondary servers with no recovery when I add database into availability group I get an error message log missing what is the best method to achieve and add database again into availability group.
Note I cannot restore database on primary server as it is on production
I would like implementing a database mirroring architecture with SQL server 2005 but i have questions.
If i don't use a cluster architecture, i would like knowing if there's any solution to move the alias SQL server from the primary to the secondary by script.
I need to know if it is possible, and if so, the effects of restoring databases from a server running SQL Enterprise Edition to a server running SQL Standard Edition. There will be an application database as well as the "master" database to be restored.
If I encrypt the SQL Procedures in my database will that cause any sideeffects?Will there be performance degradation?Is it good to encrypt them or they can easily be unencrypted?Thank you
Hello.. When I used Microsoft SQL Server 2005 Management Studio Express to Create FULL TEXT INDEX by this code:
CREATE FULLTEXT INDEX ON txtfilestbl(txtfile) KEY INDEX PK_txtfilestbl ON ForumsArchiveLibCtlg WITH CHANGE_TRACKING AUTO
It returns this ERR MSG:
Informational: No full-text supported languages found. Informational: No full-text supported languages found. Msg 7680, Level 16, State 1, Line 1 Default full-text index language is not a language supported by full-text search.
I Use same this code to create FULL TEXT INDEX by using Microsoft SQL Server 2005 Management Studio, and it was working properly. What I have to do?
I've got an availability group with multiple databases, replicating to multiple secondary servers. On one of the secondary servers, some of the databases are not synchronising, and when we try re-establish the sync we get an LSN error. I can't see any obvious way to re-establish only one database on one secondary without affecting all databases on that secondary or affecting that database on all secondary nodes.
The options I seem to have are to either remove the database and then re-add it, in which case this affects all secondary replicas, or to remove the secondary replica and add it, in which case all the DBs are added.
We are planning to upgrade our production servers from mirroring to alwayson. Our current mirror setup gives the advantage that it can failover a single database.To have a similar setup in alwayson we are probably going to create an availability group per database. Any other disadvantage in this except for the extra initial configuration work?
In SQL7, if you add a column to a table, is it necessary to recompile all stored procs that reference that table? Under 6.5, this caused problems at our site unless the Procs were 'refreshed'. Is this only necessary where select * is used? Thanks
hi, if I install sql server 7.0 and created a user database named myDB that has some data. and I make a back up as a complete database.. Then I uninstall sql server,yet I am still having the backup in another drive. Then I install sql server 7.0. Can I use the restore method to restore myDB with no problems.
I like this forum but recently I have noticed they are running ads with sound effects.
I like a lot of programmers I know listen to music through their computer with headphones on all day. Whenever one of those adds fire off it about scares the BeJesus of me and comes through louder than the music. I am playing with my settings but I each time I find one that kills the sound effects it kills the music too.
I need to move files for a lot of databases that are all part of an AG. I've used the method at the bottom of this link with success on a small test DB.
Discovered that a geo-spatial AlwaysOn HA database (1 of 4) was not synchronizing as at a point in time earlier in the day. Suspend Data Movement appears to be working perpetually without finishing. The SQL Server services is in a Pending Changes state after an attempt to restart it from SQL Configuration Manager. The Cluster Dashboard says it is in a Not Synchronizing state, with only the one database in question having a yellow triangle, all 3 others show green.
The warning for the cluster is:At least one availability database on this availability replica has an unhealthy data synchronization state. If this is an asynchronous-commit availability replica, all availability databases should be in the SYNCHRONIZING state. If this is a synchronous-commit availability replica, all availability databases should be in the SYNCHRONIZED state. There is no abnormal data movement from the primary to the seconday.The warnings for the unhealthy database are:
The data synchronization state of this availability database is unhealthy. On an asynchronous-commit availability replica, every availability database should be in the SYNCHRONIZING state. On a synchronous-commit replica, every availability database should be in the SYNCHRONIZED state.Either a database administrator or the system has suspended data synchronization on this availability database.So how to get this database back to synchronizing state?
Backing up all databases on a sql server that hosts secondary high availability databases as well as other databases. The other databases back up fine, but the high availability secondaries all get the same error:
BackupDiskFile::OpenMedia: Backup device 'F:MSSQLBackupdbnamedbname_backup_2015_MM_DD_tttttt_ttttttt.bak' failed to open. Operating system error 2(The system cannot find the file specified.)
I have a situation where I have two servers in SQL Server 2012 R2 AlwaysOn Availability Group. One is primary and the other one being secondary. I am only running SharePoint Database on it.I have run out of space on the primary server and about to run out of space at the secondary server. I have tried shrinking database transaction log files, but it returns an error that it cannot be shrunk as the database is in the AlwaysOn Availability Group.
Questions: 1. Several forums suggest that databases need to taken out of AlwaysOn Availability Group in order for the shrinking to work properply? 2. Would it have any impact on the database if it is taken out of availability group and then added back?
I have configured replication between Always ON Availability Groups (Listener) (PUBLISHER), remote distributor to XYZ SUBSCRIBER...with above link ...
Now, I want to know how to replicate Data from XYZ SERVER a PUBLISHER to Always ON Availability Groups (Listener) (SUBSCRIBER)? Distributor Database being on XYZEX:
XYZ SQL SERVER as PUBLISHER, and DISTRIBUTOR to Always ON Availability Groups (Listener) SUBSCRIBER...
need to migrate a cluster with an AG dtabases to new data center cluster with AG.
I was wondering if is possible to do mirroring on top of the AG configuration? or what other options could be to migrate a cluster that has 3 nodes and setup the ag databases to a new datacenter.
This is my first deployment of an always on availability group for SQL 2014 and I'm trying to get my custom backup procedure to handle all databases appropriately depending on the primary group. Basiscally I want the system databases and all databases that don't participate in the availability group to be backed up on both nodes and those that do participate backed up ONLY on the primary server. I've looked at the sys.fn_hadr_backup_is_preferred_replica funcation, but would like to only have to test for a single databases existance in the availability group. If the one database is in the group, only backup the system databases and those that don't participate, otherwise backup everydatabase. This would be the case for both full backups and transaction logs.