Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Creating a new user and granting privileges
- sqlplus
- Enter user-name: sys as sysdba
- Enter password:
- # When you connect to the Oracle database server, you connect to a container database (CDB) named ROOT. To show the current database, you use the SHOW command:
- SHOW con_name;
- CON_NAME
- ------------------------------
- CDB$ROOT
- # switch to a pluggable database, bisa lihat servicename di tnsnames.ora
- ORCLPDB1
- # show command again,
- SHOW con_name;
- CON_NAME
- ------------------------------
- ORCLPDB1
- # Before creating a new user, you need to change the database to open
- ALTER DATABASE OPEN;
- # Create user in the pluggable database
- CREATE USER MIMIT IDENTIFIED BY Orcl123;
- # Grant priviliges
- GRANT CONNECT, RESOURCE, DBA TO MIMIT;
- # melihat user dengan kewenangan sysdba
- desc v$pwfile_users;
- select * from v$pwfile_users;
- # melihat semua user
- SELECT * FROM all_users ORDER BY created;
RAW Paste Data