IBM PureData System for Analytics, Version 7.1

ALTER LIBRARY

Use the ALTER LIBRARY command to change a user-defined shared library. You can use this command to change properties such as the loading method, dependencies, owner, and object files.

You cannot change the library name by using this command. To change a library name, you must drop the library and create a library with the new name.

Synopsis

The ALTER LIBRARY command has the following syntax:
ALTER LIBRARY library_name
[ AUTOMATIC LOAD | MANUAL LOAD ]
[NO DEPENDENCIES| DEPENDENCIES deplibs]
[ EXTERNAL HOST OBJECT 'host_object_filename' ]
[ EXTERNAL SPU OBJECT 'SPU_object_filename' ]
ALTER LIBRARY library_name OWNER TO name 

Inputs

The ALTER LIBRARY command takes the following inputs:
Table 1. ALTER LIBRARY inputs
Input Description
library_name The name of the library that you want to change. You must be connected to the database where the library is defined. You cannot change the name by using this command.

For systems that support multiple schemas, you can specify a name in the format schema.library to change a library in a different schema of the current database. You cannot change a library in a different database.

[AUTOMATIC LOAD | MANUAL LOAD] Automatic load specifies that the IBM® Netezza® system automatically opens the library before any objects that depend on it is used. Manual load specifies that the UDX is responsible for opening and closing manual load libraries when they are needed.
DEPENDENCIES deplibs Specifies an optional list of user-defined shared library dependencies for the UDX. You can specify one or a comma-separated list of library names.
NO DEPENDENCIES Specifies that there are no dependencies for the UDX, which is the default if DEPENDENCIES deplibs is omitted. You can use this option to clear any previous dependencies declared for the UDX.
EXTERNAL HOST OBJECT 'host_object_filename' Specifies the path name to the compiled host object file of the shared library.
EXTERNAL SPU OBJECT 'SPU_object_filename' Specifies the path name to the compiled object file of the shared library for the Linux SPU environment. Specify the spu10 compiled object for Rev10 SPUs on IBM Netezza 100 and Netezza 1000 models.

Outputs

The ALTER LIBRARY command has the following outputs:
Table 2. ALTER LIBRARY outputs
Output Description
ALTER LIBRARY The message that is returned if the command is successful.
ERROR: Unable to calculate cksum for file filename The message that is returned if the object file path name cannot be resolved to a file.
ERROR: lookupLibrary: library libname does not exist The message that the system returns if the specified shared library does not exist in the current database.

Description

You cannot alter a user-defined library that is in use in an active query. After the active query transaction completes, the Netezza system processes the ALTER LIBRARY command to update the library.

Privileges required

To alter a library, you must meet one of the following criteria:
  • You must have the Alter privilege on the LIBRARY object.
  • You must have the Alter privilege on the specific library object.
  • You must own the library.
  • You must be the database admin user, own the current database, or own the current schema on systems that support multiple schemas.
Note: When you issue an ALTER LIBRARY command and specify new object files, the database processes the HOST OBJECT and the SPU OBJECT files as the user nz. The user nz must have read access to the object files and read and execute access to every directory in the path from the root to the object file.

Common tasks

You can use the ALTER LIBRARY command to change the owner of a library. For example:
ALTER LIBRARY library_name OWNER TO name

Usage

The following provides sample usage.
  • To alter a sample library named mylib to set the load option to MANUAL LOAD, enter:
    MYDB.SCHEMA(MYUSER)=> ALTER LIBRARY mylib MANUAL LOAD;


Feedback | Copyright IBM Corporation 2014 | Last updated: 2014-02-28