DB2 SQL20321N solution instance

Source: Internet
Author: User

DB2 SQL20321N solution instance

SQL20321N was reported during a recent DB2 database migration.
 
Scenario: a clean environment, just installed with DB2, is expected to migrate an old DB2 database to this point.
 
Perform cold backup at the source end:
 
Db2 backup db sundb to/db2sys compress
 
Transmit the backup media to the target/db2sys directory.
 
Restore on the target end:
 
Db2 restore db sundb from. on/db2sys replace existing without rolling forward
 
SQL20321N Storage paths cannot be provided because the database is not enabled for automatic storage. SQLSTAT = 55062
 
The error indicates that automatic storage is not enabled for the database, so the storage path cannot be provided.
 
I checked a lot of information and learned that changing the on parameter to can successfully restore the database.
 
Db2 restore db sundb from. to/db2sys replace existing without rolling forward
 
This turns out TO be true. The explanation of the TO parameter is as follows:
 
The TO target-directory parameter is not used here. This parameter is briefly introduced because it is often used in practical application. This parameter indicates the directory of the target database. If the utility is restored to an existing database, this parameter is ignored. The specified drive and directory must be local. If the backup image includes a database with Automatic Storage enabled, only the database directory is changed, but the storage path associated with the database is not changed.
 
The ON Parameter re-defines the storage path associated with the automatic storage area database. This parameter can only be used in databases with Automatic Storage enabled. If you set this parameter to a database without automatic storage enabled, an error occurs (SQL20321N ). After this parameter is used, the existing storage path defined in the backup image is no longer used, and the automatic storage tablespace is automatically redirected to the new path. If this parameter is not specified for the automatic storage database, the storage path is still the path defined in the backup image. At this time, the path defined in the backup image must exist on the server we want to restore, otherwise, the entire redirection will eventually fail.

DB2 database performance adjustment and optimization (1st and 2) PDF

DB2 database performance optimization

DB2 9.7 for Linux 5.4 Installation Steps

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.