search
HomeDatabaseOracleDetailed examples of Oracle data table import and export

This article brings you relevant knowledge about Oracle, which mainly organizes the related issues of importing and exporting data tables. If a large amount of data needs to be migrated, select "Export Table" and "Import Table" The Oracle method does not require writing a table structure. Let’s take a look at it. I hope it will be helpful to everyone.

Detailed examples of Oracle data table import and export

Recommended tutorial: "Oracle Video Tutorial"

0. Background: I suddenly received a notice to work from home. All work data is on the intranet and needs to be copied out and taken away. The largest single table is about 3.7G. Based on usual experience, I exported the tables in the Oracle database to xlsx (to facilitate communication with colleagues). I found that the efficiency was too low, and due to the large amount of data, errors were often reported and could not be exported. Later, I tried to export it to a csv file, and it was prompted that the export was completed. However, when I found a new computer to import, I found that the data was seriously missing and could not be used.

1. The original stupid method

Right-click the table to be exported in the object window, click Query Data, and click the csv file or excel file. This method is usually used. The query results are very intuitive and suitable for small amounts of data.

1.Oracle data table export

Export table tool

There are two ways to open it in PL/SQL, method one is Right-click the table that needs to be exported in the object window, click Export Data, and the export table window will pop up. The second method is to click the tool at the top of the PL/SQL page, click Export Table, and the export table window will pop up. The export table tool can export multiple tables in batches

In the export table window, there are three specific export methods, and all three methods can export the table structure and data

(1) Oracle Export

The export result of "Oracle Export" is a binary file in dmp format, which cannot be previewed, but it is fast and can be cross-platform. We plan to use this method in the future. The first dmp file is about 3.61G and takes 3 minutes to export.

(2) SQL Insert

The export result of "SQL Insert" is a file in sql format, which can be previewed in text format, but the speed is not " Oracle export" is fast. For a 3.61G file in dmp format, the export time is 14 minutes and the size is 9.34G.

(3) PL/SQL Developer

The export result of "PL/SQL Developer" is a file in pde format, which is PL/SQL free File format, cannot be previewed in text format, speed

For a 3.61G file in dmp format, the export time is 10 minutes and the size is 0.4G. The amount of data is too small, so I don’t believe that all of it will be copied out, but the number of log prompts is consistent with the data table

2.Oracle data Table Import

ODBC Importer

ODBC should mean Open Database Connectivity (Open Data Interconnection). I often use the ODBC importer to import EXCEL documents and ACCESS database tables. Importing tables using the ODBC importer requires defining the table structure in advance.

(1) Create a new table

File-New-Create a table and set the table name and columns. Remarks can be added appropriately to facilitate subsequent use. There must be a type when setting the column. Try to set it as large as possible to prevent errors during subsequent imports. You can click the View SQL button to display the SQL statement for creating the table, so that you can directly execute the code to create the table next time. .

(2) Open the ODBC Importer

Click "Tools" at the top of the PL/SQL page, click "ODBC Importer", and a pop-up will appear ODBC Importer Window

# (3) Select the table to be imported

User/System DSN Select "Excel Files", click Connect, and select the table to be imported surface. Select the specific sheet to be imported and preview

(4) Determine the corresponding location of Oracle

Select the owner, table, and check the field matching. For fields that cannot be automatically matched, manually select the field in the right window Select the corresponding field and field type, and click the "Import" button to import the data.

Text Importer

As the name suggests, the text importer imports files in text format. I usually use the text importer to import files in csv format

(1) Create a new table, the specific method is the same as the ODBC importer

(2) Open the text importer

Click "Tools" at the top of the PL/SQL page, click "Text" Importer", the text importer window pops up

(3) Select the table to be imported

Click the Select File button, select the text file to be imported and preview it

(4) Determine the corresponding location of Oracle

Select the owner, table, and check the field matching. For fields that cannot be automatically matched, manually select the corresponding field in the right window Fields and field types, click the "Import" button to import data.

Import table tool

Click the tool at the top of the PL/SQL page, click Import table, and the import table window will pop up

(1) Oracle import

Select the dmp file to be imported, click the "Import" button, and there will be an import completion prompt at the bottom. After the import is completed, you can view the detailed import results on the rightmost log page

(2) SQL insertion

Select the sql file to be imported and click the "Import" button. The sqlplus.exe execution program window will pop up, showing the real-time progress of the import. After the import is completed, you can view the detailed import results on the rightmost log page

(3) PL/SQL Developer

Select the pde file that needs to be imported, click the "Import" button, and there will be an import completion prompt at the bottom. After the import is completed, you can view the detailed import results on the log page on the far right. The speed is really slow, slower than SQL insertion

3. Summary

(1) If you need to interact with other people with a small amount of daily data, Export query results to xlsx format

(2) ODBC importer and text importer need to write the table structure in advance

(3) If a large amount of data needs to be migrated, choose the Oracle method of "Export Table" and "Import Table". There is no need to write the table structure

(4) The backup data can be directly exported to a file in dmp format. Re-import when you need to restore

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of Detailed examples of Oracle data table import and export. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:CSDN. If there is any infringement, please contact admin@php.cn delete
oracle怎么查询所有索引oracle怎么查询所有索引May 13, 2022 pm 05:23 PM

方法:1、利用“select*from user_indexes where table_name=表名”语句查询表中索引;2、利用“select*from all_indexes where table_name=表名”语句查询所有索引。

什么是oracle asm什么是oracle asmApr 18, 2022 pm 04:16 PM

oracle asm指的是“自动存储管理”,是一种卷管理器,可自动管理磁盘组并提供有效的数据冗余功能;它是做为单独的Oracle实例实施和部署。asm的优势:1、配置简单、可最大化推动数据库合并的存储资源利用;2、支持BIGFILE文件等。

oracle全角怎么转半角oracle全角怎么转半角May 13, 2022 pm 03:21 PM

在oracle中,可以利用“TO_SINGLE_BYTE(String)”将全角转换为半角;“TO_SINGLE_BYTE”函数可以将参数中所有多字节字符都替换为等价的单字节字符,只有当数据库字符集同时包含多字节和单字节字符的时候有效。

Oracle怎么查询端口号Oracle怎么查询端口号May 13, 2022 am 10:10 AM

在Oracle中,可利用lsnrctl命令查询端口号,该命令是Oracle的监听命令;在启动、关闭或重启oracle监听器之前可使用该命令检查oracle监听器的状态,语法为“lsnrctl status”,结果PORT后的内容就是端口号。

oracle怎么查询数据类型oracle怎么查询数据类型May 13, 2022 pm 04:19 PM

在oracle中,可以利用“select ... From all_tab_columns where table_name=upper('表名') AND owner=upper('数据库登录用户名');”语句查询数据库表的数据类型。

oracle怎么删除sequenceoracle怎么删除sequenceMay 13, 2022 pm 03:35 PM

在oracle中,可以利用“drop sequence sequence名”来删除sequence;sequence是自动增加数字序列的意思,也就是序列号,序列号自动增加不能重置,因此需要利用drop sequence语句来删除序列。

oracle查询怎么不区分大小写oracle查询怎么不区分大小写May 10, 2022 pm 05:45 PM

方法:1、利用“LOWER(字段值)”将字段转为小写,或者利用“UPPER(字段值)”将字段转为大写;2、利用“REGEXP_LIKE(字符串,正则表达式,'i')”,当参数设置为“i”时,说明进行匹配不区分大小写。

Oracle怎么修改sessionOracle怎么修改sessionMay 13, 2022 pm 05:06 PM

方法:1、利用“alter system set sessions=修改后的数值 scope=spfile”语句修改session参数;2、修改参数之后利用“shutdown immediate – startup”语句重启服务器即可生效。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft