pvmdconv
Chapter contents
Pervasive PSQL includes a conversion utility, pvmdconv, to convert V1 metadata to V2 metadata. This command-line utility is located in the BIN subdirectory under the installation directory.
Availability
|
Windows
|
Linux
|
Clients
|
Engines
|
|
Yes
|
Yes
|
Yes
|
Yes
|
Synopsis
pvmdconv -o <1 | 2> -d path_to_DDFs -n database_name [-
v] [-ddf] [-s server_name] [-i server_login_name] [-
c server_password] [-u database_user_name] [-p
database_password] [-l log_file] [-<h | ?>]
Description
Pvmdconv allows you to perform the following actions:
- Convert only DDFs from one version of metadata to another version of metadata. The database to which the DDFs belong remains categorized as is. That is, the metadata property for the database, which is stored in a special file named dbnames.cfg, does not change. This action is sometimes referred to as "migrating" the DDFs.
- Set the metadata version of a database to V1 metadata or to V2 metadata. The metadata property of a database, which is stored in a special file named dbnames.cfg, changes. The DDFs for the database retain their metadata version.
This action requires that the DDFs for each metadata version must already exist in the location path_to_ddfs. That is, you must have already converted (migrated) the DDFs from V1 metadata to V2 metadata.
- Convert the DDFs and set the metadata property of the database in dbnames.cfg. That is, combine the first two actions. This is the default action of pvmdconv.
Having different conversion actions provides more control over how you can convert metadata. For example, you may choose first to convert only the DDFs and check for errors. If no errors occur, you could then update the metadata version in dbnames.cfg.
Conversion From V1 to V2 Metadata
All of the data from the V1 DDFs is directly copied to the V2 DDFs with the following exceptions:
|
System Table
|
Action on Field
|
Comments
|
|
X$View
|
The value of Xv$Id is copied to Xv$Sequence in pvview.ddf.
|
Xv$Sequence has auto-increment values for each row.
|
|
The value of Xv$Trustee, which is a new column in V2 metadata, is explicitly stored as -1.
|
The value is stored as -1 regardless of the security setting for the database. That is, if the database has security enabled or if the databases does not have security enabled.
If the V1 metadata database has security enabled, an explicit "GRANT ALL TO PUBLIC" is invoked for all views when the database is converted to V2 metadata.
|
|
X$Proc
|
The value of Xp$Id is copied to Xp$Sequence in pvproc.ddf.
|
Xp$Sequence has auto-increment values for each row.
|
|
The value of Xp$Trustee which is a new column in V2 metadata, is explicitly stored as -1.
|
The value is stored as -1 regardless of the security setting for the database. That is, the value is stored as -1 if the database has security enabled or if the databases does not have security enabled.
If the V1 metadata database has security enabled, an explicit "GRANT ALL TO PUBLIC" is invoked for all stored procedures when the database is converted to V2 metadata.
|
|
X$Rights
|
The value of Xr$Table is copied to Xr$Object in pvrights.ddf.
|
|
|
A default value of 1 is copied to Xr$Type in pvrights.ddf.
|
|
Conversion From V2 to V1 Metadata
The current release of pvmdconv does not support conversion from V2 to V1 metadata.
Parameters
|
-o <1 | 2>
|
Specifies the output format of the metadata. The choices are 1 or 2, which refer to version 1 (V1) and version 2 (V2) metadata, respectively.
Note: The current release of pvmdconv does not support converting DDFs from V2 metadata to V1 metadata.
|
|
-d path_to_DDFs
|
Specifies the directory containing the DDFs that you want to convert.The new DDFs are created in the same directory.
|
|
-n database_name
|
Specifies the name of the Pervasive PSQL database.
|
|
[-v]
|
Specifies to change the metadata version of the database in dbnames.cfg. For example, if -o=2, the metadata version of the database is changed to V2 metadata. If the "v" parameter is used, pvmdconv does not change the metadata version of the DDFs.
|
|
[-ddf]
|
Specifies to change the metadata version of the DDFs. If this parameter is used, pvmdconv does not change the metadata version of the database in dbnames.cfg.
|
|
[-s server_name]
|
Specifies the name or IP address of the remote server where the database resides. This parameter is required if the pvmdconv utility being executed resides on one machine but the database resides on another. This parameter defaults to "localhost," so it is not required if pvmdconv and the database reside on the same machine.
|
|
[-i server_login_name]
|
Specifies the name required to log in to the remote server where the database resides. Server_login_name is a name administered by the operating system.
|
|
[-c server_password]
|
Specifies the password for server_login_name. Server_password is a password administered by the operating system.
|
|
[-u database_user_name]
|
Specifies the name of a user who is authorized to log on to the database.
|
|
[-p database_password]
|
Specifies the password associated with database_user_name.
|
|
[-l log_file]
|
Prints diagnostic messages to a text file. The name and location of the text file is specified by log_file. If this parameter is omitted, the utility prints any diagnostic messages to the screen.
|
|
[-<h | ?>]
|
Prints on the screen the usage information for the utility.
|
Examples
For default locations of Pervasive PSQL files, see Where are the Pervasive PSQL v10 files installed? in Getting Started With Pervasive PSQL.
Default Conversion
To convert the sample database DEMODATA to V2 metadata (assuming a default installation on a Windows platform):
pvmdconv -o 2 -d file_path\PSQL\Demodata -n demodata
This example results in the following:
- V2 metadata DDFs are created in the same location as the V1 metadata DDFs (file_path\PSQL\Demodata). See also "Conversion From V1 to V2 Metadata" on page 1-41.
- The metadata version of DEMODATA in dbnames.cfg is changed to V2 metadata.
To perform the same conversion and obtain a log of conversion diagnostic information:
pvmdconv -o 2 -d file_path\PSQL\Demodata -n demodata -l
file_path\PSQL\Demodata\pvmdconv_log.txt
Convert Only DDFs
To convert only the DDFS for the sample database DEMODATA to V2 metadata (assuming a default installation on a Windows platform):
pvmdconv -o 2 -d file_path\PSQL\Demodata -n demodata -
DDF
This example results in the following:
- V2 metadata DDFs are created in the same location as the V1 metadata DDFs (file_path\PSQL\Demodata). See also "Conversion From V1 to V2 Metadata" on page 1-41.
- The metadata version of DEMODATA in dbnames.cfg is not changed.
Change Metadata Version of Database
To change the metadata version of the sample database DEMODATA to V2 metadata (assuming a default installation on a Windows platform):
pvmdconv -o 2 -d file_path\PSQL\Demodata -n demodata -v
This example results in the following:
- The metadata version of DEMODATA in dbnames.cfg is changed to V2 metadata.
- V2 metadata DDFs are not created.
Note: this example requires that the DEMODATA DDFs exist in file_path\PSQL\Demodata even through the DDFs are not affected by the conversion.
Perform Conversion on a Remote Server
To convert the sample database DEMODATA to V2 metadata given the following:
- DEMODATA resides on a server named "TESTSERVER"
- An administrator ID on TESTSERVER is "adminuser" and user adminuser has a password of "admin99user"
- Drive "Z" is mapped to drive "C" on TESTSERVER (assuming TESTSERVER is a Windows platform with a default installation of Pervasive PSQL).
pvmdconv -o 2 -d z:file_path\PSQL\Demodata -n demodata -
s TESTSERVER -i adminuser -c admin99user
This example results in the following:
- V2 metadata DDFs are created on TESTSERVER in the same location as the V1 metadata DDFs. See also "Conversion From V1 to V2 Metadata" on page 1-41.
- The metadata version of DEMODATA in dbnames.cfg on TESTSERVER is changed to V2 metadata.