Ask DBMS Expert


Home >> DBMS

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)

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M91583481
  • Price:- $150

Guranteed 48 Hours Delivery, In Price:- $150

Have any Question?


Related Questions in DBMS

Data mining assignment -in this assignment you are asked to

Data Mining Assignment - In this assignment you are asked to explore the use of neural networks for classification and numeric prediction. You are also asked to carry out a data mining investigation on a real-world data ...

Sql query assignment -for this assignment you are to write

SQL Query Assignment - For this assignment you are to write your answers in a word document. This assignment is in three parts: Part A (reporting queries), Part B (query performance), Part C (query design). For this assi ...

The groceries datasetimagine 10000 receipts sitting on your

The groceries Dataset Imagine 10000 receipts sitting on your table. Each receipt represents a transaction with items that were purchased. The receipt is a representation of stuff that went into a customer's basket. That ...

You are in a real estate business renting apartments to

You are in a real estate business renting apartments to customers. Your job is to define an appropriate schema using SQL DDL in MySQL. The relations are Property(Id, Address, NumberOfUnits), Unit(ApartmentNumber, Propert ...

Objectivethe objective of this lab is to be familiar with a

OBJECTIVE: The objective of this lab is to be familiar with a process in big data modeling. You're required to produce three big data models using the MS PowerPoint software. This tool is available on UMUC Virtual Deskto ...

The relation memberstudentid organizationid roleid stores

The relation Member(StudentId, OrganizationId, RoleId) stores the membership information of student joining organization. For example, ('S1', 'O2', 'R3') indicates that student with Id 'S1' joined the organization with i ...

Relational database exerciseyou have been assigned to a new

Relational Database Exercise: You have been assigned to a new development team. A client is requesting a relational database system to manage their present store with the anticipation of adding more stores in the future. ...

Relational database design a given the following business

Relational Database Design A) Given the following business rules, identify entity types, attributes (at least two attributes for each entity, including the primary key) and relationships, and then draw an Entity-Relation ...

We can represent a data set as a collection of object nodes

We can represent a data set as a collection of object nodes and a collection of attribute nodes, where there is a link between each object and each attribute, and where the weight of that link is the value of the object ...

Data model development and implementationpurpose of the

Data model development and implementation Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop data models and map Database System into a standard development environment to gain unde ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As