您的位置:首页 > 其它

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

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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: