Skip to content
Zhamri Che Ani edited this page Nov 4, 2024 · 6 revisions

These commands are typically used by database administrators (DBAs) to manage users, permissions, and roles in the database.

Create a New User

CREATE USER "zhamri" IDENTIFIED BY "zhamri123";

Grant Privileges to a User

  1. Grant System Privileges (e.g., creating tables, sessions):
GRANT CREATE SESSION TO "zhamri"; -- Allows user to log in
GRANT CREATE TABLE TO "zhamri";   -- Allows user to create tables
  1. Grant Object Privileges (e.g., access to specific tables):
GRANT SELECT, INSERT, UPDATE ON "d1_student_realtime" TO "zhamri";
  1. Grant Role (e.g., DBA role for full privileges):
GRANT DBA TO "zhamri";

Clone this wiki locally