IBM Books

Administrative API Reference

sqlemgdb - Migrate Database

Converts previous (Version 2.x or higher) versions of DB2 databases to current formats.

Authorization

sysadm

Required Connection

This API establishes a database connection.

Version

sqlenv.h

C API Syntax



/* File: sqlenv.h */
/* API: Migrate Database */
/* ... */
SQL_API_RC SQL_API_FN
  sqlemgdb (
    _SQLOLDCHAR * pDbAlias,
    _SQLOLDCHAR * pUserName,
    _SQLOLDCHAR * pPassword,
    struct sqlca * pSqlca);
/* ... */
 

Generic API Syntax



/* File: sqlenv.h */
/* API: Migrate Database */
/* ... */
SQL_API_RC SQL_API_FN
  sqlgmgdb (
    unsigned short PasswordLen,
    unsigned short UserNameLen,
    unsigned short DbAliasLen,
    struct sqlca * pSqlca,
    _SQLOLDCHAR * pPassword,
    _SQLOLDCHAR * pUserName,
    _SQLOLDCHAR * pDbAlias);
/* ... */
 

API Parameters

PasswordLen
Input. A 2-byte unsigned integer representing the length in bytes of the password. Set to zero when no password is supplied.

UserNameLen
Input. A 2-byte unsigned integer representing the length in bytes of the user name. Set to zero when no user name is supplied.

DbAliasLen
Input. A 2-byte unsigned integer representing the length in bytes of the database alias.

pSqlca
Output. A pointer to the sqlca structure. For more information about this structure, see SQLCA.

pPassword
Input. A string containing the password of the supplied user name (if any). May be NULL.

pUserName
Input. A string containing the user name of the application. May be NULL.

pDbAlias
Input. A string containing the alias of the database that is cataloged in the system database directory.

REXX API Syntax



MIGRATE DATABASE dbalias [USER username USING password]

REXX API Parameters

dbalias
Alias of the database to be migrated.

username
User name under which the database is to be restarted.

password
Password used to authenticate the user name.

Sample Programs

C
\sqllib\samples\c\migrate.c

COBOL
\sqllib\samples\cobol\migrate.cbl

FORTRAN
\sqllib\samples\fortran\migrate.f

REXX
\sqllib\samples\rexx\migrate.cmd

Usage Notes

This API will only migrate a database to a newer version, and cannot be used to convert a migrated database to its previous version.

The database must be cataloged before migration.

For detailed information about database migration, see one of the Quick Beginnings books.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]