ConnectAs

Description

Allows the user to connect to the Oracle Server with SYSOPER or SYSDBA system privileges. Supports proxy authentication with additional user names (ORA driver only) when connecting to Oracle 10.2 or higher database servers.

Applies to

O90 Oracle9i

O10 Oracle 10g

ORA Oracle (for 11g and later)

Syntax

ConnectAs='value'

Parameter

Description

value

Values are:

  • [EndUser] (ORA driver only) Type the proxy user name you want to use for your connection

  • SYSDBA

  • SYSOPER

  • Default (this parameter is not used)


Default value

Normal

Usage

If ConnectAs='Default', this parameter is not used. If ConnectAs ='SYSDBA' or ConnectAs ='SYSOPER', Oracle allows the user to connect with SYSDBA or SYSOPER privileges, respectively, provided that these privileges have been granted the user.

If you connect using ConnectAs ='SYSDBA', Oracle uses the SYS schema instead of the schema that might already be associated with the user ID. If you connect using ConnectAs ='SYSOPER', Oracle uses the PUBLIC schema.

The PowerBuilder ORA driver supports the proxy authentication feature that was introduced in Oracle 10.2. With proxy authentication, the end user typically authenticates to a middle tier (such as a firewall), that in turn logs into the database on the user's behalf as a proxy user. After logging into the database, the proxy user can switch to the end user's identity and perform operations using the authorization accorded to that user.

The ConnectAs DBParm parameter allows you to take advantage of this proxy connection feature, in the following methods:

#1: With ConnectAs DBParm set to the real user (for example, "John"), the user's Transactionobject LogID set to the proxy user (for example, "Scott"), the OCI client logs in to database as the proxy user ("Scott"), then switches to the end user identity ("John"). See example 2 below.

#2: With ConnectAs DBParm set to "Default", Login ID set to "proxy_user[real_user]" (for example, "Scott[John]"), and Password set to the password of the proxy user, the OCI client logs in to the database as the proxy user ("Scott") and then switches to the end user identity ("John"). See example 3 below.

If you are using connection or session pooling, the proxy user name is the connection or session pooling creator (which you can provide in the PoolCreator and PoolPwd DBParm parameters), and the Transaction object's LogID is ignored. No proxy session can be created if pooling is set to homogeneous session mode.

Do not use with CnnPool='Yes'

Connection pooling cannot be used with this parameter. Do not select Use Connection Pool in the Database Profile Setup dialog box or set CnnPool to 'Yes'.

Examples

Example 1

To use the SYS schema instead of the schema associated with the User ID:

  • Database profile

    Select SYSDBA from the Connect As drop-down list on the Connection page in the Database Profile Setup dialog box, and make sure Use Connection Pool is deselected.

  • Application

    Type the following in code:

    SQLCA.DBParm="ConnectAs='SYSDBA'"

Example 2

To connect as a proxy user (Scott) for the end user named John:

  • Database profile

    Type "scott" in the Login ID text box on the Connection page in the Database Profile Setup dialog box, and type "john" in the ConnectAs drop-down list.

    Select Connection Pooling or Session Pooling from the Pooling Type drop-down list.

  • Application

    Type the following in code:

    sqlca.logid = "scott"
    SQLCA.LogPass = "password for scott"
    sqlca.dbparm = "ConnectAs='john',Pooling='Connection Pooling'"

Example 3

To connect as a proxy user (Scott) for the end user named John:

  • Database profile

    Type "scott[john]" in the Login ID text box on the Connection page in the Database Profile Setup dialog box, and select Default from the ConnectAs drop-down list.

  • Application

    Type the following in code:

    sqlca.logid = "scott[john]"
    SQLCA.LogPass = "password for scott"
    sqlca.dbparm = ""