SlideShare una empresa de Scribd logo
1 de 22
Invoker Rights
PROBLEM IDENTIFICATION




1                      Customized Objects

2                      STD Objects

3                      Dummy/Testing Objects




     Objects = Procedures + Function + Packages
EXISTING POSITION OF DATABASE OBJECTS

DIRMAT         OPS_PROD          INDIRECT




 MKT             PPC               FIN




 HR              ATTEN             TRAIN
PRAPOSED POSITION OF DATABASE OBJECTS

DIRMAT         OPS_PROD         INDIRECT




 MKT             PPC              FIN




 HR             ATTEN             TRAIN
Example

• If we have 50 STD Objects and If we have
  20 schema
• 1000 Objects are Present in Database



INDIRECTLY
Same 50 Objects Present in Same DATABASE 20 TIMES
WHAT IS THE SOLUTION    ?
Schema                           Schema
  A                                  B

 DIRMAT                         INDIRECT




  MAKE Schema A  LIKE Schema B
       USE Invoker-Rights
What is Invoker-Rights?
• Invoker rights is a new model for resolving
  references to database elements in a
  PL/SQL program unit. From Oracle 8i
  onwards, we can decide if a program unit
  should run with the authority of the definer
  or of the invoker. This means that multiple
  schemas, accessing only those elements
  belonging to the invoker, can share the
  same piece of code.
Existing Method of Objects utilization

      DIRMAT                                                INDIRECT

Declare        Pkg_trans                              Declare        Pkg_trans
...                                                   ...
Begin                                                 Begin
    Select…                                               Select…
End;                                                  End;

               Table
                                  OPS_PROD                           Table

                            Declare       Pkg_trans
                            ...
                            Begin
                                Select…
                            End;
         PPC                                                        MKT
                                          Table

 Declare        Pkg_trans                              Declare        Pkg_trans
 ...                                                   ...
 Begin                                                 Begin
     Select…                                               Select…
 End;                                                  End;

               Table                                                 Table
Objects utilization with Invoker-Rights

DIRECT                            INDIRECT

Pkg_trans                         Pkg_trans
                 OPS_PROD

              Pkg_trans
 Table                             Table
                    Declare
                    ...
                    Begin
                       Select…
                    End;

  PPC                                MKT
                          Table

 Pkg_trans                        Pkg_trans




  Table                             Table
Exec sp_control
           User X                      User Y




         Sp_control                 Sp_control



                 DIRMAT_CTL                      MKT_CTL




DIRMAT                        MKT
Exec mkt.sp_control
           User X                      User Y




         Sp_control                 Sp_control



                 DIRMAT_CTL                      MKT_CTL




DIRMAT                        MKT
Exec sp_control
         User X                     User Y




                                 Sp_control



              DIRMAT_CTL                      MKT_CTL




DIRMAT                     MKT
When you create a PL/SQL program unit,
 you can include an optional AUTHID
 clause.
There are two forms of this clause:

•    AUTHID DEFINER
•    AUTHID CURRENT_USER

    AUTHID DEFINER is the default
WITH definer rights             WITH invoker rights




create or replace procedure P   create or replace procedure P
    as                             AUTHID CURRENT_USER
Begin                              as
---------                       Begin
-------                         ---------
end;                            -------
                                end;
Exec sp_control

  User X             User Y            User Z




                    Sp_control



 DIRMAT_CTL
                      PROD_CTL     MKT_CTL




DIRMAT           OPS_PROD        MKT
Existing Problem

•   If Changes done deploy to All Schema time consuming work

•   Chances of Missing to some schema results in Issues

•   More Objects More Maintenance

•   Accumulation of Un-necessary Objects end up in JUNK Objects

•   More Time for Backup and Recovery
Benefits
•   No Need of Deployment to Other schema in case of Changes

•   Changes only in one place, lot of time saved

•   Less Maintenance due to less Objects

•   Security as Only Authorized person have access

•   Fast Backup and Recovery due to Less Objects
Limitations
•   Not advised for big processing procedures as performance impact

•   Implementation always with core schema
Steps
Conn OPS_PROD/OPS_PROD
create or replace procedure P AUTHID CURRENT_USER as
Begin
---------
-------
end;
grant execute on p to dirmat
conn dirmat/dirmat
exec ops_prod.p;
grant execute on p to public
create public synonym sp_control for ops_prod.p;
conn dirmat/dirmat
exec sp_control;
Q&A

Thank you

Más contenido relacionado

La actualidad más candente

Les 2 Javascript
Les 2 JavascriptLes 2 Javascript
Les 2 Javascript
mvanginkel
 
Ch7 OS
Ch7 OSCh7 OS
Ch7 OS
C.U
 

La actualidad más candente (20)

Delays in verilog
Delays in verilogDelays in verilog
Delays in verilog
 
Instructions
InstructionsInstructions
Instructions
 
Verilog hdl
Verilog hdlVerilog hdl
Verilog hdl
 
OSCh7
OSCh7OSCh7
OSCh7
 
Les 2 Javascript
Les 2 JavascriptLes 2 Javascript
Les 2 Javascript
 
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
06 lcd slides 1 - PROCESS SYNCHRONIZATION POWERPOINT
 
Usp notes unit6-8
Usp notes unit6-8Usp notes unit6-8
Usp notes unit6-8
 
Microcontroller lec 3
Microcontroller  lec 3Microcontroller  lec 3
Microcontroller lec 3
 
Ch7 OS
Ch7 OSCh7 OS
Ch7 OS
 
OS_Ch7
OS_Ch7OS_Ch7
OS_Ch7
 
System design using HDL - Module 5
System design using HDL - Module 5System design using HDL - Module 5
System design using HDL - Module 5
 
Hd2
Hd2Hd2
Hd2
 
OS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and MonitorsOS Process Synchronization, semaphore and Monitors
OS Process Synchronization, semaphore and Monitors
 
C programming session10
C programming  session10C programming  session10
C programming session10
 
04 sequentialbasics 1
04 sequentialbasics 104 sequentialbasics 1
04 sequentialbasics 1
 
Verilog 語法教學
Verilog 語法教學 Verilog 語法教學
Verilog 語法教學
 
Hd6
Hd6Hd6
Hd6
 
Ch6
Ch6Ch6
Ch6
 
07 sequential verilog
07 sequential verilog07 sequential verilog
07 sequential verilog
 
Verilog tutorial
Verilog tutorialVerilog tutorial
Verilog tutorial
 

Destacado

Destacado (7)

Should Invoker Rights be used?
Should Invoker Rights be used?Should Invoker Rights be used?
Should Invoker Rights be used?
 
Oracle PL/SQL exception handling
Oracle PL/SQL exception handlingOracle PL/SQL exception handling
Oracle PL/SQL exception handling
 
Designing Teams for Emerging Challenges
Designing Teams for Emerging ChallengesDesigning Teams for Emerging Challenges
Designing Teams for Emerging Challenges
 
UX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and ArchivesUX, ethnography and possibilities: for Libraries, Museums and Archives
UX, ethnography and possibilities: for Libraries, Museums and Archives
 
Visual Design with Data
Visual Design with DataVisual Design with Data
Visual Design with Data
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 20173 Things Every Sales Team Needs to Be Thinking About in 2017
3 Things Every Sales Team Needs to Be Thinking About in 2017
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Similar a Invoker rights

Print Testing
Print TestingPrint Testing
Print Testing
donwelch
 
Convergence
ConvergenceConvergence
Convergence
donwelch
 
Micro controller based DAQ
Micro controller based DAQMicro controller based DAQ
Micro controller based DAQ
Murugappa Group
 

Similar a Invoker rights (20)

IBM IMPACT 2014 - AMC-1883 - Where's My Message - Analyze IBM WebSphere MQ Re...
IBM IMPACT 2014 - AMC-1883 - Where's My Message - Analyze IBM WebSphere MQ Re...IBM IMPACT 2014 - AMC-1883 - Where's My Message - Analyze IBM WebSphere MQ Re...
IBM IMPACT 2014 - AMC-1883 - Where's My Message - Analyze IBM WebSphere MQ Re...
 
Micro c lab2(led patterns)
Micro c lab2(led patterns)Micro c lab2(led patterns)
Micro c lab2(led patterns)
 
Ob1k presentation at Java.IL
Ob1k presentation at Java.ILOb1k presentation at Java.IL
Ob1k presentation at Java.IL
 
Advanced CA Endevor® Software Change Manager Processor Coding Techniques: Pra...
Advanced CA Endevor® Software Change Manager Processor Coding Techniques: Pra...Advanced CA Endevor® Software Change Manager Processor Coding Techniques: Pra...
Advanced CA Endevor® Software Change Manager Processor Coding Techniques: Pra...
 
Presenty
PresentyPresenty
Presenty
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB
 
Print Testing
Print TestingPrint Testing
Print Testing
 
Convergence
ConvergenceConvergence
Convergence
 
Micro controller based DAQ
Micro controller based DAQMicro controller based DAQ
Micro controller based DAQ
 
A Python Petting Zoo
A Python Petting ZooA Python Petting Zoo
A Python Petting Zoo
 
(3) cpp procedural programming
(3) cpp procedural programming(3) cpp procedural programming
(3) cpp procedural programming
 
XMOS XS1 and XC
XMOS XS1 and XCXMOS XS1 and XC
XMOS XS1 and XC
 
A whirlwind tour of the LLVM optimizer
A whirlwind tour of the LLVM optimizerA whirlwind tour of the LLVM optimizer
A whirlwind tour of the LLVM optimizer
 
Quick tour of PHP from inside
Quick tour of PHP from insideQuick tour of PHP from inside
Quick tour of PHP from inside
 
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
Exactly-Once Made Easy: Transactional Messaging Improvement for Usability and...
 
Mkl mic lab_0
Mkl mic lab_0Mkl mic lab_0
Mkl mic lab_0
 
neiljaysonching
neiljaysonchingneiljaysonching
neiljaysonching
 
neiljaysonching
neiljaysonchingneiljaysonching
neiljaysonching
 
Plpgsql internals
Plpgsql internalsPlpgsql internals
Plpgsql internals
 
Preparation for mit ose lab4
Preparation for mit ose lab4Preparation for mit ose lab4
Preparation for mit ose lab4
 

Último

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 

Invoker rights

  • 2. PROBLEM IDENTIFICATION 1 Customized Objects 2 STD Objects 3 Dummy/Testing Objects Objects = Procedures + Function + Packages
  • 3. EXISTING POSITION OF DATABASE OBJECTS DIRMAT OPS_PROD INDIRECT MKT PPC FIN HR ATTEN TRAIN
  • 4. PRAPOSED POSITION OF DATABASE OBJECTS DIRMAT OPS_PROD INDIRECT MKT PPC FIN HR ATTEN TRAIN
  • 5. Example • If we have 50 STD Objects and If we have 20 schema • 1000 Objects are Present in Database INDIRECTLY Same 50 Objects Present in Same DATABASE 20 TIMES
  • 6. WHAT IS THE SOLUTION ? Schema Schema A B DIRMAT INDIRECT MAKE Schema A LIKE Schema B USE Invoker-Rights
  • 7. What is Invoker-Rights? • Invoker rights is a new model for resolving references to database elements in a PL/SQL program unit. From Oracle 8i onwards, we can decide if a program unit should run with the authority of the definer or of the invoker. This means that multiple schemas, accessing only those elements belonging to the invoker, can share the same piece of code.
  • 8. Existing Method of Objects utilization DIRMAT INDIRECT Declare Pkg_trans Declare Pkg_trans ... ... Begin Begin Select… Select… End; End; Table OPS_PROD Table Declare Pkg_trans ... Begin Select… End; PPC MKT Table Declare Pkg_trans Declare Pkg_trans ... ... Begin Begin Select… Select… End; End; Table Table
  • 9. Objects utilization with Invoker-Rights DIRECT INDIRECT Pkg_trans Pkg_trans OPS_PROD Pkg_trans Table Table Declare ... Begin Select… End; PPC MKT Table Pkg_trans Pkg_trans Table Table
  • 10. Exec sp_control User X User Y Sp_control Sp_control DIRMAT_CTL MKT_CTL DIRMAT MKT
  • 11. Exec mkt.sp_control User X User Y Sp_control Sp_control DIRMAT_CTL MKT_CTL DIRMAT MKT
  • 12. Exec sp_control User X User Y Sp_control DIRMAT_CTL MKT_CTL DIRMAT MKT
  • 13. When you create a PL/SQL program unit, you can include an optional AUTHID clause. There are two forms of this clause: • AUTHID DEFINER • AUTHID CURRENT_USER AUTHID DEFINER is the default
  • 14. WITH definer rights WITH invoker rights create or replace procedure P create or replace procedure P as AUTHID CURRENT_USER Begin as --------- Begin ------- --------- end; ------- end;
  • 15. Exec sp_control User X User Y User Z Sp_control DIRMAT_CTL PROD_CTL MKT_CTL DIRMAT OPS_PROD MKT
  • 16. Existing Problem • If Changes done deploy to All Schema time consuming work • Chances of Missing to some schema results in Issues • More Objects More Maintenance • Accumulation of Un-necessary Objects end up in JUNK Objects • More Time for Backup and Recovery
  • 17. Benefits • No Need of Deployment to Other schema in case of Changes • Changes only in one place, lot of time saved • Less Maintenance due to less Objects • Security as Only Authorized person have access • Fast Backup and Recovery due to Less Objects
  • 18. Limitations • Not advised for big processing procedures as performance impact • Implementation always with core schema
  • 19. Steps Conn OPS_PROD/OPS_PROD create or replace procedure P AUTHID CURRENT_USER as Begin --------- ------- end; grant execute on p to dirmat conn dirmat/dirmat exec ops_prod.p; grant execute on p to public create public synonym sp_control for ops_prod.p; conn dirmat/dirmat exec sp_control;
  • 20.
  • 21.