Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Entity–attribute–value model wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Functional Database Model wikipedia , lookup
Microsoft Access wikipedia , lookup
Concurrency control wikipedia , lookup
Oracle Database wikipedia , lookup
Microsoft SQL Server wikipedia , lookup
Relational model wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Database model wikipedia , lookup
Issues of Data Access • 101(-ish) ways to access data from a database! •ODBC • One method in more detail: OLE DB and ADO • In favour of Stored Procedures? • A look at Java Stored Procedures School of Computing and Management Sciences © Sheffield Hallam University JDO Java General data aware apps eg: Apps and applets VB Delphi etc JDBC RDBMS specific apps eg: Embe dded SQL Forms Native JDBC - ODBC Bridge OLE DB OO4O ODBC Client Side D r i v e r s Proprietary database access protocols Other data stores Other ODBC Specific RDBSM eg ORACLE compliant RDBMS SQL Databases Server Side It works both ways • You can access non-Oracle databases using Oracle client tools, such as Forms: – Heterogeneous Services (HS) include: • Generic Connectivity (using Industry standards) • Transparent Gateways (using proprietary calls) • From a non-Oracle IDE you can make native calls, provided you have Oracle client binaries installed. • And any mix in between….! School of Computing and Management Sciences © Sheffield Hallam University Why such heterogeneousness? • • • • • • Departmental decision making Cheapest at the time Familiarity Organisational mergers relative “importance” of sites Personal Computing School of Computing and Management Sciences © Sheffield Hallam University ODBC • Recognised the need to get Front Ends talking to different Back Ends • Resulted form work done by SAG and X/Open • Version 1, from Microsoft, 1992 • It is be database and language neutral, and amongst other things it: – – – – – Makes and manages database connections Allocates/deallocates handles executes ISO SQL retrieves results Accesses schema metadata School of Computing and Management Sciences © Sheffield Hallam University ODBC • It does merely expose a database’s functionality, and cant enhance it • It does not allow for cross-platform functionality • Version 1 and 2 suffered from a poor performance reputation. • This could be more to do with the RAD environment that ODBC was often used with. – See Ken North: odbcperf.html School of Computing and Management Sciences © Sheffield Hallam University Using OLE DB • • • • • • Real world information systems are increasingly made up from a series of different technologies. Organisations may have both Mainframes and clientserver systems each with different databases and applications on them. There is often a need for the PC desktop to be the presenter of information. OLE DB responds to this scenario by setting out a specification for a set of low-level data access interfaces to work against many types of data store in a standard way. Use of an Oracle provider is preferred because it is a native OLE DB provider and gives access to Oracle-specific database features, such as support for LOBs, PL/SQL stored procedures, and REF CURSORs. Whilst Client needs to be 8i or higher, you can use OLE DB to access data from Oracle databases of version 7.3.4 or higher. Only one version of OraOLEDB can exist on a machine at a time, and, because it is COM-based, OLE DB is unable to cope with multiple Oracle homes. School of Computing and Management Sciences © Sheffield Hallam University Using ADO to hide OLE DB • • • Microsoft ActiveX® Data Objects (ADO) is a high-level object-oriented interface to OLE DB data which presents the applications programmer with a set of objects, including a database independent recordset. It is possible to call OLE DB methods directly, but the ADO encapsulation hides the low-level complexities The extra overhead of the extra layers of abstraction can be worth it if: – – – • • • An application which accesses different database platforms simultaneously An application which needs has the ability to be used with any customer-defined database back end In an environment where (expensive) C++ programmers with low-level database experience are hard to acquire, but where Delphi or VB skills are less hard to find Another benefit of using ADO is that you can assume that the database access layer is already in place if your clients are running MS Windows. ADO and OLE DB are supplied by Microsoft and installed with Windows. No need to worry about installing extras like the Borland Database Engine (BDE) on client machines together with your application. An ADO-based application requires that ADO 2.1 be installed on the client computer. School of Computing and Management Sciences © Sheffield Hallam University The ADO model NOTE: Blue indicate Delphi component names that use the ADO object School of Computing and Management Sciences © Sheffield Hallam University What is PL/SQL? • SQL is non-procedural – designed to be relatively approachable to nonprogrammers • PL/SQL is a procedural extension to SQL – many Oracle products are themselves written in pl/sql – but it IS proprietary School of Computing and Management Sciences © Sheffield Hallam University What can be done with PL/SQL? Standard DML commands SQL functions SQL transaction control creation and control of “cursors” flow control - IF, WHEN, LOOP…. Error Handling DDL School of Computing and Management Sciences © Sheffield Hallam University Where does PL/SQL live? • • • • • • Anonymous Block Application Procedure or Function Database Trigger Application Trigger Stored Procedure or Function Packages School of Computing and Management Sciences © Sheffield Hallam University Stored Procedures Major benefits are speed…. – no compilation is required at execution time. – Stored procedures are loaded once into the SGA – They remain there until they are paged out. – Subsequent executions of the stored procedure are much faster Code management… – Stored in the data dictionary. – Can be called by many users. – Improved coding productivity School of Computing and Management Sciences © Sheffield Hallam University Stored Procedures cont…. • And Security – eg: you can grant users access to a procedure that updates a table but not grant them access to the table itself However, DBAs need to be aware of the memory demands of stored procedures School of Computing and Management Sciences © Sheffield Hallam University Packages • Packages encapsulate related procedures, functions, and associated cursors and variables together as a unit in the database. • Only packages can be pinned. • Oracle provides a procedure dbms_shared_pool.keep to pin a package. • Packages can be unpinned with dbms_shared_pool.unkeep. School of Computing and Management Sciences © Sheffield Hallam University