thesuhu

Oracle Sysdba Basic

Sep 16th, 2020 (edited)
669
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Creating a new user and granting privileges
  2. sqlplus
  3. Enter user-name: sys as sysdba
  4. Enter password:
  5.  
  6. # 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:
  7. SHOW con_name;
  8. CON_NAME
  9. ------------------------------
  10. CDB$ROOT
  11.  
  12. # switch to a pluggable database, bisa lihat servicename di tnsnames.ora
  13. ORCLPDB1
  14.  
  15. # show command again,
  16. SHOW con_name;
  17. CON_NAME
  18. ------------------------------
  19. ORCLPDB1
  20.  
  21. # Before creating a new user, you need to change the database to open
  22. ALTER DATABASE OPEN;
  23.  
  24. # Create user in the pluggable database
  25. CREATE USER MIMIT IDENTIFIED BY Orcl123;
  26.  
  27. # Grant priviliges
  28. GRANT CONNECT, RESOURCE, DBA TO MIMIT;
  29.  
  30. # melihat user dengan kewenangan sysdba
  31. desc v$pwfile_users;
  32. select * from v$pwfile_users;
  33.  
  34. # melihat semua user
  35. SELECT * FROM all_users ORDER BY created;
  36.  
RAW Paste Data