The onunload and onload utilities

The onunload and onload utilities provide the fastest way to move data between computers that use the same database server on the same platform.

For example, your site purchases a more powerful UNIX computer to allow faster access for users. You need to transfer existing databases to the new database server on the new computer. Use onunload to unload data from the first database server and then use onload to load the data into the second database server. Both database servers must have the same version number, or they must have compatible version numbers. You can move an entire database or selected tables only, but you cannot modify the database schema.

The onunload utility can unload data more quickly than either dbexport or the UNLOAD statement because onunload copies the data in binary format and in page-sized units. The onload utility takes a tape or a file that the onunload utility creates and re-creates the database or the table. The onunload and onload utilities are faster than dbimport, dbload, or LOAD but are much less flexible and do not let you modify the database schema or move from one operating system or database server version to another.

You can use only onunload and onload if your answer to each of the following questions is yes. If your answer is no, you cannot use onunload and onload.

  1. Is the target database server on the same hardware platform?
  2. Do you want to move to another database server of the same version?
  3. Do you want to keep the existing database schema without modifying it?
  4. Do you want to move an entire database or an entire table?
  5. Are the page images compatible?
  6. Are the numeric representations the same?

When you can’t use the onunload and onload utilities

Because the data is written in page-sized units, you cannot use onunload and onload to move data between UNIX or Linux and Windows because they use different page sizes. For example, the page size is 2 KB on some UNIX systems and 4 KB on Windows.

Additionally, you cannot use onunload and onload:

  • To move data between GLS and non-GLS databases.
  • To move compressed data from one database to another.
  • You must uncompress data in compressed tables and fragments before you use the onload and onunload utilities.
  • To move external tables or databases that contain external tables.
  • You must drop all the external tables before you use the onunload utility.
  • To move tables and databases that contain extended or smart-large-object data types

How onunload command works

1) Before we start, we need to touch the tape file.

2) onunload command is:

onunload -t /data1/spaces_14/onunload_customer.unl -b 32 -s 2048 stores_demo:customer

Below file has been created

3) If your database is unbuffered on the target server. Please turn off the logging of your database on the target server

Command is: ontape –N Stores_demo:

You can run the below query to check if logging was turned off or not:

echo “select * from sysmaster:sysdatabases where name =’stores_demo'”| dbaccess stores_demo

4) How Onload command works:

onload -t /data1/gaurav/spaces_14/onunload_customer.unl -b 32 -s 2048 stores_demo:customer

Visit HCL OneDB for more information.

Comment wrap
Further Reading
article-img
Data Management | February 23, 2022
All About the Configuration Parameters of OneDB Database  
Parameters are essential elements of any database instance. They help us achieve required performance goals or define the behaviour/characteristics of instance.
article-img
Data Management | February 14, 2022
Quick Tips: Successful Database Management Evaluation
Working in the tech industry, you’ve undoubtedly experienced sitting through a software demonstration that, to be generous, put you to sleep. The problem is that most demos focus solely on product features, and the audience is usually more concerned with their own specific needs. When considering a database management product, demonstrations are a chance to view features, determine a software’s intuitive capability, and garner the best understanding of how the tool will work within the scope of your data and business needs. To get the most from a demo, it is necessary to first identify what business needs you are looking to solve.
article-img
Cloud Native | January 28, 2022
HCL Software Enters Business Partnership with Four Js Development Tools to Modernize Applications in the Database Market
HCL Software announced the business partnership with Four Js Development Tools to collaborate on a campaign to modernize legacy mission-critical applications in the database market with the help of HCL Software’s product, HCL OneDB. 
Close
Filters result by
Sort:
|