Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Record a Historical data Migration from oracle to hive (1)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Introduce the specific scene.

It is necessary to migrate the historical data from the existing oracle and import it into hive. There are several problems: 1. The existing oracle database cannot export the entire database, and the database server does not have permission. 2. Due to the upgrades of each data provider, the oracle database is updated by adding fields without deleting fields, while the table data structure established in hive needs to be updated according to the new one, that is to say, the data exported by oracle to the hive table needs to correspond with fields.

Decide to import oracle into another oracle first, compare the table field in oracle with the table field in hive to get the corresponding relationship, and then write the corresponding sqoop statement corresponding to the one-day import using ETL process installation account.

Import scheme from one oracle to another oracle, using the sqluldr2 tool written by God to export data, import and utilize

The sqlldr command is imported into another library table.

Specific commands for export

Sqluldr2.bin user=root/pwd@tnsname query= "select / * + parallel (8) * / * from table" head=no File=/data/oracle/tmp/file exports to a local directory

Specific commands for import

Sqlldr root/pwd@@ip:1521/tnsname control=/data/oracle/shell/xxx.ctl

Data=/data/oracle/tmp/file

Log=/data/oracle/log/file.log errors=0 rows=100000 bindsize=1024000000 direct=y

Xxx.ctl is used to specify the fields and separators of the import table as follows

Load data

Truncate into table tablename

Column delimiter for Fields terminated by','# file

TRAILING NULLCOLS

(

IP char (255)

APPKEY char (255)

PLATFORM char (255)

PORTAL char (255)

COMPANYID char (255))

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report