sql-server-administration

SQL Server 2016 _can't start mirror

折月煮酒 提交于 2020-01-24 12:48:26
问题 After upgrading SQL Server 2014 to SQL Server 2016 (both Enterprise editions), I can't start mirror. This works normally on SQL Server 2014. After I restore (WITH NORECOVERY) mirror database with full and log backups of primary database I normally run configure setup . After click on Start mirror I get this error: Database 'DatabaseName' cannot be open. It is in the middle of a restore. (Microsoft SQL Server, Error:927) 回答1: Issue with SQL 2016 GUI. Its worked with TSQL commands. Mirror

SQL Batched Delete

血红的双手。 提交于 2019-12-21 07:36:13
问题 I have a table in SQL Server 2005 which has approx 4 billion rows in it. I need to delete approximately 2 billion of these rows. If I try and do it in a single transaction, the transaction log fills up and it fails. I don't have any extra space to make the transaction log bigger. I assume the best way forward is to batch up the delete statements (in batches of ~ 10,000?). I can probably do this using a cursor, but is the a standard/easy/clever way of doing this? P.S. This table does not have

SQL Batched Delete

孤街醉人 提交于 2019-12-04 01:46:48
I have a table in SQL Server 2005 which has approx 4 billion rows in it. I need to delete approximately 2 billion of these rows. If I try and do it in a single transaction, the transaction log fills up and it fails. I don't have any extra space to make the transaction log bigger. I assume the best way forward is to batch up the delete statements (in batches of ~ 10,000?). I can probably do this using a cursor, but is the a standard/easy/clever way of doing this? P.S. This table does not have an identity column as a PK. The PK is made up of an integer foreign key and a date. You can 'nibble'