Managing User Accounts and Privileges

For users to access your TimesTen database, you must create user accounts and grant appropriate database access privileges to those accounts. A user account is identified by a user name and a password. Only the instance administrator and users with the system privilege ADMIN can create user accounts.

Creating a User Account

To create a new database user, perform the following steps:

  1. Enter ttisql at the OS command prompt to launch ttIsql and connect to your database

    ttIsql


  2. Use the SQL statement CREATE USER to create a database user account.

    CREATE USER <username> identified by <password>;


User Privileges

Once a user account has been created, the appropriate user privileges should be granted to the account. They should be granted based on their needs. For example, an application developer needs privileges to insert into tables and to execute stored procedures. However, a developer would not typically be allowed to perform administrative tasks such as backing up the database and removing user accounts.

There are two types of user privileges.

1. System privileges
These privileges give a user the ability to perform system-level activities across multiple objects in the database, or to perform an action on any schema objects of a particular type. For example, the system privilege CREATE TABLE permits a user to create tables in the schema associated with that user.

2. Object privileges
These privileges give a user the ability to perform a particular action on a specific schema object. The privilege to delete rows from the EMPLOYEES table is an example of object privileges. The owner (the creator) of the object always has full privileges to the object.

For a listing of the available privileges, refer to the Oracle TimesTen In-Memory Database SQL Reference.


Granting and Revoking Privileges

The SQL statements GRANT and REVOKE enable system and object privileges to be granted to and revoked from database users. For example:

  1. To grant the CREATE TABLE privilege to a user called HR, run the following command:

    GRANT CREATE TABLE to HR;


  2. To revoke the DELETE privilege on EMPLOYEES from HR, run the following command:

    REVOKE DELETE ON EMPLOYEES from HR;


For more information on user accounts and privileges, refer to the Oracle TimesTen In-Memory Database Operations Guide.