For users to access your 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 |
2. | Use the SQL statement CREATE USER to create a database user account |
CREATE USER <username> identified by <password>; |
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.
System 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.
Object 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.
1. | To grant CREATE TABLE privilege to a user called HR: |
GRANT CREATE TABLE TO HR; | |
2. | To revoke DELETE privilege on EMPLOYEES from HR: |
REVOKE DELETE ON EMPLOYEES FROM HR; | |
For more information on user accounts and privileges, refer to the Oracle TimesTen In-Memory Database Operations Guide.
Home | Site Map | Contact Us | Copyright © 2011 |