Import SQL Server tables directly into Oracle database (graphic tutorial)

Foreword:

Import all the tables and data in the SQLServer database into the Oracle database, and directly import them into the Oracle database through the Microsoft SqlServer Management Studio tool, eliminating the need to generate scripts. This tutorial is in the form of pictures and texts, which is convenient for friends who have never used SqlServer, and can also export data across databases.

Tutorial starts:

1. Open Microsoft SqlServer Management Studio in the Start menu, find the SQL Server database to be exported, select the task, and then select Export Data.

2. Open the export data tool:

3. Select the data source: that is, choose which database to export the data from. If it is a local machine, fill in the server name: localhost


4. Select the target: To import the Oracle database, select: Oracle Provider for OLE DB, then click Properties, and set the user name and password of the Oracle database in the properties.

5. Enter the user name and password of the database to be imported into Oracle, test the connection is successful, and then check the box that allows saving the password, or close the window, the password may be lost, and it will be troublesome to enter it again.

6. Select the Copy one or more tables option:


7. Select the table you want to import, here only one table is selected as an example, you can check multiple tables to export together.

The key point is to start: Click Edit Mapping, where the mapping between the SqlServer field data type and the Oracle data type is set. Because the data types between them are slightly different, it becomes the most error-prone place when exporting.

8. Field data type conversion between two databases:

If the novice does not know which field needs to be converted, you can perform the next step first, and an error message will be reported when the export fails. Then make adjustments according to the column name of the error message . For example: Convert Datetime to Date, char to varchar2, and try to adjust it according to the actual data of the table. Difficulty: This is also the most error-prone place to import data from different databases, because the data types of Oracle and SqlServer are slightly different, and manual matching and adjustment are required.

 

9. View the data type mapping. The place with an exclamation mark is the place that should be converted. Often the failure is here. You can double-click to view the specific conversion information. There is no need to set it here, just keep the default next step.

10. Continue to the next step:

1 1. Click Finish, and an error message is found after execution. Next, let's talk about how to make mistakes.

12. Click to open the error message, and find that some fields in it indicate that the conversion failed, then remember the field in error, it is best to take a screenshot, and then go back to the previous step.

1 3. Click Back to go back to the "Edit Mapping" page and readjust the wrong fields.

1 4. Find the wrong field and convert the char field type to Varchar2. The same is true for other fields, find out the field with the conversion error and correct it.

1 5. Click again to complete the attempt, and found that the export was all successful, and "10 pieces of data" were exported.

16. Open PlSQL, connect to the Oracle database, check the table just imported, and find that the table and data are all successfully imported:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324209794&siteId=291194637