Windows Azure Learning Note (4) - Updating
2011-12-23 13:09
274 查看
Moving an Existing Database to the Cloud
The SetForeignKeyEnabledStatus stored procedure will be used todisable foreign key
constraints during data migration. This will permit you to load your tables in whatever order is convenient without regard to primary key / foreign key relationships. You will run this stored procedure again when data migration is complete to re-enable
all of the foreign key constraints.
The SetIndexEnabledStatus stored procedure will be used todisable all non-clustered
indexes during data migration. This speeds up the data loading process. You will run this stored procedure again when data migration is complete to rebuild all of the non-clustered indexes.
ExportTableData.cmd
Note: Use the–n parameter to use the “native” file format for export.
The native formatimproves performance on import by avoiding unnecessary conversions. Use the–T parameter to connect to SQL Server using your Windows credentials.
ImportTableData.cmd
Managing Cache Expiration and Resource Versioning
// save to blob and set its TTL
dstBlob.Properties.ContentType = "image/jpeg";
dstBlob.Properties.CacheControl = "public, max-age=" + ttl.ToString("N0");
dstBlob.SetProperties();
Using Versioning to Invalidate Content Cached by the CDN
In order to changes propagated immediately to clients. First of all, you need to turn on "Query String" to the CDN
Content stored by a CDN edge server remains in its cache for as long as is specified by the Cache-Control header on the source blob. This means that clients requesting the resource receive a copy from the
server’s cache until the resource’s TTL expires. Only then does the server retrieve an updated copy from its source.
Notice that the URL of the image downloaded from the CDN includes a query parameter with a version number and that the image immediately updates to match the source image in blob storage despite the fact that
the remaining TTL is not yet zero. This confirms that,
because of the unique URL, the CDN is forced to request the image again from the Blob service.
The SetForeignKeyEnabledStatus stored procedure will be used todisable foreign key
constraints during data migration. This will permit you to load your tables in whatever order is convenient without regard to primary key / foreign key relationships. You will run this stored procedure again when data migration is complete to re-enable
all of the foreign key constraints.
The SetIndexEnabledStatus stored procedure will be used todisable all non-clustered
indexes during data migration. This speeds up the data loading process. You will run this stored procedure again when data migration is complete to rebuild all of the non-clustered indexes.
ExportTableData.cmd
bcp dbo.MyTableName out MyTableName.dat -n -S MySqlServerName -T
Note: Use the–n parameter to use the “native” file format for export.
The native formatimproves performance on import by avoiding unnecessary conversions. Use the–T parameter to connect to SQL Server using your Windows credentials.
ImportTableData.cmd
bcp dbo.MyTableName in MyTableName.dat -n -S myserver.database.windows.net -Umysqladminuser@myserver -Pmysqladminuserpassword -E
Managing Cache Expiration and Resource Versioning
// save to blob and set its TTL
dstBlob.Properties.ContentType = "image/jpeg";
dstBlob.Properties.CacheControl = "public, max-age=" + ttl.ToString("N0");
dstBlob.SetProperties();
Using Versioning to Invalidate Content Cached by the CDN
In order to changes propagated immediately to clients. First of all, you need to turn on "Query String" to the CDN
Content stored by a CDN edge server remains in its cache for as long as is specified by the Cache-Control header on the source blob. This means that clients requesting the resource receive a copy from the
server’s cache until the resource’s TTL expires. Only then does the server retrieve an updated copy from its source.
Notice that the URL of the image downloaded from the CDN includes a query parameter with a version number and that the image immediately updates to match the source image in blob storage despite the fact that
the remaining TTL is not yet zero. This confirms that,
because of the unique URL, the CDN is forced to request the image again from the Blob service.
相关文章推荐
- Self-learning:Overview of Updating a Windows Azure Service
- Windows Azure Learning Note (5)
- Windows Azure Learning Note (1)
- Windows Azure Learning Note (3)
- Windows Azure Learning Note (2)
- Windows Azure Diagnostics Note
- Learning note(3) for Windows powershell Tips
- Learning note(4) for windows powershell Tips
- Learning note(5) for windows powershell Tips
- Programming Windows Azure Note
- Self-learning:Synchronizing Files to Windows Azure Storage
- Windows Azure Virtual Network Connect & Traffic Manager Note
- Self-learning: Windows Azure Storage Analytics Released
- Windows Azure Appfabric ACS Note
- Need in Windows Azure (Updating)
- Windows Azure Platform 2nd Edition Note
- Microsoft Press Windows Azure Step by Step Note
- Windows Azure VM Role Note
- Windows Azure Platform 2nd Edition Note 2
- Windows Azure Appfabric Service Bus Note