Granting privileges to the new user

Assignment Help Database Management System
Reference no: EM13910552

1. Task 1: Review the following Database Adminstration commands and replace the words in italicized below with the actual value. (For example, replace userName with c281New (everyone needs to use a different username) and userPassword could be c281pwd; use the real table name for tableName; replace roleName with role281):

a. Create a new user:
i. CREATE USER userName IDENTIFIED BY userPassword; (where userName and
userPassword are the desired username and password for the new user)
ii. GRANT CREATE SESSION TO userName; (otherwise the user won't be able to login to the Oracle server)
iii. For example:
1. CREATE USER c281New IDENTIFIED BY c281pwd;
2. GRANT CREATE SESSION TO c281New;
b. Change a user's password:
i. ALTER USER userName IDENTIFIED BY newPassword;
c. Delete/remove a user:
i. DROP USER userName;
d. Grant privileges to a user:

i. GRANT privilege(s) ON tableName TO userName; (PS: privilege(s) can be SELECT, DELETE, UPDATE, etc.)
ii. For example: GRANT SELECT on pangj.TEAM TO ryanj; (ryanj is a username).
e. Remove privileges from a user:
i. REVOKE privilege(s) ON tableName FROM userName;
f. Create a role:
i. CREATE ROLE roleName;
g. Delete a role:
i. DROP ROLE roleName;
h. Grant privileges to a role:
i. GRANT privilege(s) ON tableName TO roleName;
i. Remove privileges from a role:
i. REVOKE privilege(s) ON tableName FROM roleName;
j. Grant a role to a user:
i. GRANT roleName TO userName;

2. Task 2: Creating a new user

a. Login to the Oracle server using SQL Developer and write and execute the SQL command needed to create a new user with a username and password of your choosing.

b. Grant the user CREATE SESSION privileges in order to allow him/her to login to the Oracle server.

c. Now try to login to the Oracle server using the new username and password. In SQL Developer, click on the File tab and select New > Database Connection which will give you a screen. Then edit the connection information to the following, only replace the username and password with the ones you chose for your new user. Then, click the Connect button after. You will be login as the new user.

d. Do a test to see if the new user can access the APPLICATION table owned by your username (it is your MyFranklinUsername original account [pangj is mine]). Issue the following SQL command, only replace yourMyFranklinUsername with your actual myFranklin username (NOT the username for new user) - e.g., in my case, it would be pangj.APPLICATION:

Run "SELECT * FROM pangj.APPLICATION;" (replace pangj with your username)

The new user should SQL Error: ORA-00942: table or view does not exist when running this query since no permission on application table was granted to the new user yet.

3. Task 3: Granting privileges to the new user

a. You should now have TWO simultaneous session tabs in SQL Developer:
i. One using your myFranklin username (we'll call this one ORIGINAL session from now on)
ii. Another one for the new user (we'll call this one NEW session from now on).
iii. In my case, Codd_pangj is my ORIGINAL session using pangj and c281NewUser is the session for the new user c281New (i.e. my NEW session).

b. In your ORIGINAL session tab,
i. Execute an SQL command that grants the new user SELECT privilege on table APPLICATION.
c. Switch to NEW session tab
i. Issue the following commands
SELECT * FROM pangj.APPLICATION; (replace pangj with your actual myFranklin username)
ii. You should not receive error after the SELECT privilege was granted to the new user.
iii. Copy the SQL and output result to Word doc.
iv. Issue an INSERT statement to insert a new record in new user session.
v. Was your insert successful? If not, why?

vi. How to resolve the issue to allow the new user insert, update and delete a record on this APPLICATION table?
vii. Execute the GRANT SQL in the proper session tab and then execute the same insert statement in new user session again after.
viii. Copy the SQL and output result to Word doc with step#.

4. Task 4: Creating a new role and granting privileges
a. In your ORIGINAL session tab,
i. Create a new role with a name of your choosing (newRoleName).
ii. Grant that role INSERT and UPDATE privileges on table APPLICATION.
iii. Grant the new role (newRoleName) to the NEW user you created earlier.
iv. Issue the SET ROLE newRoleName; command (this line tells the Oracle server to enable the corresponding role privileges granted to this user)
b. Go to the NEW session tab
i. Issue same SELECT & INSERT commands you used in Task 3 again.
ii. Were SELECT and INSERT commands executed successfully?
iii. Issue an UPDATE and DELETE command on the new inserted record in APPLICATION table.
iv. Were both commands executed successfully? If not, why?
v. What needs to be done to resolve the issue and make the command execute successfully?
vi. Implement the solution and copy ALL SQL commands and output into Word. Make sure the output is next to the each query.

5. Task 5: Removing privileges
a. In your ORIGINAL session tab
i. Issue an SQL command to remove the SELECT privilege on APPLICATION table from the new user.
ii. Go to NEW session tab
1. Issue the same SELECT, INSERT, UPDATE and DELETE in Task 4.
2. Were step 1 executed successfully?

6. Task 6. Create a View to your data
a. In your ORIGINAL session tab
i. Issue a SQL command to create a view called App_Team that lists the APP_ID,
APP_NAME, TEAM_NAME
ii. Grant select access to App_Team view to the role you created in Task 4 above.
b. Switch to NEW session tab
i. Issue "SELECT * FROM pangj. App_Team;" (replace pangj with your actual
myFranklin username)
ii. Was select data from view executed without issue?
c. How would you create and use a new role to grant access to your tables from this lab to your teammates and instructor?

7. Task 7. Submit in a single zip file containing the following:

a. Your complete MS WORD (NOT PDF or TEXT) report file as described earlier (including ALL SQL commands and their output)
b. 2. One (1) .sql containing all the SQL commands (call it C281lab7.sql)

Reference no: EM13910552

Questions Cloud

Determining present value and focus primarily on dividends : Give a response to the statement:-"You say stock price equals the present value of future dividends? That's crazy! All the investors I know are looking for capital gains."
Determine the specific segment of the market : Differentiate between value-adding service delivery strategies and value-adding support strategies
Describe what each statement tells us and their limitations : A company's financial statements consist of the balance sheet, income statement, and statement of cash flows. Describe what each statement tells us and their limitations.
Company manufacturing : Chandrasekar is running a company manufacturing and selling electronic toy with the installed capacity of 1,00,000 quantities per annum. It is currently selling at 75,000 units
Granting privileges to the new user : Issue an INSERT statement to insert a new record in new user session - Login to the Oracle server using SQL Developer and write and execute the SQL command needed to create a new user with a username and password of your choosing.
Question regarding the strontium chloride : Strontium chloride reacts with silver nitrate according to the equation SrCl2 + 2AgNO3 → 2AgCl + Sr(NO3)2 What is the percentage yield for a reaction in which 2.50 g of AgCl is obtained from 1.50 g of strontium chloride and a slight excess of silv..
How is the neighborhood and extended family : How is the neighborhood and extended family
Software developer development and improvement : Software Developer Development and Improvement.Due Week 9 and worth 60 points This assignment consists of two (2) sections: an improvement plan and a PowerPoint presentation. You must submit the two (2) sections as separate files for the completion o..
What was the total rainfall for the first six months of city : What was the total rainfall for the first 6 months of City #1? What month in City #2 had the lowest amount of rainfall? What two consecutive months in City #2 was the rainfall the same amount?

Reviews

Write a Review

Database Management System Questions & Answers

  Assume the data warehousing system is centralized

Assume the data warehousing system is centralized, and implemented in the environment of Microsoft SQL Server 2012. As we discussed in the introduction, each store has its own local database.

  How much total materials handling cost would be allocated

how much of the total materials handling cost would be allocated to the prefab barns and how much of the total materials handling cost would be allocated to the modular homes?

  Explain k-means clustering algorithm to group the homicides

In this assignment, analyze crime rates using data mining clustering techniques (K-means) to get an accurate prediction to enable police forces to get a clear picture of criminals and solve crimes.

  Write a query that counts the number of maintenance

Write a query that counts the number of maintenance work orders for each vehicle in the maintenance work order table. Display the vehicle column and the corresponding count of work orders for each vehicle

  Difference between navigation mode and editing mode

In Datasheet view, what is the difference between navigation mode and editing mode? What command can you use in Datasheet view to remove the display of one or more fields from the datasheet

  Under which conditions would each type of loop be more

there are 3 kinds of loops-for loop while loop and do while loop. under which circumstances would each kind of loop be

  Torri manufacturing corporation -determine unit product cost

Determine the unit product cost of each of the company's two products under the traditional costing system

  Determine the total amount of indirect factory wages

Determine the total amount of indirect factory wages and factory equipment depreciation costs that would be allocated to the Product Processing activity cost pool.

  Explain web forms with database interaction

Web Forms with Database Interaction, you will start with the form created in Week 2 and add functionality to INSERT records into a database table and SELECT records for display to the user

  Illustrate concurrency control method by two phase locking

For each table argue whether or not interference with another transaction is possible. Illustrate concurrency control method using two phase locking.

  Find the resulting tuples of the given query

What time does it take to find the resulting tuples of the given query: "List the names of all students who are taking a class in the Turing Auditorium".

  Various kinds of keys to form or define relationships

Relational database is based on fact that data in one table can be tied, or related to data in another table. To do this, database utilizes various types of keys to form or define these relationships.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd