Use the RENAME TRUSTED CONTEXT statement to change the name of a trusted-context object.

This statement is an extension to the ANSI/ISO standard for SQL. You must hold the database security administrator (DBSECADM) role to rename a trusted context.


1  RENAME TRUSTED CONTEXT  old_name TO new_name
Element Description Restrictions Syntax
old_name Trusted context identifier that new_name replaces Must be an existing trusted-context object of the database server Identifier
new_name New name that you declare here for the trusted context Must be a one-part name, without qualifiers. It cannot begin with the characters "SYS" and must not identify a trusted context that already exists on the database server. Identifier


The new_name and the old_name cannot include qualifiers, such as owner, database, or dbserver.

After the RENAME TRUSTED CONTEXT statement successfully executes, all references to the old_name will be replaced by new_name in these tables in the sysuser database of the HCL OneDB™ database server instance:
  • systrustedcontext
  • systcxattributes
  • systcxusers.

In addition, applications that attempt to establish a connection to the database by referencing the old_name will fail, unless the old_name has been declared as the identifier of a new trusted-context object.

If you rename the trusted context while trusted connections for this context are active, those connections remain trusted until they terminate, or until the next reuse attempt. If an attempt is made to switch the user on these trusted connections, however, an error is returned.

The following example of a complete RENAME TRUSTED CONTEXT statement replaces the security-object identifier cntx1 with cntx2 as the new name for the cntx1 trusted context:
This example fails under either of the following circumstances:
  • if cntx1 is not the name of a trusted-context object of the current database server instance,
  • or if cntx2 is already the name of an existing trusted-context object of the same database server.