Developer. 1 enterprise. Professional Guide. Oracle Advanced PL/SQL. example questions for 1Z0-146 examination

Similar documents
Implement a virtual private database with fine-grained access control. Write code to interface with external C and Java applications.

1Z Z0-146-Oracle Database 11g: Advanced PL/SQL Exam Summary Syllabus Questions

CO Oracle Database 12c: Advanced PL/SQL

Oracle 1Z Oracle Database 11g: Advanced PL/SQL.

Contents I Introduction 1 Introduction to PL/SQL iii

Oracle SQL Course Content

Oracle Database 12c: Program with PL/SQL Duration: 5 Days Method: Instructor-Led

Oracle PLSQL Training Syllabus

Oracle Database 11g: Program with PL/SQL Release 2

Vendor: Oracle. Exam Code: 1Z Exam Name: Oracle database 11g:advanced pl/sql. Version: Demo

Oracle Database: Program with PL/SQL

Oracle Database: Program with PL/SQL Ed 2

Conditionally control code flow (loops, control structures). Create stored procedures and functions.

Oracle Database 11g: Program with PL/SQL

Oracle. Exam Questions 1Z Oracle 11g: Advanced PL/SQL. Version:Demo. 1Z0-146 Exam Questions Demo

Oracle Database 10g: Advanced PL/SQL

Oracle Database 12c R2: Program with PL/SQL Ed 2 Duration: 5 Days

IZ0-144Oracle 11g PL/SQL Certification (OCA) training

Oracle Database: Program with PL/SQL

Oracle Database: Introduction to SQL/PLSQL Accelerated

Oracle 1z z0-146 Oracle Database 11g: Advanced PL/SQL. Practice Test. Version QQ:

Oracle - Oracle Database: Program with PL/SQL Ed 2

IT Certification Exams Provider! Weofferfreeupdateserviceforoneyear! h ps://

ORACLE TRAINING. ORACLE Training Course syllabus ORACLE SQL ORACLE PLSQL. Oracle SQL Training Syllabus

5. Single-row function

Oracle Database 11g: Advanced PL/SQL

Oracle Developer Track Course Contents. Mr. Sandeep M Shinde. Oracle Application Techno-Functional Consultant

Oracle PLSQL. Course Summary. Duration. Objectives

Introduction to SQL/PLSQL Accelerated Ed 2

ORACLE: PL/SQL Programming

Introduction to Computer Science and Business

1Z Oracle Database 11g - Program with PL/SQL Exam Summary Syllabus Questions

Oracle PL/SQL - 12c & 11g [Basic PL/SQL & Advanced PL/SQL]

Passguide.1z questions

SQL+PL/SQL. Introduction to SQL

PLSQL 9i Index. Section Title Page

Question: Which statement would you use to invoke a stored procedure in isql*plus?

"Charting the Course... Oracle 18c PL/SQL (5 Day) Course Summary

Oracle Database 11g: Advanced PL/SQL

EDUVITZ TECHNOLOGIES

ORACLE DATABASE 12C INTRODUCTION

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database 11g: SQL and PL/SQL Fundamentals

Oracle Database: SQL and PL/SQL Fundamentals Ed 2

Oracle. SQL(Structured Query Language) Introduction of DBMS. Build In Function. Introduction of RDBMS. Grouping the Result of a Query

Question Bank PL/SQL Fundamentals-I

COWLEY COLLEGE & Area Vocational Technical School

Pro ODP.NET for Oracle. Database 11 g. Edmund Zehoo. Apress

Braindumps.1z QA

A Unit of SequelGate Innovative Technologies Pvt. Ltd. All Training Sessions are Completely Practical & Real-time

Question: 1 Which two types of metadata can be retrieved by using the various procedures in the DBMS_METADATA PL/SQL package? (Choose two.

Oracle Database: SQL and PL/SQL Fundamentals

Table of Contents. Oracle SQL PL/SQL Training Courses

JPexam. 最新の IT 認定試験資料のプロバイダ IT 認証であなたのキャリアを進めます

When a database trigger routine does not have to take place before the triggering event, which timing should you assign to the trigger?

Oracle12c Release 1 PL/SQL (3 Days)

Using SQL Developer. Oracle University and Egabi Solutions use only

Oracle Database: Program with PL/SQL Ed 2 Erlernen Sie diese leistungsstarken Programmiersprache

Proje D2K. CMM (Capability Maturity Model) level Project Standard:- Corporate Trainer s Profile

C. Use the TO_CHAR function around SYSDATE, that is, 1_date := TO_CHAR (SYSDATE).

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle Database 10g: PL/SQL Fundamentals

Oracle 1Z0-148 Exam Questions and Answers (PDF) Oracle 1Z0-148 Exam Questions 1Z0-148 BrainDumps

Mastering phpmyadmiri 3.4 for

Performance and Tuning. 2010, Oracle and/or its affiliates. All rights reserved.

SEF DATABASE FOUNDATION ON ORACLE COURSE CURRICULUM

ORACLE DEV 11G CURRICULUM. Introduction to SQL

PART I Core Ideas and Elements of PL/SQL Performance Tuning

Oracle SQL & PL SQL Course

Oracle Database 11g: SQL Tuning Workshop

Oracle Database: Introduction to SQL

Appendix A Practices and Solutions

ORACLE TRAINING CURRICULUM. Relational Databases and Relational Database Management Systems

Oracle Database 11g: New Features for Oracle 9i DBAs

CHAPTER. Oracle Database 11g Architecture Options

Course Contents of ORACLE 9i

Vendor: Oracle. Exam Code: 1Z Exam Name: Oracle Database 11g: Program with PL/ SQL. Version: Demo

Oracle Syllabus Course code-r10605 SQL

Oracle Database: Introduction to SQL Ed 2

Oracle SQL Developer. Oracle TimesTen In-Memory Database Support User's Guide Release 4.0 E

Oracle PL/SQL. DUMmIES. by Michael Rosenblum and Dr. Paul Dorsey FOR

Projects. Corporate Trainer s Profile. CMM (Capability Maturity Model) level Project Standard:- TECHNOLOGIES

Topics Fundamentals of PL/SQL, Integration with PROIV SuperLayer and use within Glovia

MySQL for Developers Ed 3

JSPM s Bhivarabai Sawant Institute of Technology & Research, Wagholi, Pune Department of Information Technology

Course 40045A: Microsoft SQL Server for Oracle DBAs

Ryan Stephens. Ron Plew Arie D. Jones. Sams Teach Yourself FIFTH EDITION. 800 East 96th Street, Indianapolis, Indiana, 46240

I, J, K. Lightweight directory access protocol (LDAP), 162

Oracle Database: Introduction to SQL

Oracle Database 10g: PL/SQL Fundamentals

Introduction p. 1 The Logical and Physical View of Tables p. 1 Database Types p. 4 NULLs p. 6 DDL and DML Statements p. 7 Column and Table Constraint

"Charting the Course... Oracle 18c DBA I (3 Day) Course Summary

ADVANTAGES. Via PL/SQL, all sorts of calculations can be done quickly and efficiently without use of Oracle engine.

Oracle 12C DBA Online Training. Course Modules of Oracle 12C DBA Online Training: 1 Oracle Database 12c: Introduction to SQL:

COURSE CONTENT. ORACLE 10g/11g DBA. web: call: (+91) / 400,

to use this Student Guide

Using Java - for PL/SQL and Database Developers Student Guide

Introduction to Computer Science and Business

ORANET- Course Contents

Oracle Database 12c: New Features for Administrators (40 hrs.) Prerequisites: Oracle Database 11g: Administration Workshop l

Transcription:

Oracle Advanced PL/SQL Developer Professional Guide Master advanced PL/SQL concepts along with plenty of example questions for 1Z0-146 examination Saurabh K. Gupta [ 1 enterprise I professional expertise distilled 88 PUBLISHING - BIRMINGHAM MUMBAI

Preface 1 Chapter 1: Overview of PL/SQL Programming Concepts 9 PL/SQL the procedural aspect 10 My first PL/SQL program 11 PL/SQL development environments 13 SQL Developer 13 SQL Developer the history 15 Creating a connection 15 SQL Worksheet 16 Executing a SQL statement 18 Calling a SQL script from SQL Developer 19 Creating and executing an anonymous PL/SQL block 21 Debugging the PL/SQL code 21 Editing and saving the scripts 23 SQL*Plus 24 Executing a SQL statement in SQL*Plus 26 Executing an anonymous PL/SQL block 26 Procedures 27 Executing a procedure 28 Functions 29 Function execution methods 31 Restrictions on calling functions from SQL expressions 32 PL/SQL packages 33 Cursors an overview 35 Cursor execution cycle 35 Cursor attributes 36 Cursor FOR loop 38 Exception handling in PL/SQL 39 System-defined exceptions 39 User-defined exceptions 41

The RAISE_APPLICATION_ERROR procedure 43 Exception propagation 46 Managing database dependencies 48 Displaying the direct and indirect dependencies 49 Dependency metadata 50 Dependency issues and enhancements 50 Reviewing Oracle-supplied packages 51 Summary 52 Practice exercise 52 Chapter 2: Designing PL/SQL Code 55 Understanding cursor structures 55 Cursor execution cycle 56 Cursor design considerations 57 Cursor design guidelines 58 Cursor attributes 59 Implicit cursors 60 Explicit cursors 62 Cursor variables 66 Ref cursor types strong and weak 69 SYS_REFCURSOR 69 Processing a cursor variable 70 Cursor variables as arguments 71 Cursor variables restrictions 73 Subtypes 74 Subtype classification 75 Oracle's predefined subtypes 75 User-defined subtypes 76 Type compatibility with subtypes 77 Summary 78 Practice exercise 78 Chapter 3: Using Collections 81 Collections an overview 82 Categorization 83 Selecting an appropriate collection type 84 Associative arrays 84 Nested tables 88 Nested table collection type as the database object 90 DML operations on nested table columns 91 A nested table collection type in PL/SQL 93 Additional features of a nested table 94 Varray 98

Varray in PL/SQL 99 Varray as a database collection type 100 DML operations on varray type columns 100 Collections a comparative study 103 Common characteristics of collection types 103 Nested table versus associative arrays 104 Nested table versus varrays 105 PL/SQL collection methods 105 EXISTS 105 COUNT 106 LIMIT 107 FIRST and LAST 108 PRIOR and NEXT 109 EXTEND 109 TRIM 111 DELETE 112 Manipulating collection elements 113 Collection initialization 115 Summary 117 Practice exercise 117 Chapter 4: Using Advanced Interface Methods 121 Understanding external routines 122 Architecture of external routines 122 Oracle Net Configuration 125 TNSNAMES.ora 125 LISTENER.ora 126 Oracle Net Configuration verification 129 Benefits of external procedures 130 Executing external C programs from PL/SQL 131 Executing C program through external procedure development steps 131 Executing Java programs from PL/SQL 136 Calling a Java class method from PL/SQL 137 Uploading a Java class into the database development steps 137 The loadjava utility an Creating packages for Java class methods 140 Summary 141 Practice exercise 141 illustration 137 Chapter 5: Implementing VPD with Fine Grained Access Control 145 Fine Grained Access Control 146 Overview 146 Virtual Private Database the alias 147

How FGAC or VPD works? 147 Salient features of VPD 148 VPD implementation outline and components 149 Application context 150 Policy function definition and implementation of row-level security 153 Associating a policy using the DBMS_RLS package 155 VPD implementation demonstrations 156 Assignment 1 implementing VPD using simple security policy 157 Assignment 2 implementing VPD using an application context 159 VPD policy metadata 163 Policy utilities refresh and drop 164 Summary 165 Practice exercise 165 Chapter 6: Working with Large Objects 169 Introduction to the LOB data types 170 Internal LOB 171 External LOB 171 Understanding the LOB data types 172 LOB value and LOB locators 172 BLOBorCLOB! 172 BFILE 173 Temporary LOBs 173 Creating LOB data types 173 Directories 173 Creating LOB data type columns in a table 175 Managing LOB data types 177 Managing internal LOBs 178 Securing and managing BFILEs 178 The DBMSJ.OB package overview 179 Security model 179 DBMSJ-OB constants 180 DBM S_LOB data types 180 DBMSJ-OB subprograms 181 Rules and regulations 182 Working with the CLOB, BLOB, and BFILE data types 183 Initializing LOB data type columns 184 Inserting data into a LOB column 185 Populating a LOB data type using an external file 185 Selecting LOB data 189 Modifying the LOB data 190 Delete LOB data 192 Miscellaneous LOB notes 192

LOB column states 193 Locking a row containing LOB 193 Opening and closing LOBs 193 Accessing LOBs 193 LOB restrictions 194 Migrating from LONG to LOB 194 Using temporary LOBs 196 Temporary LOB operations 196 Managing temporary LOBs 197 Validating, creating, and freeing a temporary LOB 198 Summary 200 Practice exercise 200 Chapter 7: Using SecureFile LOBs 205 Introduction to SecureFiles 206 SecureFile LOB an overview 207 Architectural enhancements in SecureFiles 208 SecureFile LOB features 210 Working with SecureFiles 211 SecureFile metadata 213 Enabling advanced features in SecureFiles 214 Deduplication 214 Compression 215 Encryption 216 Migration from BasicFiles to SecureFiles 220 Online Redefinition method 221 Summary 224 Practice exercise 225 Chapter 8: Compiling and Tuning to Improve Performance 227 Native and interpreted compilation techniques 228 Real native compilation 229 Selecting the appropriate compilation mode 230 When to choose interpreted compilation mode? 230 When to choose native compilation mode? 231 Setting the compilation mode 231 Querying the compilation settings 232 Compiling a program unit for a native or interpreted compilation 233 Compiling the database for PL/SQL native compilation (NCOMP) 235 Tuning PL/SQL code 238 Comparing SQL and PL/SQL 239 Avoiding implicit data type conversion 239 Understanding the NOT NULL constraint 241 Using the PLSJNTEGER data type for arithmetic operations 243

Using a SIMPLEJ NTEGER data type 245 Modularizing the PL/SQL code 246 Using bulk binding 248 Using SAVE_EXCEPTIONS 252 Rephrasing the conditional control statements 254 Conditions with an OR logical operator 254 Conditions with an AND logical operator 254 Enabling intra unit inlining 255 PLSQL_OPTIMIZE_LEVEL the Oracle initialization parameter 256 Case 1 PLSQL_OPTIMIZE_LEVEL = 0 256 Case 2 PLSQL_OPTIMIZE_LEVEL = 1 258 Case 3 PLSQL_OPTIMIZE_LEVEL = 2 259 Case 4 PLSQL_OPTIMIZE_LEVEL = 3 260 PRAGMA INLINE 262 Summary 265 Practice exercise 265 Chapter 9: Caching to Improve Performance 269 Introduction to result cache 270 Server-side result cache 271 SQL query result cache 272 PL/SQL function result cache 272 OCI client results cache 273 Configuring the database for the server result cache 273 The DBMS_RESULT_CACHE package 276 Implementing the result cache in SQL 277 Manual result cache 277 Automatic result cache 279 Result cache metadata 281 Query result cache dependencies 283 Cache memory statistics 283 Invalidation of SQL result cache 284 Displaying the result cache memory report 286 Read consistency of the SQL result cache 287 Limitation of SQL result cache 287 Implementing result cache in PL/SQL 288 The RESULT_CACHE clause 288 Cross-session availability of cached results 292 Invalidation of PL/SQL result cache 292 Limitations of PL/SQL function result cache 294 Argument and return type restrictions 294 Function structural restrictions 294 Summary 295 Practice exercise 295

Chapter 10: Analyzing PL/SQL Code 299 Track coding information 299 [DBA ALL USERLARGUMENTS 301 [DBA ALL USERLOBJECTS 304 [DBA ALL USER]_SOURCE 306 [DBA ALL USER]_PROCEDURES 307 [DBA ALL USERLDEPENDENCIES 308 Using SQL Developer to find coding information 310 The DBMS_DESCRIBE package 313 DBMS_UTILITY.FORMAT_CALL_STACK 316 Tracking propagating exceptions in PL/SQL code 318 Determining identifier types and usages 319 The PL/Scope tool 320 The PL/Scope identifier collection 320 The PUScope report 322 Illustration 322 Applications of the PL/Scope report 325 The DBMS_METADATA package 326 DBMS_METADATA data types and subprograms 327 Parameter requirements 330 The DBMS_METADATA transformation parameters and filters 330 Working with DBMS_METADATA illustrations 332 Case 1 retrieve the metadata of a single object 332 Case 2 retrieve the object dependencies on the F_GET LOC function 335 Case 3 retrieve system grants on the ORADEV schema 335 Case 4 retrieve objects of function type in the ORADEV schema 336 Summary 337 Practice exercise 337 Chapter 11: Profiling and Tracing PL/SQL Code 339 Tracing the PL/SQL programs 340 The DBMS TRACE package 341 Installing DBMS_TRACE 341 DBMS_TRACE subprograms 341 The PLSQL_DEBUG parameter and the DEBUG option 343 Viewing the PL/SQL trace information 344 Demonstrating the PL/SQL tracing 347 Profiling the PL/SQL programs 350 Oracle hierarchical profiler the DBMS_HPROF package 351 View profiler information 352 Demonstrating the profiling of a PL/SQL program 352 The plshprof utility 357 Sample reports 359

Table ofcontents Summary 361 Practice exercise 361 Chapter 12: Safeguarding PL/SQL Code against SQL Injection Attacks 365 SQL injection an introduction 366 SQL injection an Types of SQL injection overview 366 attacks 369 Preventing SQL injection attacks 369 Immunizing SQL injection attacks 370 Reducing the attack's surface 370 Controlling user privileges 371 Invoker's and definer's rights 371 Avoiding dynamic SQL 375 Bind arguments 378 Sanitizing inputs using DBMS_ASSERT 379 The DBMS_ASSERT package 380 Testing the code for SQL injection flaws 386 Test strategy 386 Reviewing the code 386 Static code analysis 387 Fuzz tools 387 Generating test cases 387 Summary 388 Practice exercise 388 Appendix: Answers to Practice Questions 391 Chapter 1, Overview of PL/SQL Programming Concepts 391 Chapter 2, Designing PL/SQL Code 392 Chapter 3, Using Collections 393 Chapter 4, Using Advanced Interface Methods 394 Chapter 5, Implementing VPD with Fine Grained Access Control 395 Chapter 6, Working with Large Objects 396 Chapter 7, Using SecureFile LOBs 397 Chapter 8, Compiling and Tuning to Improve Performance 398 Chapter 9, Caching to Improve Performance 400 Chapter 10, Analyzing PL/SQL Code 401 Chapter 11, Profiling and Tracing PL/SQL Code 401 Chapter 12, Safeguarding PL/SQL Code against SQL Injection Attacks 402 Index 405