OPS-6: Beginners Guide to OpenEdge ® SQL via ODBC or JDBC Brian Werne Sr. Engineering Manager OpenEdge SQL and OpenEdge Management.

Slides:



Advertisements
Similar presentations
B6: Beginners Guide to OpenEdge® SQL via ODBC or JDBC
Advertisements

Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
WaveMaker Visual AJAX Studio 4.0 Training
Getting Started With Progress SQL-92
System Administration Accounts privileges, users and roles
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
© 2012 Progress Software Corporation. All rights reserved. 1 Click to edit Master title style Remove Performance Bottlenecks in Your SQL Connections -
Phil Brewster  One of the first steps – identify the proper data types  Decide how data (in columns) should be stored and used.
DB-14: OpenEdge® Database Run-time Security Revealed
Database Application Security Models
OPS-17: Utilizing Firewalls - In the Reign of Fire
DB-04 Tuning OpenEdge™ SQL: Boosting Your SQL Application Performance
DB-19: OpenEdge® Authentication Without the _User Table
CSCI 6962: Server-side Design and Programming
Session 5: Working with MySQL iNET Academy Open Source Web Development.
DONE-10: Adminserver Survival Tips Brian Bowman Product Manager, Data Management Group.
Multiplicity – Progress Data Replication Methodologies.
CSCI 6962: Server-side Design and Programming JDBC Database Programming.
Advanced Database Management System Lab no. 11. SQL Commands (for MySQL) –Update –Replace –Delete.
Chapter 7 PHP Interacts with Ms. Access (Open DataBase Connectivity (ODBC))
PHP Programming with MySQL Slide 8-1 CHAPTER 8 Working with Databases and MySQL.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Copyright ®xSpring Pte Ltd, All rights reserved Versions DateVersionDescriptionAuthor May First version. Modified from Enterprise edition.NBL.
By Lecturer / Aisha Dawood 1.  Administering Users  Create and manage database user accounts.  Create and manage roles.  Grant and revoke privileges.
5.1 © 2004 Pearson Education, Inc. Lesson 5: Administering User Accounts Exam Microsoft® Windows® 2000 Directory Services Infrastructure Goals 
Configuring Identity Manager 2 (formerly DirXML ® ) for JDBC (w/DirXML) Jason Elsberry Software Engineer
9 Copyright © 2005, Oracle. All rights reserved. Administering User Security.
Frank Hilhorst President Progressive Consulting Inc. Open Source Data Sharing.
Chapter 7 Working with Databases and MySQL PHP Programming with MySQL 2 nd Edition.
SEC835 Practical aspects of security implementation Part 1.
DEV-5: Introduction to WebSpeed ® Stephen Ferguson Sr. Training Program Manager.
ITN Wake Tech1 ITN270 Advanced Internet Databases Lecture 15. General MySQL Administration Topics: –Securing a New MySQL Installation –MySQL Server.
MISSION CRITICAL COMPUTING Moving Data and Other Planning Considerations.
DB-10: Advice and Techniques for Oracle DataServer A ‘Words from the Wise’ production Simon Epps Product Manager.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
DEV-09: User Authentication in an OpenEdge™ 10.1 Distributed Computing Environment Michael Jacobs Development Architect.
Copyright © 2013 Curt Hill Database Security An Overview with some SQL.
DB-1: OpenEdge ® SQL in a 10.1B multi- database environment for ODBC and JDBC Brian Werne Sr. Engineering Manager, OpenEdge SQL and OpenEdge Management.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 DB2 9 Fundamentals.
OPS-15: What was Happening with My Database, AppServer ™, OS... Yesterday, Last Month, Last Year? Libor LaubacherRuanne Cluer Principal Tech Support Engineer.
1 EM413 Using Adaptive Server Anywhere’s Remote Data Access Feature Mark Culp Software Development Manager iAnywhere Solutions
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
A Brief Documentation.  Provides basic information about connection, server, and client.
Roles & privileges privilege A user privilege is a right to execute a particular type of SQL statement, or a right to access another user's object. The.
Dale Roberts 1 Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Chapter 5 : Integrity And Security  Domain Constraints  Referential Integrity  Security  Triggers  Authorization  Authorization in SQL  Views 
WEB SERVER SOFTWARE FEATURE SETS
Chapter 13Introduction to Oracle9i: SQL1 Chapter 13 User Creation and Management.
SQL Server 2005 Implementation and Maintenance Chapter 6: Security and SQL Server 2005.
Oracle 11g: SQL Chapter 7 User Creation and Management.
13 Copyright © Oracle Corporation, All rights reserved. Controlling User Access.
Introduction to Teradata Client Tools. 2 Introduction to Teradata SQL  OBJECTIVES :  Teradata Product Components.  Accessing Teradata – Database /
Oracle Business Intelligence Foundation – Testing and Deploying OBI Repository.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
9 Copyright © 2004, Oracle. All rights reserved. Getting Started with Oracle Migration Workbench.
1 Copyright © 2005, Oracle. All rights reserved. Oracle Database Administration: Overview.
11 Copyright © 2009, Oracle. All rights reserved. Enhancing ETL Performance.
19 Copyright © 2008, Oracle. All rights reserved. Security.
Controlling User Access
Module 1: SQL Server Overview
Controlling User Access
Running a Forms Developer Application
TABLES AND INDEXES Ashima Wadhwa.
SQL Best Practices Chandra Sekhar
27/06/2016 Chandra Sekhar Mohd Sayeed Akthar
Real-Time Data Replication From Your Progress DB (Pro2 Enterprise)
DATABASE MANAGEMENT SYSTEM
Chapter 8 Working with Databases and MySQL
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Managing Privileges.
Presentation transcript:

OPS-6: Beginners Guide to OpenEdge ® SQL via ODBC or JDBC Brian Werne Sr. Engineering Manager OpenEdge SQL and OpenEdge Management

© 2008 Progress Software Corporation2 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Agenda:  OpenEdge SQL component overview and your initial connection  Setup and maintenance of the OpenEdge database for control and performance  Specifics of the OpenEdge with the SQL based tools and applications Goal: Make you successful with SQL applications!

© 2008 Progress Software Corporation3 OpenEdge is Open SSL HTTP HTTP/S HTML.NET Java HTML Open Clients (Non-OpenEdge) OpenEdge ABL Clients ODBC Clients Service Interfaces OpenEdge RDBMS OpenEdge DataServers OpenEdge ABL Server OpenEdge SQL Server JDBC Clients Oracle ® MSSQL ODBC ABL: Open Clients: Java ™.NET ™ Web services (ABL works with relational DBs) OpenEdge SQL Crystal Reports WebSphere ® JBOSS / JRun Java / JDBC apps J2EE ™ / JTA.NET / ODBC apps ADO.NET / VB Data is fully interoperable: ABL & SQL (works with OpenEdge RDBMS)

© 2008 Progress Software Corporation4 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Getting Connected – Client side: ODBC and JDBC drivers

© 2008 Progress Software Corporation5 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC  CLASSPATH ( run ‘sql_env’)  Class loader  URL JDBC driver Type 4 JDBC driver (10.1a+) com.ddtek.jdbc.openedge.OpenEdgeDriver jdbc:datadirect:openedge://localhost:6748;databaseName=db1 $DLC/java: openedge.jar, util.jar, base.jar

© 2008 Progress Software Corporation6 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC ODBC DSN – single connection

© 2008 Progress Software Corporation7 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC ODBC DSN Advanced Tab

© 2008 Progress Software Corporation8 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Isolation Level Affect on Lock Type Isolation Level UpdateFetch Table Lock Record Lock Table Lock Record Lock Read Uncommitted --- NoLock Read Committed IXExclusiveISShare Repeatable Read IXExclusiveISShare Serializable SIXExclusiveShareNone

© 2008 Progress Software Corporation9 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC ODBC : Multi-DataBase configuration

© 2008 Progress Software Corporation10 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Connection – server side

© 2008 Progress Software Corporation11 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Default server settings SQL Servers SQL & ABL Broker SQL client ABL client Shared Memory Database ABL Servers ABL client SQL client

© 2008 Progress Software Corporation12 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC “Recommended” server setup SQL Servers SQL client ABL client ABL only Broker SQL only Broker SQL client ABL client Shared Memory Database ABL Servers

© 2008 Progress Software Corporation13 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Recommended parameters example  Example: Start a ABL Primary broker  Example: Start a Secondary SQL broker Separating ABL and SQL brokers/servers … examples proserve Sports2000 -S H localhost -n 45 -Mn 8 -Mpb 4 -ServerType 4GL -Mi 1 -Ma 5 -minport maxport 6300 proserve Sports2000 -S H localhost -m3 –Mpb 3 -ServerType SQL –Mi 5 –Ma 5 -minport maxport 5300

© 2008 Progress Software Corporation14 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Security Who am I? Authentication Authorization What am I allowed to do?

© 2008 Progress Software Corporation15 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Security Considerations Database authentication SQL –Always requires a user ID and password to establish a connection ABL –Does not specifically require a user ID and password to establish a connection ID and passwords

© 2008 Progress Software Corporation16 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC SQL Authentication (Who am I?)  Case 1: Users have not been created (no rows in _User table) Password validation is not enabled No check is performed at connection time No error message at connection time ID and passwords scenarios

© 2008 Progress Software Corporation17 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC SQL Authentication (Who am I?)  Case 2: Users exist in the OpenEdge RDBMS (rows exist in _User table) Password Validation is enabled Check is performed at connection time Valid users defined by a DBA Error message if login is incorrect / invalid: –“Access Denied (8933)” ID and passwords scenarios…cont’d

© 2008 Progress Software Corporation18 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Comparing ABL & SQL Security Systems ABLSQL Security modelGRANT Default DBAn/a SYSPROGRESS Default security administrator “*”n/a Default table access“*” Default field access“*”

© 2008 Progress Software Corporation19 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Encountering errors  Possible reason for this: No authorization privileges Schema scope Access denied (Authorization failed) (7512)

© 2008 Progress Software Corporation20 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Authorization – What can I do?  SQL follows GRANT security model By default, a connected userid is not allowed to do anything. Exceptions: - the DBA account (full operations) - the TABLE owner  DBA controls operation privileges with GRANT / REVOKE syntax

© 2008 Progress Software Corporation21 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Authorization – What can I do?  Database wide (system admin or general creation)  For specified Tables or Views –Where ‘privilege’ is: { SELECT | INSERT | DELETE | INDEX | UPDATE [ ( column, column,... ) ] | REFERENCES [ ( column, column,... ) ] } Privileges – Syntax: GRANT (2 types) GRANT { DBA, RESOURCE } TO user_name [, user_name ], …; GRANT { privilege [, privilege ], … | ALL } ON table_name TO { user_name [, user_name ], … | PUBLIC } [ WITH GRANT OPTION ];

© 2008 Progress Software Corporation22 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Encountering errors  Possible reasons for this: Not authorized Schema scope Table/View/Synonym not found (7519)

© 2008 Progress Software Corporation23 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC What is a Schema? PUB schema PUB Customer table Inventory bwerne Mysports database AuxCat Database

© 2008 Progress Software Corporation24 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC  What is a default Schema? A user has by default a schema attached to their ID SET SCHEMA { 'string_literal'}  OpenEdge ABL uses one schema – ‘PUB’  Another option: Synonyms: Schemas CREATE PUBLIC SYNONYM customer FOR pub.customer; SET SCHEMA ‘pub’

© 2008 Progress Software Corporation25 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC  Solutions: or Schema example SELECT count(*) FROM pub.customer; SET SCHEMA ‘pub’; SELECT count(*) FROM customer; Table/View/Synonym not found (7519) SELECT count(*) FROM customer;

© 2008 Progress Software Corporation26 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC  Four level naming convention  Example  ABL has 3 level naming convention 4 Part Naming – Multi-Database Query Fully Qualified Names catalog.schema.table.column-name SELECT Pub.Customer.CustNum, SportsPrimary.Pub.Customer.Name, SportsAux1.Pub.Order.OrderNum … catalog.table.column-name

© 2008 Progress Software Corporation27 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC OpenEdge Specifics SQL is a standard, but each vendor has it’s own dialect

© 2008 Progress Software Corporation28 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC OpenEdge Specifics - Quoting  Hyphenated names:  Solution: quoting Non-SQLStandard names SELECT cust-num FROM PUB.Customer; SELECT “cust-num” FROM PUB.Customer; Column CUST cannot be found (13865)

© 2008 Progress Software Corporation29 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Overstuffed fields - error  ABL allows more data than column definition Column abc in table PUB.Ranking has value exceeding it’s max length. SELECT abc from PUB.Ranking;

© 2008 Progress Software Corporation30 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC OpenEdge Specifics - Overstuffed fields Strategies for managing:  Dbtool : percentage option ($DLC/bin/dbtool) 1. SQL Width & Date Scan w/Report Option 2. SQL Width Scan w/Fix Option Choice: 2 : (0=single-user 1=self- service >1=#threads)? 3 Padding % above current max: 25 : (Table number or all)? all : (Area number or all)? all

© 2008 Progress Software Corporation31 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC OpenEdge Specifics - Overstuffed fields Strategies for managing  ABL client startup parameter -checkwidth.exe –checkwidth n where "n" can be one of the following: 0 — Ignore _width value. Default. 1 — Store the data and generate a warning. 2 — Do not store data and generate an error.

© 2008 Progress Software Corporation32 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC OpenEdge Specifics – Arrays / Extents  Selecting array columns as a whole Result: semi-colon separated varchar value ; ; ;  Selecting array column individually – SQL99 Result: numeric value SELECT quarterlySales from PUB.MySales; SELECT quarterlySales[1] from PUB.MySales;

© 2008 Progress Software Corporation33 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC OpenEdge Specifics – Arrays / Extents Strategies:  Using views to break out array elements Result: numeric values CREATE VIEW PUB.QuarterSales AS SELECT quarterlySales[1], quarterlySales[2], quarterlySales[3], quarterlySales[4] FROM PUB.MySales; SELECT * FROM PUB.QuarterSales;

© 2008 Progress Software Corporation34 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC  Q: What’s it gonna cost to run my query? Query Performance TIME =

© 2008 Progress Software Corporation35 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC What is the cost? Database without statistics Customers Orders SalesHist Distributors Parts Suppliers OrderLines Employees ABC Corp DB

© 2008 Progress Software Corporation36 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Basic Performance - What is the cost? Database with Update Statistics Customers Orders SalesHist Distributors Parts Suppliers OrderLines Employees ABC Corp DB

© 2008 Progress Software Corporation37 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC  All Statistics: Table Cardinality, indexes and all columns  Statistics - particular table Query Performance: Update Statistics UPDATE TABLE STATISTICS AND INDEX STATISTICS AND [ALL] COLUMN STATISTICS; UPDATE STATISTICS syntax UPDATE TABLE STATISTICS AND INDEX STATISTICS AND [ALL] COLUMN STATISTICS FOR pub.customer;

© 2008 Progress Software Corporation38 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Query trees : Defined  relational algebraic tree representation (query tree / execution tree ) Result set Database access Data

© 2008 Progress Software Corporation39 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Basic Performance – Query Plans  Query Plans Located in VST _SQL_QPLAN SELECT SUBSTRING("_Description",1,80) FROM pub."_Sql_Qplan“ WHERE "_Pnumber" = (SELECT MAX( "_Pnumber" ) FROM pub."_Sql_Qplan" WHERE "_Ptype" > 0 ); Viewing query plan constructed by cost-based optimizer

© 2008 Progress Software Corporation40 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC  Simple single table select “select … from pub.customer where custnum between 1000 and 1100 [NoExecute]” Query plan – what to look for SELECT COMMAND. PROJECT [66] ( | PROJECT [64] ( | | PUB.CUSTOMER. [0]( | | | INDEX SCAN OF ( | | | | CustNum, | | | | | (PUB.CUSTOMER.CustNum) between (1000,1100)) table index index keys, predicates

© 2008 Progress Software Corporation41 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC In Summary  Initial SQL connection  Setup and maintenance in OpenEdge database for security and performance  Specifics of OpenEdge with SQL applications

© 2008 Progress Software Corporation42 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC For More Information, go to…  PSDN Developing Performance-Oriented ODBC/JDBC OpenEdge Applications OpenEdge SQL: Authorization Explained OpenEdge SQL in a 10.1B Multi-Database Environment OpenEdge ® Database Run-time Security Revealed  OpenEdge Technical Support - KBases Basic Guide to Defining Progress SQL Database Permissions & Security  Progress eLearning Community Using OpenEdge SQL  Documentation 10.1C OpenEdge Data Management: SQL Development 10.1C OpenEdge Data Management: SQL Reference

© 2008 Progress Software Corporation43 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Relevant Exchange Sessions  OPS-27: Understanding Record and Table Locking In OpenEdge SQL  OPS-10: Moving V8/V9 RDBMS to OpenEdge 10  OPS-15: What was Happening with My Database, AppServer, Operating System  OPS-18: Data Management and Platforms Roadmap  OPS-24: Success with OpenEdge Replication

© 2008 Progress Software Corporation44 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Questions ?

© 2008 Progress Software Corporation45 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC Thank You

© 2008 Progress Software Corporation46 OPS-6: Beginners Guide to OpenEdge SQL via ODBC or JDBC