Databases Reference
In-Depth Information
<DatabaseID>FoodMart 2008</DatabaseID>
<Password>2008</ Password>
</Object>
</Detach>
Attach
Attaching a database is a pretty straightforward operation. To attach a database to Analysis
Services, you need to specify a folder from which you will be attaching a database and
optionally a password and a ReadWriteMode property.
The ReadWriteMode property of the Attach command can assume one of the two values:
.
ReadOnly —The database is attached to Analysis Server in read-only mode.
.
ReadWrite —The default value for the property. The database is attached to Analysis
Server in read-write mode. The administrator is free to add\delete\process any of the
objects. The database is “exclusively” attached to an instance of Analysis Services,
and any attempt to attach it to another server instance will result in an error.
Let's consider an example where we detach the FoodMart 2008 database, copy it to the
C:\tmp folder, and attach it to Analysis Services.
Listing 25.7 shows the DDL of the Attach command to attach a FoodMart 2008 database
from C:\tmp folder.
LISTING 25.7
DDL to Attach a FoodMart 2008 Database
<Attach xmlns=”http://schemas.microsoft.com/analysisservices/2003/engine”>
<Folder>C:\tmp\FoodMart 2008.0.db</Folder>
<ReadWriteMode xmlns=”http://schemas.microsoft.com
/analysisservices/2008/engine/100”>ReadWrite</ReadWriteMode>
<Password>2008</Password>
</Attach>
In our sample DDL, we could have omitted the ReadWriteMode property. In this case, the
database is attached as read-write. In this example, we attached a database that was stored
in the C:\tmp\FoodMart 2008.0.db folder, which is outside of the Analysis Services data
directory. While executing this command, Analysis Services does not copy database files
into the Analysis Services's data folder, and all database data and metadata files remain in
the original directory.
If you try to attach a database without specifying a password, you will receive an error
message. In our example of trying to attach a password-protected FoodMart2008 database,
the error message would look like this: Errors in the encryption library: The file
\\?\ C:\tmp\FoodMart 2008.0.db\FoodMart 2008.detach_log is encrypted. You must
provide a password .
 
Search WWH ::




Custom Search