Sei sulla pagina 1di 2

Week2LabCreateUsersandtables

Part1:CreationOfUserAccounts
Scenario:
Youhavebeenassignedthetaskofwritingascriptforcreatingdatabaseusers.The
scriptwillperformthefollowingtasksandconformtothefollowingspecifications:
1.Createthefollowingtwo(2)userswiththeirrespectivepasswords.Pleaseusethe
exactspelling.(15points)
UserName
Password
DBSEC
IS481%sec
VPD_CLERK1
Nancy#481
Thefollowingparametersapplytotheabovetwo(2)users.
2.ThedefaulttablespaceisUSERS.(5points)
3.ThetemporarytablespaceisTEMP.(5points)
4.Theuserhastochangehis/herpasswordthefirsttimewhenhe/sheloginthe
database.(5points)
5.TheuseraccountwillbeassignedtotheDEFAULTprofile.(5points)
6.TheUSERStablespacehasa30MBquota.(5points)
7.Attheendofthecreation,listtheuserinformationthatshowsasuccessfulcreationof
theaboveuseraccount.(5points)
Tips:
a.Youneedsystemprivilegetocreatenewuser.AneasywayistologinasSYSTEM
beforerunningthescript.Or,youmayuse"CONNECTsystem"or"CONNECT
system/&password."Uponrunningyourscript,youwillenterthepassword.The
passwordiswhatyouenteredinyourinstallation.
b.YouwillwritethescriptinNotepadorWordPad.Inordertotestitagainandagain,it
isagoodideatoaddonestatementofdroppingtheuseratthebeginningofthescript.
Thedropstatementwillbelike"DROPUSERdbsecCASCADE."
c.Adatabasedictionaryview"dba_users"canbeusedtofinduserinformation.There
are,ofcourse,otherwaystodoit,whichareacceptableaswell.
d.PleasenotethatthepasswordspecificationiscasesensitiveeventhoughOracle
SQLstatementingeneralisnotcasesensitive.
Part2:ModifyUserandCreateTables

Thispartofthelabrequiresyoutouseallpreviousknowledgetocreatedatabase
objectsandpopulatedataintotables.Itwillprepareyoufordatabaseobjectstopractice
variousdatabasesecuritytechniquesinthiscourse.
Youneedtocreateone(theonlyone)SQLscriptthatwillcompletethefollowingtasks:
1. ConnecttoSYSTEMuser.(5points)WhenyouneedtoconnecttoSYSTEM
users,pleaseuseasyntaxsothatitwillasktheusertotypethepassword.A
typicalexamplewillbe:"connectsystem"
2. Changethepasswordoftheuser"DBSEC"to"secc$1new."Pleasenotethatthe
period"."isnotapartofthepasswordspecification.(5points)
3. GranttheDBSECuserwith"CREATESESSION"and"CREATETABLE"
privileges.(5points)
4. ConnecttoDBSECwiththenewpassword.(5points)
5. Createall17tables(SUPPLIER,SHIPMENT_METHOD,DEPARTMENT,JOB,
EMPLOYEE,SALES_COMMISSION,PROMOTION,CATEGORY,PRODUCT,
PRODUCT_SUPPLIER,PRODUCT_PRICE,PRODUCT_INVENTORY,
PAYMENT_METHOD,CUSTOMER,ORDER_TAB,ORDER_LINE,
EMPLOYEE_RANK)underDBSECschema.(30points)
6. PopulateSUPPLIERtablewiththedata.(20points)
Tip:
Tobeabletorepeatedlytestyourscript,youmayadd"DROPTABLEtablename"
atthebeginningofyourfiletodropalltables.
SubmissionRequirement:
TheSQLscriptfileswillberequiredandthescreencaptureofthelabcompleted
steps.

Potrebbero piacerti anche