Permissions Within Databases

Permissions or privileges you are granted determine the actions you can perform on databases and database objects.

Ordinarily, a system administrator or database owner sets up permissions for you, based on the kind of work you do and the functions you need. These permissions can be different for each user in an installation or database.

Determine what your permissions are by executing:

sp_helprotect user_name

where user_name is your SAP ASE login name.

The pubs2 and pubs3 databases have a guest user name in their sysusers system tables. The scripts that create pubs2 and pubs3 grant a variety of permissions to “guest.”

The “guest” mechanism means that anyone who has a login on SAP ASE, that is, anyone who is listed in master..syslogins, has access to pubs2 and pub3, and permission to create and drop such objects as tables, indexes, defaults, rules, procedures, and so on. The “guest” user name also allows you to use certain stored procedures, create user-defined datatypes, query the database, and modify the data in it.

To use the pubs2 or pubs3 database, issue the use command. SAP ASE checks whether you are listed under your own name in pubs2.sysusers or pubs3..sysusers. If not, you are admitted as a guest without any action on your part. If you are listed in the sysusers table for pubs2 or pubs3, SAP ASE admits you as yourself, but may give you different permissions from those of “guest.”

Most users can look at the system tables in the master database by using the “guest” mechanism. Users who are not recognized by name in the master database are allowed in and treated as a user named “guest.” The “guest” user is added to the master database in the script that creates the master database when it is installed.

A database owner, “dbo,” can add a “guest” user to any user database using sp_adduser. System administrators automatically become the database owner in any database they use. See, Getting Started with Security Administration in SAP ASE, in the System Administration Guide: Volume 1.