Hands-On Assignments Create and execute SQL statements to perform the following
ID: 3728948 • Letter: H
Question
Hands-On Assignments Create and execute SQL statements to perform the following actions, using the JustLee Books database 1. Create a new user account. The account name should be a combination of your first initial and your last name. 2. Attempt to log in to Oracle 12c with the newly created account. 3. Assign privileges to the new account that allow connecting to the database, creating new tables, and altering an existing table 4. Using an account with the required privileges, create a role named CUSTOMERREP that 253 allows inserting new rows in the ORDERS and ORDERITEMS tables and deleting rows from these tables. 5. Assign the account created in Assignment 1 the CUSTOMERREP role 6. Log in to Oracle 12c with the new account created in Assignment 1. Determine the privileges currently available to the account 7. Revoke the privilege to delete rows in the ORDERS and ORDERITEMS tables from the CUSTOMERREP role 8. Remove the CUSTOMERREP role from the account created in Assignment 1 9. Delete the CUSTOMERREP role from the Oracle 12c database 10. Delete the user account created in Assignment 1Explanation / Answer
Hi,
1. When you create any new user account you should grant at least one access. Initially, we can grant Session Access to the users so that you can log in.
Script -
CREATE USER books_lee IDENTIFIED BY M_LASTNAME; ( You need to change the pwd as your last name)
Session Access - GRANT CREATE SESSION GRANT ANY PRIVILEGE TO books_lee;
3. Connect to DB - GRANT CONNECT TO books_lee ;
Create or Alter table - GRANT UNLIMITED TABLESPACE TO books_lee ;
4.
a. CREATE ROLE CUSTOMERREP
b. GRANT insert, delete ON Orders TO CUSTOMERREP
GRANT insert, delete ON OrderItems TO CUSTOMERREP
5. GRANT CUSTOMERREP TO books_lee;
Note - For revoking grant just replace Grant to revoke in 4 (a) and (b)
Thanks !
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.