| title | Connecting to SQL Server (DB2eToSQL) | Microsoft Docs |
|---|---|
| ms.prod | sql |
| ms.custom | |
| ms.date | 01/19/2017 |
| ms.reviewer | |
| ms.technology | ssma |
| ms.topic | conceptual |
| ms.assetid | b59803cb-3cc6-41cc-8553-faf90851410e |
| author | Shamikg |
| ms.author | Shamikg |
To migrate DB2 databases to [!INCLUDEssNoVersion] 2012, [!INCLUDEssNoVersion]2014 or Azure SQL DB you must connect to any of these target instances of [!INCLUDEssNoVersion]. When you connect, SSMA obtains metadata about all the databases in the instance of [!INCLUDEssNoVersion] and displays database metadata in the [!INCLUDEssNoVersion] Metadata Explorer. SSMA stores information about which instance of [!INCLUDEssNoVersion] you are connected to, but does not store passwords.
Your connection to [!INCLUDEssNoVersion] stays active until you close the project. When you reopen the project, you must reconnect to [!INCLUDEssNoVersion] if you want an active connection to the server. You can work offline until you load database objects into [!INCLUDEssNoVersion] and migrate data.
Metadata about the instance of [!INCLUDEssNoVersion] is not automatically synchronized. Instead, to update the metadata in [!INCLUDEssNoVersion] Metadata Explorer, you must manually update the [!INCLUDEssNoVersion] metadata. For more information, see the "Synchronizing [!INCLUDEssNoVersion] Metadata" section later in this topic.
The account that is used to connect to [!INCLUDEssNoVersion] requires different permissions depending on the actions that the account performs:
-
To convert DB2 objects to [!INCLUDEtsql] syntax, to update metadata from [!INCLUDEssNoVersion], or to save converted syntax to scripts, the account must have permission to log on to the instance of [!INCLUDEssNoVersion].
-
To load database objects into [!INCLUDEssNoVersion], the account must be a member of the sysadmin server role. This is required to install CLR assemblies.
-
To migrate data to [!INCLUDEssNoVersion], the account must be a member of the sysadmin server role. This is required to run the [!INCLUDEssNoVersion] Agent data migration packages.
-
To run the code that is generated by SSMA, the account must have Execute permissions for all user-defined functions in the ssma_DB2 schema of the target database. These functions provide equivalent functionality of DB2 system functions, and are used by converted objects.
If the account that is used to connect to [!INCLUDEssNoVersion] is to perform all migration tasks, the account must be a member of the sysadmin server role.
Before you convert DB2 database objects to [!INCLUDEssNoVersion] syntax, you must establish a connection to the instance of [!INCLUDEssNoVersion] where you want to migrate the DB2 database or databases.
When you define the connection properties, you also specify the database where objects and data will be migrated. You can customize this mapping at the DB2 schema level after you connect to [!INCLUDEssNoVersion]. For more information, see Mapping DB2 Schemas to SQL Server Schemas (DB2ToSQL).
Important
Before you try to connect to [!INCLUDEssNoVersion], make sure that the instance of [!INCLUDEssNoVersion] is running and can accept connections.
To connect to SQL Server
-
On the File menu, select Connect to SQL Server.
If you previously connected to [!INCLUDEssNoVersion], the command name will be Reconnect to SQL Server.
-
In the connection dialog box, enter or select the name of the instance of [!INCLUDEssNoVersion].
-
If you are connecting to the default instance on the local computer, you can enter localhost or a dot (.).
-
If you are connecting to the default instance on another computer, enter the name of the computer.
-
If you are connecting to a named instance on another computer, enter the computer name followed by a backslash and then the instance name, such as MyServer\MyInstance.
-
-
If your instance of [!INCLUDEssNoVersion] is configured to accept connections on a non-default port, enter the port number that is used for [!INCLUDEssNoVersion] connections in the Server port box. For the default instance of [!INCLUDEssNoVersion], the default port number is 1433. For named instances, SSMA will try to obtain the port number from the [!INCLUDEssNoVersion] Browser Service.
-
In the Database box, enter the name of the target database.
This option is not available when you reconnect to [!INCLUDEssNoVersion].
-
In the Authentication box, select the authentication type to use for the connection. To use the current Windows account, select Windows Authentication. To use a [!INCLUDEssNoVersion] login, select SQL Server Authentication, and then provide the login name and password.
-
For Secure connection, two controls are added, the Encrypt Connection and TrustServerCertificate check boxes. Only when Encrypt Connection is checked, the TrustServerCertificate check box is visible. When Encrypt Connection is checked (true) and TrustServerCertificate is unchecked (false), it will validate the SQL Server SSL certificate. Validating the server certificate is a part of the SSL handshake and ensures that the server is the correct server to connect to. To ensure this, a certificate must be installed on the client side as well as on the server side.
-
Click Connect.
Higher Version Compatability
-
You will be able to connect to [!INCLUDEssNoVersion] 2008 and [!INCLUDEssNoVersion] 2012 and [!INCLUDEssNoVersion] 2014 and [!INCLUDEssNoVersion] 2016 when the migration project created is [!INCLUDEssNoVersion] 2005.
-
You will be able to connect to [!INCLUDEssNoVersion] 2012 and [!INCLUDEssNoVersion] 2014 and [!INCLUDEssNoVersion] 2016 when the migration project created is [!INCLUDEssNoVersion] 2008 but you will not be able to connect to lower versions i.e. [!INCLUDEssNoVersion] 2005.
-
You will be able to connect to [!INCLUDEssNoVersion] 2012 and [!INCLUDEssNoVersion] 2014 and [!INCLUDEssNoVersion] 2016 when the project created is SQL Server 2012.
| PROJECT TYPE Vs TARGET SERVER VERSION | [!INCLUDEssNoVersion] 2012 (Version:11.x) |
[!INCLUDEssNoVersion] 2014 (Version:12.x) |
[!INCLUDEssNoVersion] 2016 (Version:13.x) |
Azure SQL DB |
| [!INCLUDEssNoVersion] 2012 | Yes | Yes | Yes | |
| [!INCLUDEssNoVersion] 2014 | Yes | Yes | ||
| [!INCLUDEssNoVersion] 2014 | Yes | |||
| Azure SQL DB | Yes |
Important
Conversion of the database objects is carried out as per the project type but not as per the version of the [!INCLUDEssNoVersion] you are connected to. In case of [!INCLUDEssNoVersion] 2012, [!INCLUDEssNoVersion] 2014, [!INCLUDEssNoVersion] 2016 or Azure SQL DB.
Metadata about [!INCLUDEssNoVersion] databases is not automatically updated. The metadata in [!INCLUDEssNoVersion] Metadata Explorer is a snapshot of the metadata when you first connected to [!INCLUDEssNoVersion], or the last time that you manually updated metadata. You can manually update metadata for all databases, or for any single database or database object.
To synchronize metadata
-
Make sure that you are connected to [!INCLUDEssNoVersion].
-
In [!INCLUDEssNoVersion] Metadata Explorer, select the check box next to the database or database schema that you want to update.
For example, to update the metadata for all databases, select the box next to Databases.
-
Right-click Databases, or the individual database or database schema, and then select Synchronize with Database.
The next step in the migration depends on your project needs:
-
To customize the mapping between DB2 schemas and [!INCLUDEssNoVersion] databases and schemas, see Mapping DB2 Schemas to SQL Server Schemas (DB2ToSQL).
-
To customize configuration options for the projects, see Project Settings (Conversion) (DB2ToSQL) and related sections.
-
To customize the mapping of source and target data types, see Mapping DB2 and SQL Server Data Types (DB2ToSQL).
-
If you do not have to perform any of these tasks, you can convert the DB2 database object definitions into [!INCLUDEssNoVersion] object definitions. For more information, see Converting DB2 Schemas (DB2ToSQL).