azure云数据库

In this article, we will review options called LOCKS in Azure SQL database and Azure SQL Server that are used to protect databases or servers from accidental deletes or configuration changes.

在本文中,我们将介绍Azure SQL数据库和Azure SQL Server中称为LOCKS的选项,这些选项用于保护数据库或服务器免遭意外删除或配置更改。

Azure provides a feature called locking that allows us to lock the resource group or the subscription or the resources and prevent from accidental deletes or configuration changes.

Azure提供了一种称为锁定的功能,该功能使我们可以锁定资源组或订阅或资源,并防止意外删除或配置更改。

Azure provides two types of locks one is the Delete lock that prevents resources, subscriptions and resource groups being deleted. Another one is Read-only that prevents users from updating the resource, resource group, and the subscription.

Azure提供了两种类型的锁,一种是“ 删除”锁,可以防止删除资源,订阅和资源组。 另一个是只读的 ,可以防止用户更新资源,资源组和订阅。

使用Azure门户在Azure SQL数据库上创建LOCKS。 (Creating LOCKS on an Azure SQL database using the Azure portal.)

Log in to the Azure portal and navigate to SQL databases. Click on the database.

登录到Azure门户并导航到SQL数据库。 点击数据库。

In the database details page, Click on Locks under the Settings section.

在数据库详细信息页面中,单击“ 设置”部分下的 锁定

Click on the Add button to add a new lock.

单击添加按钮以添加新锁。

Enter the name of the Lock. In this case, I want to protect the database from accidental deletes. So, I selected the Lock type as Delete. Enter the notes or you can leave it blank and click on OK.

输入锁的名称。 在这种情况下,我想保护数据库免遭意外删除。 因此,我选择了Lock类型作为Delete 。 输入注释,也可以将其保留为空白,然后单击“ 确定”。

Now let us try deleting the database. Navigate to the SQL database page. Select the database on which you created the Delete lock and click on the Delete button.

现在让我们尝试删除数据库。 导航到“ SQL数据库”页面。 选择在其上创建了删除锁的数据库,然后单击删除按钮。

Type Yes in the confirmation text box and click on the Delete. It throws an error saying the database cannot be deleted due to Delete lock placed on the database.

在确认文本框中键入yes,然后单击删除 。 它引发错误,表明由于数据库上的“ 删除”锁而无法删除数据库。

Let us try updating the database configuration when we have an active Delete lock on the database.

当数据库上有活动的Delete锁时,让我们尝试更新数据库配置。

Navigate to the SQL databases. Click on the database and click on Configure under the settings section.

导航到SQL数据库。 单击数据库并根据设置部分点击配置

For demo purpose, I am just changing the Data max size from 500 MB to 100 MB. Click on Apply.

出于演示目的,我只是将数据最大大小从500 MB更改为100 MB。 单击“ 应用”

Updating the configuration of the database is successful. Please refer to the below image.

数据库配置更新成功。 请参考下图。

When we place a Delete lock on the database, we can read and update the database but cannot delete the database.

当我们在数据库上放置删除锁时,我们可以读取和更新数据库,但不能删除数据库。

Let us check how the Read-only lock behaves on the database. I deleted the Delete lock that is created above. To create a read-only lock, follow the above steps and select the lock type as Read-only.

让我们检查一下只读锁在数据库上的行为。 我删除了上面创建的删除锁。 要创建只读锁,请按照上述步骤操作,然后将锁类型选择为只读

Now we have only “Read-only” lock on the Azure SQL database.

现在,我们在Azure SQL数据库上只有“只读”锁。

Deleting the Azure SQL database with read-only lock: I tried deleting the Azure SQL database that has only one lock i.e. Read-only. The delete operation failed with an error as shown in the below image.

删除具有只读锁的Azure SQL数据库:我尝试删除仅具有一个锁(即只读)的Azure SQL数据库。 删除操作失败,并显示错误,如下图所示。

Let us try updating the configuration of the database when the database has a ‘Read-only’ lock. I am scaling the database from Basic 100 MB storage to Basic 50 MB storage. The scaling operation failed with an error as shown in the below image.

当数据库具有“只读”锁时,让我们尝试更新数据库的配置。 我正在将数据库从Basic 100 MB存储扩展到Basic 50 MB存储。 缩放操作失败,并显示错误,如下图所示。

When we have Read-only lock on the database we cannot modify or delete the Azure SQL database.

当我们在数据库上拥有只读锁时,我们将无法修改或删除Azure SQL数据库。

使用Azure门户在Azure SQL Server上创建锁 (Creating LOCKS on an Azure SQL Server using the Azure portal)

We can also create locks at Azure SQL server level. To create locks on the Azure SQL server, navigate to the All Resources page and click on the Azure SQL server.

我们还可以在Azure SQL服务器级别创建锁。 若要在Azure SQL服务器上创建锁,请导航到“ 所有资源”页面,然后单击Azure SQL服务器。

Creating locks on the Azure SQL server is like creating locks in the Azure SQL database. Please follow the above steps.

在Azure SQL服务器上创建锁就像在Azure SQL数据库中创建锁。 请按照上述步骤。

When we create lock at the server level, the databases on the server inherits the locks and the rule applies on all the database on the server. Please refer to the below image for locks that are inherited from the server.

当我们在服务器级别创建锁时,服务器上的数据库将继承锁,并且该规则将应用于服务器上的所有数据库。 请参阅下图,了解从服务器继承的锁。

We can not modify or delete the parent locks from child resources. i.e. the locks that are created on the Azure SQL server cannot be modified or deleted from the Locks page at the Azure SQL database.

我们无法从子资源中修改或删除父锁。 也就是说,不能在Azure SQL数据库的“锁定”页面上修改或删除在Azure SQL服务器上创建的锁定。

In this case, the Read-only lock is placed at the Azure SQL Server level that will not allow us to modify or delete the Azure SQL server and all the databases on the server.

在这种情况下,只读锁位于Azure SQL Server级别,不允许我们修改或删除Azure SQL服务器以及该服务器上的所有数据库。

Locks placed at parent resources are inherited to newly created child resources. For example, if we place a delete lock on the Azure SQL server and if add a new Azure SQL database on the same server, the newly created database will also inherit the delete lock.

放置在父资源上的锁将继承到新创建的子资源。 例如,如果我们在Azure SQL服务器上放置删除锁,并且在同一服务器上添加新的Azure SQL数据库,则新创建的数据库也将继承删除锁。

管理资源组中的锁 (Managing the locks from the Resource group)

To view all the locks placed on child resources in a resource group. Navigate to the Resource groups page. Click on the Resource group name

查看放置在资源组中子资源上的所有锁。 导航到“ 资源组”页面。 单击资源组名称

Click on Locks under the Settings section. You can view the locks on all the resources in that specific resource group. Please refer to the below image. We can see the lock created on the Azure SQL Server and the lock created on Azure SQL database.

单击设置部分下的锁定 。 您可以查看该特定资源组中所有资源的锁定。 请参考下图。 我们可以看到在Azure SQL Server上创建的锁和在Azure SQL数据库上创建的锁。

We cannot add locks on the child resources from the Resource group page. But, we can delete the locks on child resources.

我们无法通过“资源”组页面在子资源上添加锁。 但是,我们可以删除对子资源的锁定。

结论 (Conclusion)

In this article, we explored how to configure locks on the Azure SQL database and the Azure SQL Server with different examples to protect databases from accidental deletion on Azure. In case you have any questions, please feel free to ask in the comment section below.

在本文中,我们通过不同的示例探讨了如何在Azure SQL数据库和Azure SQL Server上配置锁,以保护数据库免于在Azure上意外删除。 如果您有任何疑问,请随时在下面的评论部分中提问。

Please refer to the SQL Azure category to learn more about Azure SQL.

请参考SQL Azure类别以了解有关Azure SQL的更多信息。

翻译自: https://www.sqlshack.com/protecting-azure-sql-databases-from-accidental-deletion/

azure云数据库

azure云数据库_保护Azure SQL数据库免于意外删除相关推荐

  1. sql还原数据库备份数据库_如何获取SQL数据库还原历史记录

    sql还原数据库备份数据库 This article will review how to get information on your SQL database restore history, ...

  2. mysql如果存在则删除数据库_怎么判断sql数据库是否存在,存在删除

    展开全部 判断数据62616964757a686964616fe78988e69d8331333433623135库,如果存在则删除: IF (EXISTS(SELECT * FROM master. ...

  3. azure云数据库_使用Azure SQL数据库构建ASP.NET应用

    azure云数据库 In this article, you will learn about Azure SQL Database and its uses. Then the article sp ...

  4. SQL数据库挂起 SQL数据库附加报错 SQL数据库824错误修复

    SQL数据库挂起 SQL数据库附加报错 SQL数据库824错误修复 数据类型 MSSQL 2012 数据大小 4.5 GB 故障检测 附加数据库提示824错误 一般是由于断电非法关机导致页面损坏. 客 ...

  5. SQL数据库误删除表数据恢复 SQL数据库truncate表数据恢复

    SQL数据库误删除表数据恢复 SQL数据库truncate表数据恢复 误删除表需要恢复该表,要注意几个问题, 第一 删除表后是否新建表了 是否插入数据了. 第二 删除表后是否立即关闭SQL服务了/ 第 ...

  6. azure云数据库_在Azure SQL数据库中保护数据的五种方法

    azure云数据库 When storing data in the cloud the main concern companies generally have is whether or not ...

  7. azure云数据库_在Azure SQL数据库中实现动态数据屏蔽

    azure云数据库 In this article, we will review Dynamic Data Masking in the Azure SQL database. Dynamic Da ...

  8. azure云数据库_配置Azure SQL数据库防火墙

    azure云数据库 介绍 (Introduction) The Azure SQL Database firewall lets you decide which IP addresses may o ...

  9. azure云数据库_在Azure SQL数据库中配置电子邮件通知

    azure云数据库 In this article, we will review how to configure email notifications in the Azure SQL sing ...

最新文章

  1. 百度指数常见php框架,怎么导出数据到excel表格-如何将百度指数数据导出到Excel表格...
  2. php libev pthreads,libuv 与 libev 的对比
  3. 理解ROS节点---ROS学习第4篇
  4. php图片编辑失真,PHP处理图片固定大小 不失真 不变形
  5. Windows下IIS+PHP 5.2的安装与配置
  6. 一种无限循环轮播图的实现原理
  7. MFC_Combo_Box_用法(下拉框)
  8. Python 基础课程第四天
  9. Objective-C 相关Category
  10. MAC编译的JDK执行出错: [libjvm.dylib+0x482a49] PerfDataManager::destroy()+0xab
  11. 遥感影像数据下载网站整理
  12. EasyPR 环境配置
  13. SAP MTS/ATO/MTO/ETO专题之一:常用计划策略(需求类)
  14. 给惠普735g5 装Win10+Ubuntu 16.04双系统
  15. 税收学考试可以带计算机吗,税务师考试能带计算器和草纸吗?简答题需要用笔吗?...
  16. Createjs的控件 BitMap、MovieClip、Sprite
  17. [HNOI2007]紧急疏散evacuate
  18. 你还在找全国省市县大全吗
  19. 手游联运平台:游戏详情页介绍
  20. 01【刘立刚图形学笔记】_图形学整体概述

热门文章

  1. python算法学习代码_python 算法学习部分代码记录篇章1
  2. 利用Docker搭建Redis集群
  3. ISCC2018(misc)
  4. msp430项目编程44
  5. SNF快速开发平台MVC-各种级联绑定方式,演示样例程序(包含表单和表格控件)...
  6. ★LeetCode(453)——最小移动次数使数组元素相等(JavaScript)
  7. Linux---进程的基本概念
  8. 【Vue2.0】— 消息订阅与发布pubsub(二十)
  9. 【博客项目】—项目坏境搭建(一)
  10. CSS基本知识之复合选择器、元素显示模式、背景图片位置,精灵图