SQL Server re-initializes the single quote problem in the system database

Source: Internet
Author: User

In the recent database across the machine room migration, due to hardware constraints, the need to scroll the database to a new computer room, first in the new room to build a new environment, the data migration past, and then the old engine room machine under the new engine room, re-configured for the next round of upgrade, reconfiguration process, there are the following issues:

1: Because the room and IP have changed, you need to modify the server name according to the naming rules.

2: Data on the original database such as login account/job/link server and so on need to be deleted

3: Some servers have disk changes, only the system disk, some of the SQL Server files (if the system database files) have been lost

For issue 1 and Issue 2, you can manually delete or write a script to clean up, but for problem 3, there are three ways to handle it:

1: Uninstall SQL Server and reinstall

2: Reinstall OS and SQL Server

3: Modify the registry information, and then reinitialize the system database

Mode 2 is the simplest but also the most time consuming, the way 1 has the uninstall failure and the uninstallation is not clean causes the SQL Server to be unable to reload the risk, and mode 3 is relatively simple, and can handle both problem 1 and issue 2, so the preferred mode of processing.

Operation Steps:

1: Modify server IP and server name

2: Start the SQL Server service, locate the missing file path based on the error log that the service started, and modify the registry to point the file to a folder on an existing disk

3: reinitialization of the system database.

--============================ Gorgeous split-line ========================--

Reinitialization of the system database can be done with commands in CMD mode, the theoretical parameter values can be used in single quotation marks, on such a simple question, let me once doubted the character and life.

The first use of the domain account xxx\xxxxx, the error user does not exist, in the account of the backslash is not written to;

The second use of the domain account xxx/xxxxx, the error user does not exist, the domain account has a problem;

Use a local account for the third time. \administrator, error user does not exist, think a is not uppercase;

Use local accounts for the fourth time. \administrator, error user does not exist, thought the character has the problem;

The fifth time using the local account Servername\administrator, the error user does not exist, began to question the life

Fortunately, as an old driver, after my confirmation several times, I can also accurately judge administrator these several because the word character is not written wrong, thanks again to my junior English teacher.

Fortunately before the small note, keep the last successful execution of the script, copy in the past successfully executed, carefully contrast, unexpectedly just single quotation mark double quotes problem, 'm not sure pony Pentium AH!!!

Open Posture correctly:

--Rebuilding the System database--under command line, convert to setup file. EXE is in the same directory to execute the following command--/quie Specifies that the setup program runs without any user interface. --/action=rebuilddatabase Identity Rebuilding system Database--/instancename=mssql200801 Instance Name--/sqlsysadminaccounts= "Alex/lidongsheng"-the Windows account that needs to be added. It's best to start the account--/sapwd=54546546 sa passwordSetup/QUIET/ACTION=Rebuilddatabase/InstanceName=MSSQLSERVER/Sqlsysadminaccounts=". \administrator"/Sapwd=The SA@PWD"

--=========================== Gorgeous split-line =========================--

Summary: As a DBA, relying on experience to eat, so good memory than bad writing, more notes do not harm

SQL Server re-initializes the single quote problem in the system database

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.