Windows Azure Learning Note (4) - Updating

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值