Overview of
Oracle8i
I
n this c hapter, I’ll intro duc e yo u to Orac le8i. I’ll c o ver the key fac ilities inc luded with the pro duc t, its arc hitec ture, and ho w sec urity wo rks. Then I’ll c o ver ho w to use Visual Basic and ADO 2.5 with Orac le8i, inc luding ho w to b uild a c o nnec tio n string and ho w Orac le’s data types map into Visual Basic .Overview
Orac le8iis the mo st widely used relatio nal database manage-ment system ( RDBMS) in the wo rld. It’s well kno wn fo r its high perfo rmanc e and stability. It runs o n mo st c o mputer systems, inc luding mo st Unix variants suc h as Sun’s So laris, Hewlett-Pac kard’s HP-UX, IBM’s AIX and OS/ 390 ( MVS/ ESA/ XA) , and even Linux. Of c o urse it will also run o n Mic ro so ft Windo ws 2000/ NT Server o perating systems.
Orac le8iinc ludes these key features:
✦High perfo rmanc e
✦Integrated Internet c apabilities
✦High availability with auto mated standby database
✦Extensive Java and XML suppo rt ✦Suppo rt fo r OLE DB and ODBC
✦Suppo rt fo r data wareho using and Very Large Databases ( VLDB)
✦Integratio n with Windo ws 2000 servic es and to o ls
Oracle8
i
editions
Orac le8ic o mes in fo ur editio ns: Lite, Perso nal, Standard, and Enterprise. Sinc e the same c o re database engine arc hitec ture is used fo r all o f these editio ns, c o mpatibil-ity is assured thro ugho ut the pro duc t line.
The Lite Edition
Orac le8iLite is targeted at enviro nments where the smallest po ssible database sys-tem is needed, like mo bile lapto p c o mputers, handheld c o mputers, and info rmatio n applianc es. It inc ludes built-in replic atio n to Orac le8iStandard Editio n and Orac le8i
Enterprise Editio n to fac ilitate easy exc hange o f info rmatio n. While so me features o f the larger versio ns o f Orac le8iare missing, yo u c an run Orac le8iLite Editio n with as little as o ne megabyte o f memo ry and five megabytes o f disk spac e.
The Personal Edition
Orac le8iPerso nal Editio n supplies a single user so lutio n that is targeted at develo p-ers who want to develo p and test their pro grams in a standalo ne situatio n and then deplo y them against a Standard Editio n server o r an Enterprise Editio n server. Yo u c an also use this Editio n in situatio ns where yo ur applic atio n suppo rts o nly a single user o n a single c o mputer.
Yo u c an run Orac le8iPerso nal Editio n o n Windo ws 98, Windo ws 2000, and Windo ws NT. It inc ludes all o f the same features and o ptio ns fo und o n Orac le8iEnterprise Editio n, inc luding Advanc ed Queuing and Orac le Partitio ning. No te that so me fea-tures may rely o n fac ilities that aren’t present in Windo ws 98.
Freebie copy of Oracle8i(at least for 30 days): You can dow nload a dem o ver-sion of the Personal Edition from Oracle’s Web site at technet.oracle.com. You w ill be required to register before you can access this site, but there are no charges for registering. This Web site also has a w ealth of inform ation that you w ill find useful w hen w orking w ith Oracle databases.
The Standard Edition
Orac le8iStandard Editio n inc ludes all o f the to o ls nec essary to build ro bust multi-user applic atio ns. It represents an affo rdable alternative to the Enterprise Editio n when yo u do n’t require all o f the advanc ed features. So me o f the key features o f the Standard Editio n inc lude:
✦Exte nsive Java support. While no t impo rtant to mo st Visual Basic pro gram-mers, this feature is useful when develo ping multi-platfo rm applic atio ns. ✦Windows spe cific support. Inc ludes native ODBC and OLE DB drivers,
sup-po rt fo r Mic ro so ft Transac tio n Server, App Wizard fo r Visual Studio , and OLE Objec ts fo r Orac le.
The Enterprise Edition
Orac le8iEnterprise Editio n is Orac le’s high-end datab ase management system. It is targeted at applic atio ns that experienc e high vo lumes o f transac tio ns and that req uire very high levels o f availab ility. So me o f the key features in the Enterprise Editio n inc lude:
✦Transpare nt Application Failove r/ Automate d Standby Database —a key to o l fo r pro viding high availability. It allo ws yo u to have standby database server that is ready to take o ver in c ase o f a database o r applic atio n failure.
✦Oracle Paralle l Se rve r— a high perfo rmanc e feature that allo ws yo u to divide yo ur database into multiple c hunks, where eac h c hunk exists o n a separate physic al c o mputer. This allo ws fo r higher perfo rmanc e, sinc e multiple c o m-puters are ac tively pro c essing data. The database servers are c lustered to gether to fo rm a single view o f the system to make it easy to use. ✦Oracle Partitioning— a feature that allo ws yo u to break large tables into
smaller, individually-managed tables, whic h c an be spread ac ro ss multiple servers using Orac le Parallel Server. This feature is extremely useful when managing data wareho uses.
✦Inte rne t File Syste m— a feature that makes an Orac le8idatabase appear as a shared netwo rk drive. It suppo rts a wide variety o f standard pro to c o ls, inc lud-ing HTML, FTP, and IMAP4, whic h allo ws a large number o f users to sto re and retrieve data using a platfo rm that o ffers better reliability than a no rmal net-wo rked disk drive.
✦Oracle Time Se rie s and Oracle Spatial— to o ls that are useful when building a data wareho use. Orac le Time Series allo ws yo u to sto red time stamped data effic iently in an Orac le database, while Orac le Spatial allo ws yo u to analyze data suc h as the pro ximity o f a c usto mer to a sto re lo c atio n.
The best things in database aren’t free:Som e of the features available in the Enterprise Edition are extra cost item s. Check the Oracle Web site for m ore infor-m ation about w hich iteinfor-m s aren’t standard and how infor-m uch they cost.
Oracle8
i
utilities
Orac le8ihas the fo llo wing utilities that yo u will use while develo ping yo ur applic a-tio ns: SQL*Plus, Enterprise Manager, SVRMGR, PL/SQL, Net8, and Orac le Management Server. The key utility is c alled SQL*Plus and is used fo r a number o f different tasks, fro m c reating tables to testing sto red pro c edures. Enterprise Manager is a to o l similar to SQL Server’s Enterprise Manager and is used to help yo u design databases and per-fo rm o ther system management-related func tio ns.
SQL*Plus
SQL*Plus is a general-purpo se query to o l like Mic ro so ft’s Query Analyzer. This to o l allo ws yo u to enter SQL statements and exec ute them. There are two versio ns o f this to o l. One o perates in a DOS windo w, while the o ther runs in its o wn windo w ( see Figure 26-1) . Bo th versio ns are c o mmand-driven ( i.e., yo u type c o mmands rather than selec ting menu items and/ o r pressing butto ns) .
Figure 26-1: Running SQL*Plus Worksheet in a w indow.
Enterprise M anager
Figure 26-2: Running Enterprise Manager.
SVRM GR
The SVRMGR utility allo ws yo u to c o ntro l the databases running o n yo ur server (see Figure 26-3). Yo u c an use this to o l to start and sto p yo ur database, as well as run o ther SQL c o mmands. Like SQL*Plus, it has bo th windo wed and DOS-based versio ns.
Bigger is better: The norm al DOS w indow displays only 25 lines. You can increase the num ber of lines displayed to 43 or 50 by right clicking on the icon in the upper-left corner of the w indow and choosing Properties and then the Screen tab. You can also enable the scrollbars to display even m ore lines. Both options m ake it easier to see your results before they scroll off the top of the screen.
PL/ SQL
PL/ SQL is Orac le’s implementatio n o f the SQL standard. It inc ludes a number o f extensio ns that make it a very po werful language fo r c reating sto red pro c edures. As yo u might expec t, PL/ SQL is no t c o mpatible with TSQL in many areas, suc h as pro -c edural statements and data definitio n statements. Fo r the mo st part, statements like Se le ctand Updatewill wo rk the same as they do in o ther database systems.
Net8
Net8 isn’t really a utility as muc h as it is a c ritic al part o f the netwo rk c o mmunic a-tio ns required to o perate Orac le8i. It permits yo u to define vario us external c o mmu-nic atio ns pro to c o ls fo r different types o f c lients and translate them into an internal database pro to c o l that is independent o f the c lients. On yo ur database server, Net8 is also used to handle database-to -database c o mmunic atio ns fo r things like remo te database ac c ess and replic atio n. A c o py o f Net8 also runs o n yo ur lo c al c o mputer. The OLE DB pro vider passes yo ur database requests to Net8, whic h in turn ro utes them to the appro priate database server.
By any other name: Net8 w as know n as SQL*Net in previous versions of the Oracle database server.
Oracle M anagement Server
Orac le Management Server is a utility pro c ess that allo ws yo u to manage the vari-o us c vari-o mpvari-o nents in an Orac le8idatabase system. It runs as its o wn pro c ess and maintains its o wn separate sec urity system. It is tightly integrated with Enterprise Manager and pro vides fac ilities that allo w Enterprise Manager to manage multiple database instanc es.
Understanding the Database Architecture
Like SQL Server, Orac le8iuses a true c lient/ server arc hitec ture. This means that the database server runs in a different address spac e fro m the c lient pro gram, and the c lient and server c an be run o n different c o mputers. Unlike SQL Server, Orac le8ic an run o n a variety o f hardware platfo rms. This means that so me o f the func tio ns imple-mented o n Windo ws will lo o k and ac t a little differently than applic atio ns designed fo r no n-Windo ws o perating systems. Ho wever, the c o re Orac le8idatabase arc hitec -ture is the same no matter whic h o perating system is ho sting the database server.
Key database objects
Orac le8ic o nsists o f o ne o r mo re databases o n the database server. Eac h database is kno wn as an instance. Unlike SQL Server, whic h maintains a single database server with multiple databases beneath it, eac h Orac le8idatabase server is a unique instanc e and requires an independent so ftware installatio n.
Tablespaces
Eac h database instanc e c o ntains a series o f o bjec ts kno wn as table space s, whic h ho ld the data fo r yo ur database. Eac h tablespac e c o ntains o ne o r mo re physic al files that are used to ho ld a c o llec tio n o f tables and indexes. One tablespac e is reserved fo r system info rmatio n, while o ther tablespac es are used to ho ld applic a-tio n data.
A table ( o r table partitio n if yo u partitio n the tables) c an’t span mo re than o ne tablespac e. This means that there must be suffic ient spac e in the tablespac e fo r all o f the tables in the tablespac e. If yo u run o ut o f disk spac e, yo u c an either inc rease the spac e available in the existing physic al files o r add additio nal physic al files to the tablespac e.
Tables
By no w, yo u are familiar with tables, so I wo n’t go into all o f the details abo ut ro ws and c o lumns, but there are a few unique aspec ts to Orac le’s implementatio n. Eac h ro w in the database has a unique value kno wn as a ro wid. This value is used to lo c ate the ro w in the database.
Tables that are o ften ac c essed to gether c an be gro uped to gether to share the same physic al sto rage. This pro c ess physic ally plac es the ro ws c lo se to gether fo r tables that are jo ined to gether using Se le ctstatements. This arrangement c an make a big differenc e in perfo rmanc e, bec ause when the data to be jo ined is in c lo se pro ximity, fewer I/ Os are required. This tec hnique is kno wn as cluste ring.
Schemas
The sche marepresents a view o f the info rmatio n in yo ur database. It represents a set o f tables and o ther database o bjec ts that c an be ac c essed by a user. As suc h, a sc hema represents a go o d way to sec ure database o bjec ts. Only the database administrato r is permitted to see the database o bjec ts in every sc hema in the database.
Sequences
A se que nce is an o bjec t that generates numbers ac c o rding to a spec ified o rder. This allo ws yo u to generate unique values fo r things like c o unters and timestamps to guarantee that eac h ro w added to a table has a unique value.
Stored Procedures, functions, and packages
Rec all that sto re d pro ce dure sare pre-c o mpiled pro grams written in PL/ SQL that are c o mpiled and saved in the database server fo r quic k exec utio n. Yo u have yo ur c ho ic e o f writing pro c edures that do n’t return a value o r functio nsthat return a sin-gle value. Sto red pro c edures c an also return a rec o rdset c o ntaining a c o llec tio n o f ro ws selec ted fro m a table o r a view.
See Chapter 25, “Stored Procedures,” for a detailed discussion of stored procedures.
A package is a way to gro up similar pro c edures, func tio ns, and variab les into a single Orac le8io b jec t. This has two primary advantages: first, that b ec ause all o f the o b jec ts are c o mpiled into a single entity, c alls b etween func tio ns and pro c e-dures are faster, sinc e there is no need to searc h fo r and lo ad external ro utines; and sec o nd, that managing o ne pac kage is easier than managing eac h o f the indi-vidual ro utines.
Triggers
Trigge rsare o ne way yo u c an enfo rc e referential integrity. Eac h time yo u exec ute a
De le te, Inse rt, o r Updatestatement, a sto red pro c edure will be c alled that c an c hec k the c hanges to ensure that they are being made pro perly. Fo r instanc e, assume that yo u have two tables with a o ne-to -many relatio nship. Yo u c an c reate a trigger that will delete all o f the asso c iated ro ws in o ne table when yo u delete a rec o rd in the o ther table.
In the key of SQL: You can also use foreign keys to enforce referential integrity.
Synonyms
Syno nymsare basic ally just ano ther name fo r a database o bjec t. Suppo se yo u want to c hange the name o f a table, but yo u’re no t c ertain that yo u’ve updated all o f the applic atio ns that use the o ld name. Yo u c an c reate a syno nym fo r the table using the o ld table’s name.
M emory architecture
One o f the keys to Orac le’s perfo rmanc e is its memo ry arc hitec ture. The key to database perfo rmanc e is being able to avo id disk I/ O by pro per buffering o f info r-matio n in memo ry.
A gig here and a gig there makes for good performance:One thing I can’t stress enough is that you need lots of m em ory to run a database server. A perfect rela-tional database w ould have enough m em ory to hold everything it stores on disk. In m ost cases, this isn’t possible because you have too m uch data on disk —but it’s nice to dream .
System Global Area
Eac h instanc e o f an Orac le database has a blo c k o f memo ry c alled the System Glo bal Area (SGA), whic h is used to ho ld shared reso urc es. All users have ac c ess to this area. It is used fo r maintaining vario us types o f buffers, inc luding the library c ac he where the SQL c urso rs are maintained, and the data dic tio nary c ac he, where the struc tures that desc ribe the o bjec ts in the database are kept. This info rmatio n is extrac ted fro m system tables, inc luding:
✦USER_OBJECTS— c o ntains info rmatio n abo ut the vario us o bjec ts in the database, plus a referenc e to o ther tables that c o ntain mo re detailed info rma-tio n abo ut a spec ific type o f o bjec t.
✦USER_TABLES— c o ntains the definitio ns o f the tables in the database. ✦USER_TAB_COLUMNS— c o ntains the definitio ns fo r the c o lumns in the table. ✦USER_SOURCE— c o ntains the so urc e c o de fo r sto red pro c edures.
✦USER_SEQUENCES— c o ntains the definitio ns o f the sequenc es in yo ur database.
✦USER_INDEXES— c o ntains info rmatio n abo ut the indexes asso c iated with eac h table.
Program Global Area
The Pro gram Glo bal Area (PGA) maintains info rmatio n o n the ac tive pro c esses run-ning in the database. These pro c esses either perfo rm wo rk o n behalf o f a c lient appli-c atio n o r perfo rm baappli-c kgro und pro appli-c essing and mo nito ring o f the database server. Fo r instanc e, when a c lient applic atio n requests a rec o rdset, a server pro c ess will retrieve the nec essary ro ws (ho pefully fro m the SGA, o therwise fro m disk) and return them to the c lient. A bac kgro und pro c ess, o n the o ther hand, might c o llec t perfo rmanc e statis-tic s, whic h c an be analyzed to determine bo ttlenec ks.
Network architecture
While SQL Server is managed thro ugh a single server pro c ess, Orac le8irelies o n a number o f different server applic atio ns. Eac h database instanc e has its o wn server pro c ess, while there is ano ther server applic atio n devo ted to netwo rking. The net-wo rking pro c ess uses a piec e o f so ftware kno wn as Net8 (desc ribed earlier in this c hapter). Net8’s func tio n is to rec eive requests fro m c lient applic atio ns and pass them o n to the appro priate database server fo r pro c essing. It is also respo nsible fo r handling c o mmunic atio ns between the vario us database instanc es and fo r fac ilitating c o mmunic atio ns between vario us database instanc es o n different c o mputer systems.
Oracle8
i
data types
Orac le8isuppo rts a wide variety o f data types, as sho wn in Table 26-1.
Table 26-1
Oracle8
i
Data Types
Oracle8i Data Type Visual Basic Data Type Comments
Bfile Byte Array Contains a binary large object up to 4 gigabytes in length.
Blob Byte Array Contains a binary large object that can be up to 4 gigabytes in length.
Char String Since Charfields alw ays have a fixed length, the length of the
Stringvalue w ill be the sam e as the length of the field. A Charfield m ay contain up to 2,000 characters.
Clob String A character-oriented large object up to 4 gigabytes in length.
Date Date A date and tim e value that is m ore
accurate than the Datedata type. The value w ill be rounded as needed.
Decimal Currency Contains a packed decim al num ber w ith up to 38 digits of precision.
Float Single, Double Uses the sam e storage form at as
Oracle8i Data Type Visual Basic Data Type Comments
Long String A character string w hose m axim um length can be up to 2 gigabytes.
Long Raw Byte Array A binary string w hose m axim um length can be up to 2 gigabytes.
Nchar String Contains a fixed-length Unicode string w ith up to 2,000 characters.
Nclob String A character-oriented large object containing Unicode characters.
Number Currency Contains a packed decim al num ber w ith up to 38 digits of precision.
Nvarchar2 String Contains a variable length Unicode string w ith up to 4,000 characters.
Raw String A binary string up to 2,000 bytes long.
Rowid String The internal form at is autom atically converted to a Stringvalue.
Varchar2 String Contains a variable length String
w ith a m axim um length of 4,000 characters.
Connecting to Oracle8
i
Building an ADO c o nnec tio n string fo r an Orac le8idatabase invo lves spec ifying val-ues fo r the pro vider and the database, as sho wn belo w:
Provider=MSDAORA.1; Data source=vb6db.Athena.justpc.net
Yo u c an also inc lude the User ID=and Password=keywo rds if yo u want to add that info rmatio n as part o f the c o nnec tio n string, o r yo u c an supply them as argu-ments to the Openmetho d.
Figure 26-4: Choosing the Oracle provider.
Figure 26-5: Specifying values for the key connection properties.
There’s always a choice: Oracle also has a provider for OLE DB that you m ay w ish to try, and there are third party OLE DB providers that m ay outperform both Microsoft’s and Oracle’s, though at a considerable cost in tim e and m oney.
A provider is only provider:The Oracle provider supplied by Microsoft only trans-lates the calls from your Visual Basic program into som ething that the Oracle8iclient softw are on your com puter w ill understand. You m ust install a copy of Net8 on your client com puter for any program to com m unicate w ith an Oracle8idatabase. Note
Oracle8
i
Security
In o rder to ac c ess an Orac le8idatab ase, yo u must b e pro perly authentic ated and autho rized. Authentic atio n ensures that the user name and passwo rd asso c iated with an individual is valid b efo re ac c ess is granted to the datab ase server. Onc e the users have b een granted ac c ess to the server, everything that the users c an perfo rm is b ased o n the permissio ns they have b een autho rized.
Authentication
In o rder to ac c ess an Orac le database, every user must have a valid user ID and a valid passwo rd. This info rmatio n is usually kept in the database, tho ugh Orac le do es inc lude ho o ks to use an external direc to ry, suc h as the Windo ws 2000 Ac tive Direc to ry o r Kerbero s.
Authorization
Inside Orac le8, yo u must b e granted the privilege to ac c ess a partic ular datab ase o b jec t o r c o mmand. In fac t, witho ut the pro per privileges, yo u c an’t even c o nnec t to the datab ase, even if yo u had a valid user ID and passwo rd. Privileges are man-aged using the Grantand Re vo ke SQL statements, o r b y using the Enterprise Manager utility’s GUI interfac e. The two types o f privileges, o b jec t privileges and system privileges, are disc ussed next.Ob jec t privileges dic tate the user’s ac c ess to a spec ific datab ase o b jec t, while system privileges determine the user’s ab ility to exec ute spec ific Orac le and SQL statements.
Object privileges
Obje ct privile ge sspec ify whic h c o mmands c an be used against spec ific database o bjec ts. Depending o n the o bjec t, yo u apply the privileges sho wn in Table 26-3. The syntax fo r the Grantstatement to apply o bjec t privileges lo o ks like this:
Grant <privileges> On <object> To <users> [With Grant Option]
where <privileges>c o ntains a list o f o ne o r mo re privileges separated by c o m-mas selec ted fro m Table 26-2; <object>spec ifies the database o bjec t that the privileges are asso c iated with;and <users>is a list o f o ne o r mo re user names separated by c o mmas that will rec eive the privileges o r the keywo rd Publicindic at-ing that any database user may have the privilege. The With Grant Optionc lause allo ws the user rec eiving the privilege to pass it alo ng to o ther users by using the
With Grant Option security can really be compromised: Because you passed on the ability to control security to another user, they can pass it on to others. Thus, people that you m ay not w ant to have access to the object m ay get access from som eone else. While using the With Grant Option is necessary to im plem ent a distributed security m anagem ent system , you m ust use it w ith care to ensure that only authorized users can access your database.
Table 26-2
Object Privileges
Statement Associated Privileges
Alter Tables, Sequences, Snapshots
Delete Tables, View s
Execute Procedures, Functions, Packages, Libraries, Types
Index Tables
Insert Tables, View s
Read Directories
References Tables
Select Tables, View s, Sequences, Snapshots
Update Tables, View s, Snapshots
Fo r example, if yo u wanted to allo w Jill to retrieve and update info rmatio n in the Custo mers table, but no t insert o r delete ro ws, yo u wo uld use this Grantstatement:
Grant Select, Update On Customers To Jill
System privileges
Syste m privile ge sc o ntro l the ability to exec ute spec ific Orac le and SQL statements. Like o bjec t privileges, system privileges are based o n the c o nc ept o f allo wing a user to use a spec ific c o mmand. Unlike o bjec t privileges, system privileges allo w yo u to use that c o mmand o n any o bjec t o r against the database itself ( see Table 26-4) . No te that so me o f the privileges desc ribe general c apabilities within the database server, and no t just the ac tual c o mmands used to perfo rm a task. These are also listed in Table 26-4.
Grant <privileges> To <user> [With Admin Option]
where <privileges>is a list o f o ne o r mo re system privileges, separated by c o m-mas, c ho sen fro m Table 26-3, and<user>is a list o f o ne o r mo re user names sepa-rated by c o mmas.
The With Admin Optionc lause allo ws the user to pass the privilege to ano ther user.
Table 26-3
System Privileges
Command Associated Privileges
Alter Any Cluster, Any Index, Any Procedure, Any Role, Any Sequence, Any Shapshot, Any Table, Any Trigger, Any Type, Database, Profile, Resource Cost, Rollback Segm ent, Session, System , Tablespace, User
Analyze Any
Audit Any, System
Backup Any Table
Becom e User
Com m ent Any Table
Create Any Cluster, Any Directory, Any Index, Any Library, Any Procedure, Any Sequence, Any Snapshot, Any Synonym , Any Table, Any Trigger, Any Type, Any View, Cluster, Database Link, Directory, Library, Procedure, Profile, Public Database Link, Public Synonym , Role, Rollback Segm ent, Session, Sequence, Snapshot, Synonym , Table, Tablespace, Trigger, Type, User, View
Delete Any Table
Drop Any Cluster, Any Directory, Any Index, Any Library, Any Procedure, Any Role, Any Sequence, Any Snapshot, Any Synonym , Any Table, Any Trigger, Any Type, Any View, Library, Profile, Public Database Link, Public Synonym , Rollback Segm ent, Tablespace, User
Execute Any Procedure, Any Type
Force Any Transaction, Transaction
Grant Any Privilege, Any Role
Insert Any Table
Lock Any Table
Select Any Sequence, Any Table
Update Any Table
Roles
Managing permissio ns fo r individual users c an be o verwhelming o n a database sys-tem with a large number o f users. Thus, Orac le8ialso uses the c o nc ept o f ro les to simplify database administratio n. A ro lerepresents a c o llec tio n o f privileges that c an be assigned to a user. If yo u assign a ro le to a user, the user inherits all o f the privileges in the ro le. Likewise, if yo u add a privilege to an existing ro le, all o f the users that are assigned that ro le will auto matic ally rec eive the new privilege.
When granting privileges to a ro le, yo u use the same Grantstatement that yo u wo uld use fo r an o bjec t privilege. Yo u simply spec ify the name o f the ro le in plac e o f the user. Fo r instanc e, yo u wo uld use the fo llo wing statement to grant the Se le ct
privilege to the Clerks ro le:
Grant Select To Clerks
When granting a ro le to a user, yo u use the fo rm o f the Grantstatement used to asso c iate system privileges to a user. In this c ase, the ro le is substituted fo r a sys-tem privilege. The fo llo wing stasys-tement sho ws ho w to grant the Clerks ro le to the user Samantha. When exec uted after the previo us Grantstatement, Samantha will be able to use the Se le ctstatement.
Grant Clerks To Samantha
Thoughts on Oracle8
i
Oracle8i is a high-perform ance database that runs on m any different hardw are and soft-w are platform s. It is also m ore difficult to install and m aintain than SQL Server. If you need the biggest, fastest database m anagem ent system in existence today, Oracle8ishould be at the top of your list, since it runs on the biggest com puter system s available. Com panies like Am azon.com and eBay rely on Oracle database servers.
How ever, this pow er com es at a cost. You really need an experienced Oracle DBA to m ain-tain your database. Unlike SQL Server, w hich conain-tains a large num ber of w izards to perform routine tasks, Oracle8idoesn’t. If you’re not very fam iliar w ith Oracle databases in general, you need som eone to help you set up the various processes and ensure that they w ork properly.
Summary
In this c hapter yo u learned:
✦abo ut the Orac le8idatabase server and the vario us editio ns that are available. ✦abo ut the majo r utilities and key c o mpo nents.
✦abo ut the Orac le8idatabase arc hitec ture.
✦abo ut the data types available in Orac le8iand ho w they map into Visual Basic data types.
✦ho w to c o nnec t to an Orac le8idatabase with ADO.
✦abo ut Orac le8isec urity.
✦
✦
✦
I som etim es look at this issue from a m ainfram er’s perspective. In the m ainfram e w orld, operating system softw are, including database m anagem ent system s, are very com plex products that are highly adjustable. You can’t sim ply install a package and begin using it. It usually takes anyw here from a few days to a few m onths to install a piece of softw are. Som e of this tim e is spent selecting options and setting various param eters in order to m ake the softw are w ork, w hile the rest of the tim e is spent ensuring that you have the right options set.