ALTER DATABASE statement

Description

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.

Syntax

ALTER DATABASE
  UPGRADEJAVAON | OFF 
       | JDK‘ 1.1.8 ‘ | ‘ 1.3 ’ } } ]
    [ JCONNECT { ON | OFF } ]
  | REMOVE JAVA 

Examples

Example 1

Upgrade a database created with the Java options off:

ALTER DATABASE UPGRADE JAVA OFF JCONNECT OFF

Usage

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 15.0 to 15.1.

NoteSee the Installation and Configuration Guide for backup recommendations before you upgrade.

When you upgrade a database, Sybase IQ makes the following changes:

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 Installation and Configuration Guide for your platform.

After using ALTER DATABASE UPGRADE, shut down the database.

NoteUse the iqunload utility to upgrade databases created prior to version 15.0. For details, see Chapter 6, “Migrating Data” in the Installation and Configuration Guide for your platform.

JAVA clause Controls support for Java in the upgraded database.

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.


Side effects

Standards

Permissions

Must have DBA authority.

See also

CREATE DATABASE statement

“Migrating Data” in the Installation and Configuration Guide for your platform

“Introduction to Java support” in SQL Anywhere Server – Programming > Java in the database > Java support in SQL Anywhere