Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Having a hard time with these questions. Please provide code of how to complete

ID: 3806661 • Letter: H

Question

Having a hard time with these questions. Please provide code of how to complete these questions

Use SQL Plus for questions 1 and 5

Use SQL Developer for questions 2, 3,4,6,7.

1. Use SQLPlus to connect as user1. Explain what happened and way to fix it.

2. Give user1 permission to see information in OE.CUSTOMERS table

3. Test the permission you granted

4. As user1 update the last name of the customer with customer ID 188. Explain results.

5. Use SQLPlus. Login as user1, and describe how you changed the password.

6. Check permissions you granted by using data dictionary view

7. Check permissions you granted by using user1 account to update OE.CUSTOMERS table.

Any help would be greatly appreciated.

Explanation / Answer

1. To connect with Sqlplus as user 1 you can do sqlplus user1/<password>@<dbName> or from the sqlplus window

conn user1/<password>

2. to grant user1 permission you jave to login with the owner of OE.CUSTOMERS table i,e, OE or as sys and then execute the below SQL

GRANT select on OE.CUSTOMERS to USER1;

3. To test the permission you can login with USER1 again and execute a select command like SELECT * FROM OE.CUSTOMERS . If the query executes fine then your permission is working.

4. To update the last name USER1 needs the UPDATE grant on OE.CUSTOMERS table which it does not have currently. So USER1 wont be able to update the last name. If OE or sys gives the UPDATE grant on OE.CUSTOMERS to USER1 by GRANT UPDATE ON OE.CUSTOMERS to USER1 then it is possible. After updating USER1 needs to commit so that the changes are posted and all users across all session will see the modified data.

5. To change the password you need to execute this SQL : ALTER USER USER1 identified by <new_password>;

6. To check from the data dictionary you need to execute the below SQL which will return all the privileges that USER1 is having on OE.CUSTOMERS

select u.PRIVILEGE from user_tab_privs u where u.TABLE_NAME = CUSTOMERS' and u.GRANTOR ='OE' and u.GRANTEE = 'USER1';

7. you need to execute the same SQL as mentioned in point 6 above. If it returns an UPDATE privilege then USER1 is having UPDATE permission on OE.CUSTOMERS else not.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote