AWS RDS – SQL Server管理

In this article, we will review common database administration tasks for AWS RDS (Relational Database Service) SQL Server instance. RDS does not provide access to some of the system procedures and tables that require advanced privileges. So, we cannot perform all the administration tasks on the RDS SQL Server instance.

在本文中,我们将回顾AWS RDS(关系数据库服务)SQL Server实例的常见数据库管理任务。 RDS不提供对某些需要高级特权的系统过程和表的访问。 因此,我们无法在RDS SQL Server实例上执行所有管理任务。

When we launch a database instance running on the SQL Server engine in RDS, the instance comes with the default database “rdsadmin”. The databases “msdb” and “rdsadmin” have few stored procedures which start with “rds_” to manage the databases and instance. Below are some of the administration tasks that can be done RDS SQL Server instance using stored procedures in “msdb” and “rdsadmin” database.

当我们启动在RDS中SQL Server引擎上运行的数据库实例时,该实例附带默认数据库“ rdsadmin”。 数据库“ msdb”和“ rdsadmin”几乎没有以“ rds_”开头的存储过程来管理数据库和实例。 以下是一些RDS SQL Server实例可以使用“ msdb”和“ rdsadmin”数据库中的存储过程完成的管理任务。

It is assumed that the reader has basic knowledge about AWS RDS with SQL Server.

假定读者具有有关带SQL Server的AWS RDS的基本知识。

使数据库联机 (Bringing database online)

Taking the database offline in AWS RDS SQL Server instance is like taking a database offline in an on-premises SQL Server instance. i.e. Login to the SQL Server using SSMS (SQL Server management studio and navigate to the database. Right click on the database -> Tasks -> Take Offline.

在AWS RDS SQL Server实例中使数据库脱机就像在本地SQL Server实例中使数据库脱机。 例如,使用SSMS登录到SQL Server(SQL Server管理工作室,然后导航到数据库 。右键单击数据库-> 任务 -> 脱机。

Also, you can use below T-SQL script to take the database offline. Replace AdventureWorks with the name of your database.

另外,您可以使用下面的T-SQL脚本使数据库脱机。 用数据库名称替换AdventureWorks

ALTER DATABASE AdventureWorks SET OFFLINE WITH
ROLLBACK IMMEDIATE

When you try to bring the database online using SQL Server management studio, it throws an error as shown in the below image.

当您尝试使用SQL Server Management Studio使数据库联机时,它将引发错误,如下图所示。

Set database online.

Similarly, we cannot bring the database online using T-SQL script as well.

同样,我们也无法使用T-SQL脚本使数据库联机。

Error on setting the database online in SSMS.

To bring the database online in AWS RDS SQL Server instance, use the stored procedure called “rds_set_database_online” which is in “rdsadmin” database.

要使数据库在AWS RDS SQL Server实例中联机,请使用“ rdsadmin”数据库中名为“ rds_set_database_online”的存储过程。

Please refer to the below T-SQL Script. Replace AdventureWorks with the name of your database.

请参考下面的T-SQL脚本。 用数据库名称替换AdventureWorks。

EXEC rdsadmin.dbo.rds_set_database_online 'AdventureWorks'

读取错误日志 (Reading error log )

We cannot use “xp_readerrorlog” on RDS SQL Server instance to read error log. Instead

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值