- Print
- PDF
Getting started with Cloud DB for MSSQL
- Print
- PDF
The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.
Available in VPC
Getting started with Cloud DB for MSSQL describes what you need to do to properly use Cloud DB for MSSQL after checking the Cloud DB for MSSQL user environment and supported specifications and fully understanding the Overall usage scenarios and Glossary. The following is the content dealt with in Getting started with Cloud DB for MSSQL.
- How to create an application server from the NAVER Cloud Platform console
- How to test application server connection
- How to create MSSQL servers from the NAVER Cloud Platform console
- How to test MSSQL server connection
If you completed the above, then you've completed the basic procedure for using Cloud DB for MSSQL. Afterward, you have the option of proceeding with the following tasks for more efficient server management and operation.
- Event and notification (alarm) settings using NAVER Cloud Platform's Cloud Insight
- Management of administration permissions using NAVER Cloud Platform's Sub Account
The above tasks can be done from Cloud Insight or Sub Account after subscribing, rather than in Cloud DB for MSSQL. They are not explained in detail in this guide. For more information, see Cloud Insight user guide and Sub Account user guide.
Create application server
To create an application server from the NAVER Cloud Platform console, follow these steps:
In this section, we will briefly introduce how to create an application server. For more information on full creation methods, see Server user guide.
- From the VPC environment of the NAVER Cloud Platform console, click Services > Compute > Server, in order.
- Click the [Create server] button.
- Click to select a Windows server image and click the [Next] button.
- Enter the required information, and then click the [Next] button.
- If you do not have an existing authentication key, then create a new authentication key and click the [Next] button.
- If you do not have any ACG, create a new one.
- After the final confirmation, click the [Create server] button.
- Select a server image with the Windows type from Step 3 for remote desktop connection.
- The ACG name of the application server from Step 6 is used when adding ACG to the MSSQL server later on.
Set access environment
To set up a server access environment in the VPC environment of the NAVER Cloud Platform console, you need to set up a public IP.
In this section, we will briefly introduce how to set up the access environment. For more information on setting up the access environment, see the following guide.
Set public IP
To set up a public IP, follow these steps:
- From the VPC environment of the NAVER Cloud Platform console, click Services > Compute > Server, in order.
- Click the Public IP menu.
- Click the [Request public IP] button.
- Select the target server, enter a memo, and then click the [Next] button.
- Click the [Create] button.
Get admin password
To get the admin (root) password required for accessing the application server after setting up the public IP, follow these steps:
- From the VPC environment of the NAVER Cloud Platform console, click Services > Compute > Server, in order.
- Click the [Manage servers and change settings] button, and then click the Get admin password menu.
- Enter the authentication key generated while creating the server.
- Click the [Get password] button.
- Check the password.
Test application server connection
To test if you can properly connect to the application server using a remote desktop connection, follow these steps:
- Click Start > All Programs > Accessories > Remote Desktop Connection, in order.
- Enter the public IP for server connection in Computer.
- Click the [Connect] button.
- When the user credential input pop-up window appears, enter the ID and password you got from Get admin password.
- Click the [OK] button.
- When the Remote desktop connection warning window appears, click the [Yes] button.
You can change the password through Ctrl + Alt + End > Change Password.
Create MSSQL server
Some of the services provided by NAVER Cloud Platform require you to go through the subscription procedure from the console before the start of actual usage. However, for Cloud DB for MSSQL, you can start using it upon creation of an MSSQL server without a separate subscribe step. To create an MSSQL server from the NAVER Cloud Platform console, follow these steps:
- In this section, we will briefly introduce how to create a DB server. For more information on full creation methods, see Create MSSQL server.
- Since an additional subscribe step does not exist for Cloud DB for MSSQL, an additional unsubscribe step also does not exist. If you want to stop using Cloud DB for MSSQL and prevent charges from incurring, then delete the MSSQL servers you created and were running. To delete MSSQL server, see Delete MSSQL server.
- From the VPC environment of the NAVER Cloud Platform console, click Services > Database > Cloud DB for MSSQL, in order.
- Click the DB server menu.
- Click the [Create DB server] button.
- When the subscribe page appears, enter the required information and click the [Next] button.
- Click the [Create] button.
Set ACG
To set up Access Control Group (ACG) for MSSQL servers from the NAVER Cloud Platform console, follow these steps:
In this section, we will briefly introduce how to set up ACG. For more information on how to set up ACG, see ACG user guide.
- From the VPC environment of the NAVER Cloud Platform console, click Services > Database > Cloud DB for MSSQL, in order.
- Click the ACG menu.
- Click and select the ACG to set up, and then click the [Set ACG] button.
- Select the ACG of the MSSQL server automatically created
- Enter the ACG name of the application server in Access source.
- Enter the port number in Allowed port.
- Click the [Add] button.
- Click the [Apply] button.
Test MSSQL server connection
To test if you can connect properly to the created MSSQL server by installing the MSSQL client, follow these steps:
- Check the DNS name, DB access port, account ID, and password information for the MSSQL server access.
- Click Services > Database > Cloud DB for MSSQL > DB server.
- Click the MSSQL server's service name to access, and check the following:
- DNS name: check Private domain
- DB access port: check DB access port
- Check the account ID and password from [Manage DB] > Manage DB user.
- Access the application server, Download SSMS, and install it.
- Connect to SSMS.
- Enter the DB server information in the server connection pop-up window.
- Server type: database engine
- Server name: DNS name, DB access port (separated with comma)
- DNS name: private domain of the MSSQL server to access
- DB access port: access port of the MSSQL server to access
- Authentication: SQL server authentication
- Login: account name of the user for the MSSQL server to access
- Password: account password of the user for the MSSQL server to access
- Click the [Connect] button.
Data migration (backup/recovery)
In order to migrate the database operated on-premise to Cloud DB for MSSQL (CDB-MSSQL) or move it from CDB-MSSQL to on-premise, you need to create a window application server. Data migration is performed using the backup and recovery of the SQL server, and you can either proceed with it after uploading the database operated on-premise on the application server or backup the CDB-MSSQL to the application server.
- The application server has to be in the same VPC network environment as CDB-MSSQL.
- For recovering the backup using the application server, you need to set "password protected sharing off" at the network and sharing center of the application server.
- Properly setting the ACG is required to protect the data of the application server. (Application server TCP Port 445 must be open.)
- Create application server
Check VPC and subnet of the CDB-MSSQL
Check VPC and Subnet of the application server
After creating the backup folder on the created application server, set sharing (Everyone, Read/Write)
Turn off the password protected sharing
- Control Panel > Network and Internet > Network and Sharing Center > Advanced sharing settings
- Password protected sharing option > Select Turn off password protected sharing > Apply
- Set ACG of the application server
- The inbound port 445 of the application server should be open to VPC bandwidth.
- The inbound port 445 of the application server should be open to VPC bandwidth.
- Set the MSSQL Server's ACG
- The outbound port 445 of the MSSQL server must be open to the VPC range.
- The outbound port 445 of the MSSQL server must be open to the VPC range.
Backup (sample)
backup database testdb to disk ='\\10.0.1.9\backup\testdb.bak'
Recovery (sample)
- When restoring the database, you should recover it to d:\data folder. The database recovered to other directories does not guarantee stability.
restore database testdb2 from disk ='\\10.0.1.9\backup\testdb.bak' with move 'testdb' to 'd:\data\testdb2.mdf', move 'testdb-log' to 'd:\data\testdb2_log.ldf'
- The on-premise recovery target database must be backed up with the CDB-MSSQL administrator account as the database owner before it can be used normally.
- Even if the on-premise and CDB-MSSQL user accounts are the same, if the SIDs are different, the database cannot be used after recovery.
- See the following script to set the SIDs to be the same and then back up from on-premise and restore to CDB-MSSQL.
Troubleshooting SID problems
This guide walks you through troubleshooting issues due to SID inconsistency in data migration (backup/recovery).
- Restore by changing db_owner in the original server (ON-PREMISE → CDB-MSSQL)
Task Server | Execution script descriptions and references T-SQL Query |
---|---|
CDB-MSSQL | SELECT SID FROM master.sys.sql_logins WHERE name='dbuserid' 0xDBB5F4FE1DBC594FBF806E807AFE72D6 |
ON-PREMISE | CREATE LOGIN [dbuserid] WITH PASSWORD = 'P@ssw0rd', SID =0xDBB5F4FE1DBC594FBF806E807AFE72D6, DEFAULT_DATABASE=[master], CHECK_POLICY=OFF, CHECK_EXPIRATION=OFF USE [userdatabase] GO EXEC sp_changedbowner 'dbuserid' GO
BACKUP DATABASE [userdatabase] TO disk = 'C:\temp\userdatabase.full' |
CDB-MSSQL | RESTORE filelistonly FROM dist='\\10.0.0.7\backup\userdatabase.full' RESTORE DATABASE userdatabase FROM disk='\\\10.0.0.7\backup\userdatabase.full' with MOVE 'userdatabase' TO 'd:\data\userdatabase.mdf', MOVE 'userdatabase_log' TO 'd:\data\userdatabase.log.ldf' |
- Add db_owner to the server to be recovered (CDB-MSSQL → CDB-MSSQL)
Task content, server, and user | Execution script descriptions and references T-SQL Query |
---|---|
SELECT SID FROM master.sys.sql_logins WHERE name='AServerAdmin' 0xB1CFFCE0AEF0234FB49273E7DD713FFA | |
RESTORE DATABASE AServerDB FROM DISK='remote path' | |
CREATE LOGIN [AServerAdmin] WITH PASSWORD='P@ssw0rd', SID=0xB1CFFCE0AEF0234FB49273E7DD713FFA, DEFAULT_DATABASE=[master], CHECK_POLICY=OFF, CHECK_EXPIRATION=OFF GO | |
USE AserverDB GO CREATE USER BServerAdmin FOR LOGIN BServerAdmin GO ALTER ROLE [db_owner] ADD MEMBER BServerAdmin GO | |
DROP LOGIN [AServerAdmin] GO |
If the database is unavailable due to a mismatched SID, you can delete the database from the console.