sp_iqlocklogin procedure

Function

Locks an IQ user account so that the user cannot log in.

Syntax1

call sp_iqlocklogin (‘userid’[, 'server-name' | 'all servers'] ‘[lock | unlock]’) 

Syntax2

sp_iqlocklogin 'userid’[, 'server-name' | 'all servers'] ‘[lock | unlock]’ 

Syntax3

sp_iqlocklogin userid [, 'server-name' | 'all servers'] ‘[lock | unlock]’ 

Permissions

DBA authority required.

Usage

userid Name of the account to be locked or unlocked.

server-name If specified, restricts the setting to named server. The server name argument is only valid in multiplex environments, and the specified server name must be a valid server name in the IQ_MPX_INFO system table. If all servers is specified, removes all server level settings and specifies global default setting for all servers in the multiplex.

If not specified, locks the user by default on a global basis. In a multiplex environment, the global default lock status may be overridden on a server by server basis, so user IDs locked by default globally may not be locked out of specific servers.

all servers Removes all server level settings and specifies global setting for all servers in multiplex.

See also

“sp_iqmodifyadmin procedure”

Description

When Sybase IQ Login Management is enabled, the DBA can use sp_iqlocklogin to prevent or enable a specified user’s ability to log in to the database.

You cannot lock yourself or the DBA account out of the database. Connected users can be locked, but they remain connected. A locked account can be specified as a database owner, and can own objects in any database.

Errors

The following errors may occur. Causes are listed after each error.

Permission denied: You do not have permission to execute the procedure sp_iqlocklogin.

Cause: A user without DBA role tried to execute sp_iqlocklogin.

RAISERROR executed: You cannot lock yourself out.

Cause: User tries to lock him or herself out.

RAISERROR executed: "The user DBA cannot be locked."

Cause: User tried to lock the DBA user.

RAISERROR executed: "Invalid option <what the user entered> was specified.” "

Cause: User typed in invalid input.

RAISERROR executed: Server name <server name> not found.

Cause: server name value specified did not match a valid server name in IQ_MPX_INFO.

RAISERROR executed: Server name parameter not allowed with this option in non-multiplex mode

Cause: procedure was called with server name argument in a non-multiplex environment.

Examples

The following examples lock out the user rose.

sp_iqlocklogin 'rose', 'lock'
call sp_iqlocklogin ('rose', 'lock')

The following example unlocks the account of the user rose.

sp_iqlocklogin rose, 'unlock'

The following locks the login for user fred on all servers in the multiplex and removes server level settings for user fred:

sp_iqlocklogin('fred', 'lock', 'all servers')

The following locks the login for user fred by default globally. Note that in a multiplex, server-level settings can override this global default.

sp_iqlocklogin('fred')

The following locks the login for user mary on server query2:

sp_iqlocklogin('mary', 'lock', 'query2')