All Products
Search
Document Center

ApsaraDB RDS:Use a webshell to log on to the host on which an ApsaraDB RDS for SQL Server instance resides and use SSRS on the host

Last Updated:Aug 23, 2024

This topic describes how to use the host account of an ApsaraDB RDS for SQL Server instance to log on to the host on which the RDS instance resides and use SQL Server Reporting Services (SSRS) to manage the RDS instance.

Background information

ApsaraDB RDS for SQL Server supports webshell logon, which allows you to log on to the operating system of an RDS instance by using a webshell URL, and perform operations such as running commands and uploading or downloading files in the operating system. Webshells are a convenient and efficient approach to remotely manage and maintain RDS instances, especially in scenarios in which you cannot use an SSH client.

SSRS is an enterprise-level reporting service that is provided by Microsoft. SSRS can generate various types of reports for SQL Server databases and other data sources. The types of reports include tabular reports, chart reports, crosstab reports, and multi-dimensional data reports. SSRS can connect to an RDS instance and use the RDS instance as a data source to generate various types of reports. This helps enterprises and individual users manage and analyze data in a more efficient manner and generate various types of reports to support business decision-making and management.

Scenarios

For example, you are a database administrator for a small or medium-sized enterprise and manage the SQL Server databases of the enterprise. As workloads increase, database access requests also increase. To better manage and optimize the databases, you need to use SSRS to analyze and monitor the databases. However, the server of the enterprise is deployed in a different region, and you cannot directly log on to the server to perform operations.

In this case, you can create a host account in the ApsaraDB RDS console, use the host account to log on to the webshell, and then log on to the host on which your RDS instance resides. After you log on to the host, you can use SSRS to manage the SQL Server databases and monitor the databases.

Prerequisites

  • The RDS instance meets the following requirements:

    • The RDS instance runs RDS Basic Edition, RDS High-availability Edition, or RDS Cluster Edition. If your RDS instance runs RDS High-availability Edition, make sure that the instance runs SQL Server 2012 or later.

    • The RDS instance belongs to the general-purpose or dedicated instance family. The shared instance family is not supported.

    • The RDS uses the subscription or pay-as-you-go billing method. Serverless instances are not supported.

    • The RDS instance resides in a virtual private cloud (VPC). For more information about how to change the network type of an RDS instance, see Change the network type.

    • The creation time of the RDS instance meets the following requirements:

      • If the RDS instance runs RDS High-availability Edition or RDS Cluster Edition, the instance is created on or after January 01, 2021.

      • If the RDS instance runs RDS Basic Edition, the instance is created on or after September 02, 2022.

      Note

      You can view the Creation Time parameter of an RDS instance in the Status section of the Basic Information page in the ApsaraDB RDS console.

  • An Alibaba Cloud account is used to log on to the RDS instance.

  • The permissions to create a system admin account are granted. For more information, see Prerequisites.

  • A system admin account is created on the User Account tab. For more information, see Create a system admin account.

  • A host account whose account type is System Admin Account is created on the Host Account tab. For more information, see Create and use a host account for logons.

    Warning

    The system admin account has the highest permissions on the RDS instance. The host account has the highest permissions on the host. The highest permissions are beyond the management scope of ApsaraDB RDS for SQL Server. If you create a system admin account or a host account for your RDS instance, the service availability that is specified in the service level agreement (SLA) is no longer guaranteed for the RDS instance. However, you can use the RDS instance and obtain after-sales service as expected. If you do not create a system admin account or a host account for your RDS instance, the service availability that is specified in the SLA is guaranteed for the RDS instance.

Step 1: Use a webshell to log on to the host of an RDS instance

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.

  2. In the left-side navigation pane, click Accounts.

  3. On the page that appears, click the Host Account tab. Find the required host account and click Remote Connection (Primary) in the Actions column.

  4. In the Remote Connection dialog box, enter the password of the host account.

    image..png

  5. Click OK.

    The system generates a webshell URL and automatically connects to the host on which the RDS instance resides by using the URL. The system displays a webshell page in a pop-up window. The page may be blocked by the browser. If the page is blocked, you can configure the browser to allow the page to be displayed. The following figure shows an example.

    image..png

Step 2: Configure and use SSRS on the host

Prerequisites

Before you configure SSRS for the host on which the RDS instance resides, make sure that SQL Server Reporting Services (MSSQLSERVER) is enabled and running. For more information about how to view or change the status of SSRS, see View or modify the status of SSRS.

image..png

Usage notes

If your RDS instance runs RDS High-availability Edition or RDS Cluster Edition, the RDS instance is in the mirroring state or Always On availability group state. This may cause an error in the SSRS configuration. If the error occurs, you must use the system admin account to log on to the RDS instance and execute the required statements to resolve the error. For more information, see Create a system admin account.

Note

RDS instances regularly build images or availability groups. When you configure SSRS, multiple configuration errors may occur. To resolve the error, you must log on to the RDS instance by using the system admin account each time the error occurs and execute the following statements.

-- Execute the following statements to disable the image of the database on an RDS instance that runs RDS High-availability Edition:
ALTER DATABASE [ReportServer] SET PARTNER OFF;
ALTER DATABASE [ReportServerTempDB] SET PARTNER OFF;

-- Execute the following statements to remove the database from the ag-rds availability group of an RDS instance that runs RDS Cluster Edition:
ALTER AVAILABILITY GROUP [ag-rds] REMOVE DATABASE [ReportServer];
ALTER AVAILABILITY GROUP [ag-rds] REMOVE DATABASE [ReportServerTempDB];

These statements ensure that SSRS can be properly configured and run. If your RDS instance runs RDS Cluster Edition, you must use a system admin account to log on the RDS instance and execute the following statements to add the database to the availability group after SSRS is configured. This helps ensure high availability and proper database backup and restoration. For more information, see Create a system admin account.

ALTER AVAILABILITY GROUP [AG-RDS] ADD DATABASE [ReportServer]
ALTER AVAILABILITY GROUP [AG-RDS] ADD DATABASE [ReportServerTempDB]

Procedure

  1. Use the system admin account to log on to the RDS instance and execute the following statements:

    DISABLE TRIGGER [_$$_tr_$$_rds_alter_database] ON ALL SERVER;
    Note

    For more information about how to connect to an RDS instance, see Connect to an ApsaraDB RDS for SQL Server instance.

  2. Click the image..png icon and select Reporting Services Configuration Manager.

    image..png

  3. In the dialog box that appears, confirm the name of the report server and click Connect.

    image..png

    Note

    If your RDS instance runs RDS High-availability Edition or RDS Cluster Edition, you may fail to connect the RDS instance to a report server because the RDS instance is in the mirroring state or Always On availability group state. If the connection fails, you can resolve the issue based on Usage notes.

  4. In the left-side navigation pane, click Service Account and Web Service URL and configure the parameters based on your business requirements.

    image..png

    Note

    For more information, see official documentation.

  5. In the left-side navigation pane, click Database. On the right side of the page, click Change Database to create a report server database on the host.

    1. Select Create a new report server database and click Next.

    2. Confirm the server name, configure the following parameters, and then click Next.

      image..png

      Parameter

      Description

      Server Name

      The name of the server. The name cannot be changed.

      Authentication Type

      The authentication type. Select SQL Server Account.

      Username

      The username of the system admin account that is created for the RDS instance on the User Account tab.

      Password

      The password of the system admin account that is created for the RDS instance on the User Account tab.

    3. Enter a name for the report server database and select a language for the script. Then, click Next.

      image..png

    4. Specify the credentials for the account to connect to the report server and click Next.

    5. Confirm the information on the Summary page and click Next. Wait until the report server database is created. Then, click Finish.

      image..png

  6. Use the system admin account to log on to the RDS instance and execute the following statements:

    USE [master]
    GO
    -- Change the recovery model of the database to FULL. Use the NO_WAIT parameter to allow the change to immediately take effect.
    ALTER DATABASE [ReportServer] SET RECOVERY FULL WITH NO_WAIT
    GO
    ALTER DATABASE [ReportServerTempDB] SET RECOVERY FULL WITH NO_WAIT
    GO
    -- Enable a specific trigger on all databases on the server.
    ENABLE TRIGGER [_$$_tr_$$_rds_alter_database] ON ALL SERVER;
  7. Subsequent operations such as creating a data source vary based on your business requirements. For more information, see Step 6 to Step 8 in Install and use SSRS on an ECS instance or official documentation.

View or change the status of SSRS

  1. Log on to the host on which the RDS instance resides. In the search box, enter services.msc to open Services.

    image..png

  2. In the Services (Local) window, view the status of SQL Server Reporting Services (MSSQLSERVER).

    image..png

    Note

    SSRS supports the following startup types:

    • Manual: The service does not automatically start when the system starts and must be manually started.

    • Automatic: The service automatically starts when the system starts.

    • Automatic (Delayed Start): The service automatically starts a period of time after the system starts.

    • Disabled: The service is disabled and cannot be started.

  3. Optional. Change the status of SSRS and start the service.

    1. Double-click the service. In the dialog box that appears, change the value of the Startup type parameter.

      image..png

    2. Right-click the service. In the dialog box that appears, click Start.

      image..png

    3. View the new status of SSRS.

      image..png

FAQ

Can I call operations to obtain the hostname of my RDS instance and the webshell URL to connect to the host of my RDS instance?

Yes, you can call the DescribeDBInstanceIpHostname operation to obtain the hostname of your RDS instance, and then the DescribeHostWebShell operation to obtain the webshell URL to connect to the host of your RDS instance. The hostname is specified by the IpHostnameInfos parameter, and the webshell URL is specified by the LoginUrl parameter.

Note
  • The webshell URL is valid for 2 minutes. You must use the URL at the earliest opportunity. If the URL is invalid, you cannot connect to the host of your RDS instance.

  • In this case, you can call the required operation to obtain the most recent URL.