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

The onunload and onload utilities

Below file has been created

The onunload and onload utilities

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:

The onunload and onload utilities

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

The onunload and onload utilities

4) How Onload command works:

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

The onunload and onload utilities

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  
Learn everything about the Configuration Parameters of OneDB Database with HCLSoftware & why they are essential elements of any database instance.
article-img
Data Management | February 14, 2022
Quick Tips: Successful Database Management Evaluation
Tips for database management of product and its demonstrations a chance to view features, determine software’s intuitive capability, and collect the best understanding.
article-img
Cloud Native | January 28, 2022
HCLSoftware Enters Business Partnership with Four Js Development Tools to Modernize Applications in the Database Market
Learn why HCLSoftware enters Business Partnership with Four Js Development Tools to Modernize Applications in the Database Market with HCL OneDB.
Close
Filters result by
Sort:
|