Change the name of the computer and then adjust the instance settings

Source: Internet
Author: User
Tags domain name server

How to adjust instance settings after the computer is renamed

Author: Peng Fen Source: IT expert network

After the sqlserver database is deployed, it is suddenly found that the Host Name of the database server does not comply with the naming rules of the enterprise. If the name of the computer is changed, access failure may occur to the original database instance.

After the sqlserver database is deployed, it is suddenly found that the Host Name of the database server does not comply with the naming rules of the enterprise. If the name of the computer is changed, access failure may occur to the original database instance. The client may not be able to connect to this database instance. What should I do now? Is there only one way to reinstall the database? In sqlserver2008, you can enable the database to automatically identify the new database name during startup without re-installing the database. In this article, I will discuss this topic with you.

1. renaming a computer may cause problems.

Although sqlserver2008 allows you to rename the name of the database server host without re-installing the database system. However, there are still many restrictions when using this method. Therefore, before modifying the host name, the database administrator must first understand these restrictions. This helps normal use of related services after the host name is modified.

If a Report Server is deployed in the database, whether deployed on the same host or on different hosts, you only need to change the name of the database server host, therefore, the report server will be inaccessible. In other words, the report service cannot identify the name of the computer after modification. After changing the host name, you must manually adjust the database engine so that the Report Server can recognize the modified host name. To adjust the database server engine, follow these steps. If the database server and the Report Server are deployed on the same host, that is, the Report Server uses a local database, you can use the local command to specify a new server (after the host name is changed, the Report Server considers that a new server is used ).If the database server and Report Server are not on the same host, the adjustment process is complicated. In this case, the database administrator needs to start the Report Server Configuration tool and connect to the Report Server that uses the renamed server's Report Server database. This is what we talk about in official documents, and it sounds pretty easy.As long as the database administrator knows, the Report Server treats the renamed database server as a new server. For this reason, the new computer name is used for connection. After the connection, go to the database installation page, find the database name in the server name, and then click Connect. Connect to the application. When the Report Server is started, the latest host name will be used for connection. After renaming, you do not need to reinstall the sqlserver database. However, the connection between the database and other services, such as the connection with the Report Server, needs to be reset.

To update all client connections. You can use an IP address to connect to a client or a host name to connect to the client. If the host name is used to connect to the client, you need to change the client connection settings one by one after changing the host name. Change the client connection name to the latest computer name. Obviously, when the number of database clients is large, this will increase the workload. Therefore, it may be more convenient to set the client connection to connect through an IP address. This is because after the database is connected in this way, the clients do not need to be adjusted after the database is changed to the server. In addition, if a database image is also configured for an enterprise, you must disable the database image before changing the name of the image host when renaming a computer with a database image. In addition, like the report server, you must use a new name to create a database image. Because the number of elements in the database image is not automatically updated to reflect the name of the new computer.

It can be seen that, even if you do not need to reinstall the database server, changing the name of the Database Host will add a lot of work out of thin air. Other application servers related to the database server, such as the Report Server and image host, may need to be reset to establish a connection with the database server. For this reason, sqlserver2008 only provides this function. It does not mean that he agrees to change the name of the database server. On the contrary, database administrators should try to avoid doing so during their daily work. Before Database Server subordinates, check whether the host name of the database server complies with the relevant naming rules. If the database administrator is not sure, ask the enterprise's network administrator to confirm. After the database server is deployed, do not rename the Host Name of the database server.

2. Change the computer name.

1. Rename the database server name.

It is easy to change the name of the database server. You only need to execute several system stored procedures. To facilitate the database administrator to change the name of the Database Host, the database provides several stored procedures. For example, sp_dropserver and sp_addserver stored procedures. The two stored procedures are used to cancel the old server and then add the new server. Although the database server is the same after the name is changed, the system manages the database server as two different servers. The above two stored procedures will be stored in SYS. Servers
And the system metadata reported by the system function @ servername is updated. This allows related jobs to know the computer name changes. For example, you can let some remote connections know the fact that their names have changed. In addition, if the current database has a remote login, an error may occur when executing the first stored procedure. In this case, the database administrator must remotely log on and delete the database before executing the stored procedure. For this reason, it is best to rename the database when no one is using the database at night. This prevents employees from using the database server properly due to the impact of renaming the database server job. If you need to use the database 24 hours a day, you need to inform the user in advance so that they can prepare in advance. For example, you can specify a time when there are few database users accessing the database in a day to perform this job when the network connection of the database server is disconnected. Prevent the rename job from going smoothly due to login requests from other users.

However, many application services still cannot automatically update their connection configurations. The Report Server and the image host mentioned above still need to manually re-establish the connection between these application servers and database servers. Therefore, the database administrator must patiently update the connection information to avoid negative impact on normal user access.

2. Change the name of the Report Server.

Changing the name of a report server host is different from changing the name of a database server. If the database administrator decides to modify the name of the Report Server, follow these steps.

Step 1: modify the configuration file. In the Report Server, the configuration file rsreportserver. config is used. The connection between the report server and the database server is controlled through this configuration file. If the name of the Report Server is modified, modify the configuration file accordingly. If the database administrator needs to find urlroot. The transfer extension module uses the value set by this parameter to write items that are accessed and stored on the Report Server. Therefore, you need to change this parameter when changing the name of the report server so that the database subscription service can continue to pass as expected. For this reason, the administrator needs to find this parameter and modify the host name to the new host name.

Step 2: view the reportserverurl parameters. This option exists in some Report Server configuration files. If this option is available, you must change the value of this option at the same time to change the name of the server host to the new server host name. If this parameter has no value, you do not need to worry about it. Do not update the null value to the latest computer name multiple times. Although this may not affect the normal use of the report server, it is a perfect choice. It will only increase the subsequent maintenance workload, and there is no other value.

In addition, you must note that after modifying the name of the Report Server, you may still be able to access the report service using the original name within a period of time. At this time, the database administrator should not be too happy to think that it is okay to change the name of the Database Report Server. In fact, it takes several minutes for the user to tell you that the Report Server cannot be accessed. It turns out that some domain name resolution servers may exist in the enterprise network. There is a one-to-one correspondence between host names and IP addresses in these servers. The name of the Report Server may not be updated in time on the Domain Name Server after it is changed. After changing the name of the Report Server, some users can log on to the Report Server using the original name in a short time. However, this will only take a short period of time. Therefore, it is better for the database administrator to honestly adjust the configuration file according to the above method.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.