Skip to content

Commit a706990

Browse files
authored
Merge pull request #7027 from MicrosoftDocs/FromPublicRepo
Confirm merge from FromPublicRepo to master to sync with https://github.com/MicrosoftDocs/sql-docs (branch live)
2 parents 9a813d7 + 166cef7 commit a706990

3 files changed

Lines changed: 40 additions & 2 deletions

File tree

docs/linux/sql-server-linux-migrate-restore-database.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,44 @@ To restore the database backup, you can use the **RESTORE DATABASE** Transact-SQ
159159
160160
You should get a message the database is successfully restored.
161161
162+
`RESTORE DATABASE` may return an error like the following example:
163+
164+
```bash
165+
File 'YourDB_Product' cannot be restored to 'Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB_Product.ndf'. Use WITH MOVE to identify a valid location for the file.
166+
Msg 5133, Level 16, State 1, Server servername, Line 1
167+
Directory lookup for the file "Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB_Product.ndf" failed with the operating system error 2(The system cannot find the file specified.).
168+
```
169+
170+
In this case, the database contains secondary files. If these files are not specified in the `MOVE` clause of `RESTORE DATABASE`, the restore procedure will try to create them in the same path as the original server.
171+
172+
You can list all files included in the backup:
173+
```sql
174+
RESTORE FILELISTONLY FROM DISK = '/var/opt/mssql/backup/YourDB.bak'
175+
GO
176+
```
177+
You should get a list like the one below (listing only the two first columns):
178+
```sql
179+
LogicalName PhysicalName ..............
180+
----------------------------------------------------------------------------------------------------------------------
181+
YourDB Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB.mdf ..............
182+
YourDB_Product Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB_Product.ndf ..............
183+
YourDB_Customer Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB_Customer.ndf ..............
184+
YourDB_log Z:\Microsoft SQL Server\MSSQL11.GLOBAL\MSSQL\Data\YourDB\YourDB_Log.ldf ..............
185+
```
186+
187+
You can use this list to create `MOVE` clauses for the additional files. In this example, the `RESTORE DATABASE` is:
188+
189+
```sql
190+
RESTORE DATABASE YourDB
191+
FROM DISK = '/var/opt/mssql/backup/YourDB.bak'
192+
WITH MOVE 'YourDB' TO '/var/opt/mssql/data/YourDB.mdf',
193+
MOVE 'YourDB_Product' TO '/var/opt/mssql/data/YourDB_Product.ndf',
194+
MOVE 'YourDB_Customer' TO '/var/opt/mssql/data/YourDB_Customer.ndf',
195+
MOVE 'YourDB_Log' TO '/var/opt/mssql/data/YourDB_Log.ldf'
196+
GO
197+
```
198+
199+
162200
1. Verify the restoration by listing all of the databases on the server. The restored database should be listed.
163201
164202
```sql

docs/relational-databases/indexes/columnstore-indexes-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ When you create a table with the `CREATE TABLE` statement, you can create the ta
141141
|Create a table as a columnstore.|[CREATE TABLE (Transact-SQL)](../../t-sql/statements/create-table-transact-sql.md)|Beginning with [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)], you can create the table as a clustered columnstore index. You don't have to first create a rowstore table and then convert it to columnstore.|
142142
|Create a memory table with a columnstore index.|[CREATE TABLE (Transact-SQL)](../../t-sql/statements/create-table-transact-sql.md)|Beginning with [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)], you can create a memory-optimized table with a columnstore index. The columnstore index can also be added after the table is created by using the `ALTER TABLE ADD INDEX` syntax.|
143143
|Convert a rowstore table to a columnstore.|[CREATE COLUMNSTORE INDEX (Transact-SQL)](../../t-sql/statements/create-columnstore-index-transact-sql.md)|Convert an existing heap or binary tree to a columnstore. Examples show how to handle existing indexes and also the name of the index when performing this conversion.|
144-
|Convert a columnstore table to a rowstore.|[CREATE CLUSTERED INDEX (Transact-SQL) or DROP INDEX](../../t-sql/statements/create-columnstore-index-transact-sql.md)|Usually this conversion isn't necessary, but there can be times when you need to convert. Examples show how to convert a columnstore to a heap or clustered index.|
144+
|Convert a columnstore table to a rowstore.|[CREATE CLUSTERED INDEX (Transact-SQL)](../../t-sql/statements/create-columnstore-index-transact-sql.md#d-convert-a-columnstore-table-to-a-rowstore-table-with-a-clustered-index) or [Convert a columnstore table back to a rowstore heap](../../t-sql/statements/create-columnstore-index-transact-sql.md#e-convert-a-columnstore-table-back-to-a-rowstore-heap) |Usually this conversion isn't necessary, but there can be times when you need to convert. Examples show how to convert a columnstore to a heap or clustered index.|
145145
|Create a columnstore index on a rowstore table.|[CREATE COLUMNSTORE INDEX (Transact-SQL)](../../t-sql/statements/create-columnstore-index-transact-sql.md)|A rowstore table can have one columnstore index. Beginning with [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)], the columnstore index can have a filtered condition. Examples show the basic syntax.|
146146
|Create performant indexes for operational analytics.|[Get started with columnstore for real-time operational analytics](../../relational-databases/indexes/get-started-with-columnstore-for-real-time-operational-analytics.md)|Describes how to create complementary columnstore and btree indexes, so that OLTP queries use btree indexes and analytics queries use columnstore indexes.|
147147
|Create performant columnstore indexes for data warehousing.|[Columnstore indexes for data warehousing](~/relational-databases/indexes/columnstore-indexes-data-warehouse.md)|Describes how to use btree indexes on columnstore tables to create performant data warehousing queries.|

docs/t-sql/statements/create-trigger-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ END;
554554
```
555555

556556
### G. Viewing the events that cause a trigger to fire
557-
The following example queries the `sys.triggers` and `sys.trigger_events` catalog views to determine which [!INCLUDE[tsql](../../includes/tsql-md.md)] language events cause trigger `safety` to fire. `safety` is created in the previous example.
557+
The following example queries the `sys.triggers` and `sys.trigger_events` catalog views to determine which [!INCLUDE[tsql](../../includes/tsql-md.md)] language events cause trigger `safety` to fire. The trigger, `safety`, is created in example 'D', found above.
558558

559559
```sql
560560
SELECT TE.*

0 commit comments

Comments
 (0)