Upgrades a database created with a previous version of the software or adds or removes Java or jConnect support. Run this statement with Interactive SQL Java.
ALTER DATABASE UPGRADE [ JAVA { ON | OFF | JDK { ‘ 1.1.8 ‘ | ‘ 1.3 ’ } } ] [ JCONNECT { ON | OFF} ] | REMOVE JAVA
Upgrade a database created with the Java options off:
ALTER DATABASE UPGRADE JAVA OFF JCONNECT OFF
The ALTER DATABASE statement upgrades databases created with earlier versions of the software. This applies to maintenance releases as well as major releases. For example, you can upgrade a database created with version 12.6 to 12.7.
See the Sybase IQ Installation and Configuration Guide for backup recommendations before you upgrade.
When you upgrade a database, Sybase IQ makes the following changes:
Upgrades the system tables to the current version.
Adds any new database options.
You can also use ALTER DATABASE UPGRADE simply to add Java or jConnect features if the database was created with the current version of the software.
WARNING! Be sure to start the server in a way that restricts user connections before you run ALTER DATABASE UPGRADE. For instructions and other upgrade caveats, see the chapter “Migrating Data,” in the Sybase IQ Installation and Configuration Guide for your platform.
After using ALTER DATABASE UPGRADE, shut down the database.
If upgrade of a Sybase IQ 12.6 database returns a “Database upgrade not possible” error, see “Insufficient procedure identifiers,” in Sybase IQ Troubleshooting and Recovery Guide.
JAVA clause Controls support for Java in the upgraded database.
Specify JAVA ON to enable support for Java in the database by adding entries for the default Sybase runtime Java classes to the system tables. If Java in the database is already installed, but is at a lower version than the default classes, this clause upgrades it to the current default classes. The default classes are the JDK 1.3 classes.
Specify JAVA OFF to prevent the addition of Java in the database to databases that do not already have it installed. For databases that already have Java installed, setting JAVA OFF does not remove Java support: the version of Java remains at the current version. To remove Java from the database, use the REMOVE JAVA clause.
Specify JAVA JDK ‘1.1.8’ or JAVA JDK ‘1.3’ to install support for the named version of the JDK.
The ALTER DATABASE UPGRADE statement only upgrades your database to a higher version of JDK. To downgrade, first remove Java from the database, then add it back with the lower JDK version. For example, to downgrade from JDK 1.3 to JDK 1.1.8:
ALTER DATABASE REMOVE JAVA ALTER DATABASE UPGRADE JAVA JDK '1.1.8'
Classes for JDK 1.1.8 are stored in java/1.1/classes.zip under the Sybase IQ installation directory. Classes for JDK 1.3 are stored in java/1.3/rt.jar.
The default behavior is JAVA OFF.
To use Java after adding it in the database, you must restart the database.
JCONNECT clause To allow the Sybase jConnect JDBC driver to access system catalog information, you must specify JCONNECT ON. This installs jConnect system tables and procedures. To exclude the jConnect system objects, specify JCONNECT OFF. You can still use JDBC, as long as you do not access system catalog information. The default is to include jConnect support (JCONNECT ON).
REMOVE JAVA clause Removes Java from a database. The operation leaves the database as if it were created with JAVA OFF. When the statement is issued Java in the database must not be in use. Remove all Java classes from the database before executing this statement. The statement ignores stored procedures and triggers that reference Java objects, and the presence of these objects does not trigger an error in the ALTER DATABASE statement.
Automatic commit
Must have DBA authority.
“Migrating Data” in the Sybase IQ Installation and Configuration Guide
“Introduction to Java in the Database” in the Adaptive Server Anywhere Programming Guide