Document Type | Technical Information
Category | Administration/Configuration
Applicable Product Version | -
Document Number | TADTI241
Overview
This guide explains User management required for Tibero Single DB operation.
Method
7. User Management
7.1. Creating a User
7.1.1. Connect to the Database as sys User
When creating a Tibero User, connect with a user (sys user) granted DBA privileges.
Caution
This applies if the sys user password is tibero.
$ tbsql sys/tibero
7.1.2. Creating a Tablespace
Before creating a User, you must first create a default Tablespace that the User will use.
When creating a Tablespace, create at least one datafile included in it.
SQL> create tablespace TEST datafile '/tibero/tbdata/data_1/test1.dtf' size 100m;
โ Creates a Tablespace named โTESTโ for the new User to use, including a 100MB datafile
in the tablespace.
SQL> select tablespace_name, file_id, file_name from dba_data_files;
TABLESPACE_NAME FILE_ID FILE_NAME
--------------------------- ------------ -------------------------------------
TEST 7 /tibero/tbdata/data_1/test1.dtf
โ Queries the newly created Tablespace โTESTโ and its included datafile.
SQL> select ts#, file#, name, status, create_bytes/1024/1024 from v$datafile;
TS# FILE# NAME STATUS CREATE_BYTES/1024/1024
------- -------- -------------------------------------- ------------- -------------------------------------
7 7 /tibero/tbdata/data_1/test1.dtf ONLINE 100
โ Confirms the name, status, and size of the datafile included in the โTESTโ tablespace.
7.1.3. Creating User and Granting Privileges
SQL> create user edu identified by password 'EDU123!' default tablespace TEST temporary
tablespace TEMP;
โ Creates a user named 'EDU' with default Tablespace โTESTโ and Temporary Tablespace โTEMPโ.
SQL> grant connect, resource to EDU;
โ Grants privileges (connect, resource) to the user 'EDU'.
(connect: allows the user to connect to the Database
resource: grants the user privileges to create tables, sequences, triggers, procedures, etc.)
SQL> select username from dba_users;
USERNAME
------------------
EDU
โ Checks whether the user 'EDU' exists in the Database.
7.2. Deleting a User
SQL> drop user EDU cascade;
โ Deletes the user named EDU.
Specifying cascade deletes all objects in the userโs schema and then deletes the user.