visit
Proficiency in database management is an essential skill for data analysts. Oftentimes, colleagues from different departments need quick access to specific datasets, making the traditional method of exporting Excel files from databases inefficient and time-consuming. A more effective approach involves creating new user accounts in the database and granting them appropriate viewing rights. This allows colleagues to seamlessly connect to the database using tools like Power BI or Power Query, enabling them to access necessary data tables promptly and efficiently. This streamlined process fosters collaboration and supports data-driven decision-making across organizational departments.
CREATE USER 'USERNAME' IDENTIFIED BY 'PASSWORD';
For example:
CREATE USER TEST_USER IDENTIFIED BY TEST123;
[72000][1045] ORA-01045: user TEST_USER lacks CREATE SESSION privilege; logon denied
To enable the user to connect to the database, you must grant the CONNECT role:
GRANT CONNECT TO TEST_USER;
Merely connecting is not enough - make sure to grant the RESOURCE privilege to allow access to the tables.
GRANT CONNECT, RESOURCE TO TEST_USER;
GRANT SELECT ON schema.table_name TO TEST_USER;
If you wish to provide the user with options beyond selection, such as insertion, updating, and deletion, you may proceed with the execution of the following command.
GRANT SELECT, INSERT, UPDATE, DELETE ON schema.table_name TO TEST_USER;
DROP USER TEST_USER;
Also published .