Tuesday, November 19, 2024

.::: Create user Oracle Database 19C & Priviledge admin & specific table :::


1. create user & priviledge admin

CREATE USER admin IDENTIFIED BY oracle;
GRANT CONNECT, RESOURCE,oem_monitor TO admin;
ALTER USER admin QUOTA UNLIMITED ON USERS;

-- Membuat user admin dengan password oracle
CREATE USER admin IDENTIFIED BY oracle;

-- Memberikan hak akses dasar kepada user admin
GRANT CONNECT, RESOURCE,oem_monitor TO admin;

-- Memberikan hak akses untuk melakukan administrasi
GRANT CREATE SESSION TO admin;
GRANT UNLIMITED TABLESPACE TO admin;
GRANT DBA TO admin;

-- Memberikan hak akses untuk membaca data dictionary (opsional)
GRANT SELECT ANY DICTIONARY TO admin;

 


2. only table (specific table)

-- Membuat user readone dengan password readone
CREATE USER readone IDENTIFIED BY readone;

-- Memberikan hak akses dasar untuk login ke database
GRANT CONNECT TO readone;
GRANT CONNECT, RESOURCE,oem_monitor TO readone;

-- Memberikan hak akses SELECT (baca) hanya pada tabel pembelian
GRANT SELECT ON aisyah.pembelian TO readone;

GRANT SELECT ON aisyah.pembelian TO readone;
ALTER USER aisyah QUOTA UNLIMITED ON readone;

ALTER USER readone IDENTIFIED BY readone;
ALTER USER readone ACCOUNT UNLOCK;

 


3. create user access

-- Membuat user aisyah dengan password hanin
CREATE USER aisyah IDENTIFIED BY hanin;

-- Memberikan hak akses dasar kepada user aisyah
GRANT CONNECT, RESOURCE,oem_monitor TO aisyah;

-- Memberikan hak akses untuk melakukan aisyahistrasi
GRANT CREATE SESSION TO aisyah;
GRANT UNLIMITED TABLESPACE TO aisyah;
GRANT DBA TO aisyah;

-- Memberikan hak akses untuk membaca data dictionary (opsional)
GRANT SELECT ANY DICTIONARY TO aisyah;


4. check user 

SELECT username, account_status, created,expiry_date, profile,last_login
FROM dba_users where inherited='NO'
 

No comments:

Post a Comment

Popular Posts