Skip to content

Commit ddabb28

Browse files
Merge pull request #176608 from Misliplavo/sql-mi-crud
Added restore to faq
2 parents 3983f95 + b82ef3a commit ddabb28

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

articles/azure-sql/managed-instance/frequently-asked-questions-faq.yml

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ sections:
7373
answer: |
7474
### Where can I find known issues and defects?
7575
76-
For product defects and known issues, see [Known issues](doc-changes-updates-known-issues.md).
76+
For product defects and known issues, see [Known issues](doc-changes-updates-known issues.md).
7777
7878
- question: |
7979
New features
8080
answer: |
8181
### Where can I find latest features and the features in public preview?
8282
83-
For new and preview features, see [What's new](doc-changes-updates-release-notes-whats-new.md).
83+
For new and preview features, see [Release notes](doc-changes-updates-release-notes-whats-new.md).
8484
8585
- question: |
8686
Create, update, delete or move SQL Managed Instance
@@ -112,7 +112,31 @@ sections:
112112
### How much time does it take to create or update an instance, or to restore a database?
113113
114114
Expected time to create a new managed instance or to change service tiers (vCores, storage), depends on several factors. See [Management operations](sql-managed-instance-paas-overview.md#management-operations).
115-
115+
116+
- question: |
117+
Create, update, delete or move database
118+
answer: |
119+
### Can I drop and recreate a database on a managed instance using the same database name?
120+
121+
Restoring each database is guaranteed during the entire defined retention period. This even applies to databases that were created and then deleted after only a few seconds. When a database is created, deleted, or restored, backups are taken at different intervals to preserve the data so it's possible to restore during the given retention period. If a database is dropped before a backup operation completes, the drop operation may be blocked with the following error:
122+
123+
`Message database 'backup_restore_db_lkg_native_restore' already exists. Choose a different database name.`
124+
125+
To avoid this error, check the state of the drop operation before recreating a database with the same name (see [sys.dm_operation_status](/sql/relational-databases/system-dynamic-management-views/sys-dm-operation-status-azure-sql-database?view=azuresqldb-current&preserve-view=true) for more information). Once the operation state shows **Completed**, it's possible to RESTORE or CREATE a database with the same name.
126+
127+
The following common use cases are likely to encounter this error:
128+
129+
* If multiple databases are dropped and created again with the same name in short succession.
130+
When a database is dropped, the remaining tail-end of the transaction log is backed up synchronously before the drop operation finishes, as the image shows:
131+
132+
![Tail log backup](./media/frequently-asked-questions-faq/tail-log-backup.png)
133+
134+
It's not possible to create a database with the same name until the [tail-log is backed up](/sql/relational-databases/backup-restore/tail-log-backups-sql-server) and the drop operation completes. The sequential nature of the drop operation puts databases dropped in short succession into a queue, which can prolong the process of dropping the databases and delays the possibility of creating new ones using the same name.
135+
136+
137+
* If a database is restored and dropped before a full backup is created.
138+
When a database is restored, the first step of the restoration process is to take a new full backup of the database. If you try to restore a database, and then drop it immediately before the full backup completes, you will not be able to drop the database and create another database with that same name until the full backup is taken, and the database drop operation completes. Depending on the size of the database, the full backup could take hours.
139+
116140
- question: |
117141
Naming conventions
118142
answer: |
6.15 KB
Loading

0 commit comments

Comments
 (0)