Can I achieve DBMS_Application, DBMS_Session, DBMS_Output in SQL Server 2017












2















I'm looking for alternatives in SQL Server for the below three functions which are currently performed using Oracle.



These are the Oracle features we need to use in SQL Server basically:





  1. DBMS_Application (Tracing option in Oracle).


  2. DBMS_Session (Used in Oracle).

  3. Disable or enable DBMS_Output at database level.


We are moving from Oracle to SQL Server and we want to ensure the functionality equivalents are available and ready to use so I can start testing.



What would be the SQL Server functionality equivalent of these features we use with Oracle?










share|improve this question

























  • one of project requirement was they want to move from Oracle to SQL server how ever they want same functionality so i am trying to get some help here

    – PAWANMANTHA
    Feb 10 at 13:39


















2















I'm looking for alternatives in SQL Server for the below three functions which are currently performed using Oracle.



These are the Oracle features we need to use in SQL Server basically:





  1. DBMS_Application (Tracing option in Oracle).


  2. DBMS_Session (Used in Oracle).

  3. Disable or enable DBMS_Output at database level.


We are moving from Oracle to SQL Server and we want to ensure the functionality equivalents are available and ready to use so I can start testing.



What would be the SQL Server functionality equivalent of these features we use with Oracle?










share|improve this question

























  • one of project requirement was they want to move from Oracle to SQL server how ever they want same functionality so i am trying to get some help here

    – PAWANMANTHA
    Feb 10 at 13:39
















2












2








2








I'm looking for alternatives in SQL Server for the below three functions which are currently performed using Oracle.



These are the Oracle features we need to use in SQL Server basically:





  1. DBMS_Application (Tracing option in Oracle).


  2. DBMS_Session (Used in Oracle).

  3. Disable or enable DBMS_Output at database level.


We are moving from Oracle to SQL Server and we want to ensure the functionality equivalents are available and ready to use so I can start testing.



What would be the SQL Server functionality equivalent of these features we use with Oracle?










share|improve this question
















I'm looking for alternatives in SQL Server for the below three functions which are currently performed using Oracle.



These are the Oracle features we need to use in SQL Server basically:





  1. DBMS_Application (Tracing option in Oracle).


  2. DBMS_Session (Used in Oracle).

  3. Disable or enable DBMS_Output at database level.


We are moving from Oracle to SQL Server and we want to ensure the functionality equivalents are available and ready to use so I can start testing.



What would be the SQL Server functionality equivalent of these features we use with Oracle?







sql-server






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 10 at 16:56









Pimp Juice IT

25.1k114177




25.1k114177










asked Feb 10 at 6:12









PAWANMANTHAPAWANMANTHA

132




132













  • one of project requirement was they want to move from Oracle to SQL server how ever they want same functionality so i am trying to get some help here

    – PAWANMANTHA
    Feb 10 at 13:39





















  • one of project requirement was they want to move from Oracle to SQL server how ever they want same functionality so i am trying to get some help here

    – PAWANMANTHA
    Feb 10 at 13:39



















one of project requirement was they want to move from Oracle to SQL server how ever they want same functionality so i am trying to get some help here

– PAWANMANTHA
Feb 10 at 13:39







one of project requirement was they want to move from Oracle to SQL server how ever they want same functionality so i am trying to get some help here

– PAWANMANTHA
Feb 10 at 13:39












1 Answer
1






active

oldest

votes


















1














DBMS_APPLICATION_INFO



Note: You should test and pick which works best or which combinations of these work best for your needs. Test thoroughly and compare results while ensuring none of these cause overhead issues with the SQL Server instance. For example SQL Profiler is resource intense so use caution.



Based on the general description of the DBMS_APPLICATION_INFO package functionality per the Oracle docs, a few things with SQL Server will provide equivalent functionality. I'll list a few below for you to dig into with more detail and for a starting point, etc.





  • DBMS_APPLICATION_INFO



    Application developers can use the DBMS_APPLICATION_INFO package with
    Oracle Trace and the SQL trace facility to record names of executing
    modules or transactions in the database for later use when tracking
    the performance of various modules and debugging.



    Source




The SQL Server DBMS_APPLICATION_INFO equivelants. . .




  • SQL Server Profiler

  • Extended Events

  • SQL Server Audit

  • System Dynamic Management Views


  • sp_whoisactive




    • Automate capturing SQL Server activity with SP_WHOISACTIVE and SP_WHO2 via a SQL Agent job






DBMS_SESSION



Based on the general description of the DBMS_SESSION package functionality per the Oracle docs, use ALTER EVENT SESSION and ALTER ROLE or sp_addrolemember for providing equivalent functionality with SQL Server.





  • DBMS_SESSION



    This package provides access to SQL ALTER SESSION and SET ROLE
    statements, and other session information, from PL/SQL. You can use
    DBMS_SESSION to set preferences and security levels.



    Source






DBMS_OUTPUT



Based on the general description of the DBMS_OUTPUT package functionality per the Oracle docs, you can just use PRINT or SELECT to output the message and write the logic accordingly. Without getting into all the detail of the DBMS_OUTPUT Subprograms one by one, it seems that's the general and basic functionality it provides is controlling output and debug output of stored procedures and such.





  • DBMS_OUTPUT



    The DBMS_OUTPUT package enables you to send messages from stored
    procedures, packages, and triggers. The package is especially useful
    for displaying PL/SQL debugging information




Additionally and for example, according to a response on the "How to Print the Value of a Variable in SQL Server" post it is stated and sounds right to me too based on my past MSSQL usage. . .





  • I don't think there is a straight up SQL equivalent. I don't know of
    any direct capabilities for leaving a list for a trigger or another
    routine. Usually, I would just use a #temp table or function
    parameters to pass intermediate results.



    If you want to see intermediate results for edit purposes, the PRINT
    function works - e.g. in a stored procedure, it's a common debugging
    routine to insert print statements to show intermediate results in the
    edit environment.



    Source






Further Resources




  • Serveroutput from a TSQL procedure






share|improve this answer


























  • Thanks Pimp , I will follow the above instruction and get back to you.

    – PAWANMANTHA
    Feb 11 at 4:21











  • I have share the same to my team and we have not done complete testing on this

    – PAWANMANTHA
    Feb 17 at 5:18











  • but your suggestions had help me lot to move further

    – PAWANMANTHA
    Feb 17 at 5:18











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1404054%2fcan-i-achieve-dbms-application-dbms-session-dbms-output-in-sql-server-2017%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














DBMS_APPLICATION_INFO



Note: You should test and pick which works best or which combinations of these work best for your needs. Test thoroughly and compare results while ensuring none of these cause overhead issues with the SQL Server instance. For example SQL Profiler is resource intense so use caution.



Based on the general description of the DBMS_APPLICATION_INFO package functionality per the Oracle docs, a few things with SQL Server will provide equivalent functionality. I'll list a few below for you to dig into with more detail and for a starting point, etc.





  • DBMS_APPLICATION_INFO



    Application developers can use the DBMS_APPLICATION_INFO package with
    Oracle Trace and the SQL trace facility to record names of executing
    modules or transactions in the database for later use when tracking
    the performance of various modules and debugging.



    Source




The SQL Server DBMS_APPLICATION_INFO equivelants. . .




  • SQL Server Profiler

  • Extended Events

  • SQL Server Audit

  • System Dynamic Management Views


  • sp_whoisactive




    • Automate capturing SQL Server activity with SP_WHOISACTIVE and SP_WHO2 via a SQL Agent job






DBMS_SESSION



Based on the general description of the DBMS_SESSION package functionality per the Oracle docs, use ALTER EVENT SESSION and ALTER ROLE or sp_addrolemember for providing equivalent functionality with SQL Server.





  • DBMS_SESSION



    This package provides access to SQL ALTER SESSION and SET ROLE
    statements, and other session information, from PL/SQL. You can use
    DBMS_SESSION to set preferences and security levels.



    Source






DBMS_OUTPUT



Based on the general description of the DBMS_OUTPUT package functionality per the Oracle docs, you can just use PRINT or SELECT to output the message and write the logic accordingly. Without getting into all the detail of the DBMS_OUTPUT Subprograms one by one, it seems that's the general and basic functionality it provides is controlling output and debug output of stored procedures and such.





  • DBMS_OUTPUT



    The DBMS_OUTPUT package enables you to send messages from stored
    procedures, packages, and triggers. The package is especially useful
    for displaying PL/SQL debugging information




Additionally and for example, according to a response on the "How to Print the Value of a Variable in SQL Server" post it is stated and sounds right to me too based on my past MSSQL usage. . .





  • I don't think there is a straight up SQL equivalent. I don't know of
    any direct capabilities for leaving a list for a trigger or another
    routine. Usually, I would just use a #temp table or function
    parameters to pass intermediate results.



    If you want to see intermediate results for edit purposes, the PRINT
    function works - e.g. in a stored procedure, it's a common debugging
    routine to insert print statements to show intermediate results in the
    edit environment.



    Source






Further Resources




  • Serveroutput from a TSQL procedure






share|improve this answer


























  • Thanks Pimp , I will follow the above instruction and get back to you.

    – PAWANMANTHA
    Feb 11 at 4:21











  • I have share the same to my team and we have not done complete testing on this

    – PAWANMANTHA
    Feb 17 at 5:18











  • but your suggestions had help me lot to move further

    – PAWANMANTHA
    Feb 17 at 5:18
















1














DBMS_APPLICATION_INFO



Note: You should test and pick which works best or which combinations of these work best for your needs. Test thoroughly and compare results while ensuring none of these cause overhead issues with the SQL Server instance. For example SQL Profiler is resource intense so use caution.



Based on the general description of the DBMS_APPLICATION_INFO package functionality per the Oracle docs, a few things with SQL Server will provide equivalent functionality. I'll list a few below for you to dig into with more detail and for a starting point, etc.





  • DBMS_APPLICATION_INFO



    Application developers can use the DBMS_APPLICATION_INFO package with
    Oracle Trace and the SQL trace facility to record names of executing
    modules or transactions in the database for later use when tracking
    the performance of various modules and debugging.



    Source




The SQL Server DBMS_APPLICATION_INFO equivelants. . .




  • SQL Server Profiler

  • Extended Events

  • SQL Server Audit

  • System Dynamic Management Views


  • sp_whoisactive




    • Automate capturing SQL Server activity with SP_WHOISACTIVE and SP_WHO2 via a SQL Agent job






DBMS_SESSION



Based on the general description of the DBMS_SESSION package functionality per the Oracle docs, use ALTER EVENT SESSION and ALTER ROLE or sp_addrolemember for providing equivalent functionality with SQL Server.





  • DBMS_SESSION



    This package provides access to SQL ALTER SESSION and SET ROLE
    statements, and other session information, from PL/SQL. You can use
    DBMS_SESSION to set preferences and security levels.



    Source






DBMS_OUTPUT



Based on the general description of the DBMS_OUTPUT package functionality per the Oracle docs, you can just use PRINT or SELECT to output the message and write the logic accordingly. Without getting into all the detail of the DBMS_OUTPUT Subprograms one by one, it seems that's the general and basic functionality it provides is controlling output and debug output of stored procedures and such.





  • DBMS_OUTPUT



    The DBMS_OUTPUT package enables you to send messages from stored
    procedures, packages, and triggers. The package is especially useful
    for displaying PL/SQL debugging information




Additionally and for example, according to a response on the "How to Print the Value of a Variable in SQL Server" post it is stated and sounds right to me too based on my past MSSQL usage. . .





  • I don't think there is a straight up SQL equivalent. I don't know of
    any direct capabilities for leaving a list for a trigger or another
    routine. Usually, I would just use a #temp table or function
    parameters to pass intermediate results.



    If you want to see intermediate results for edit purposes, the PRINT
    function works - e.g. in a stored procedure, it's a common debugging
    routine to insert print statements to show intermediate results in the
    edit environment.



    Source






Further Resources




  • Serveroutput from a TSQL procedure






share|improve this answer


























  • Thanks Pimp , I will follow the above instruction and get back to you.

    – PAWANMANTHA
    Feb 11 at 4:21











  • I have share the same to my team and we have not done complete testing on this

    – PAWANMANTHA
    Feb 17 at 5:18











  • but your suggestions had help me lot to move further

    – PAWANMANTHA
    Feb 17 at 5:18














1












1








1







DBMS_APPLICATION_INFO



Note: You should test and pick which works best or which combinations of these work best for your needs. Test thoroughly and compare results while ensuring none of these cause overhead issues with the SQL Server instance. For example SQL Profiler is resource intense so use caution.



Based on the general description of the DBMS_APPLICATION_INFO package functionality per the Oracle docs, a few things with SQL Server will provide equivalent functionality. I'll list a few below for you to dig into with more detail and for a starting point, etc.





  • DBMS_APPLICATION_INFO



    Application developers can use the DBMS_APPLICATION_INFO package with
    Oracle Trace and the SQL trace facility to record names of executing
    modules or transactions in the database for later use when tracking
    the performance of various modules and debugging.



    Source




The SQL Server DBMS_APPLICATION_INFO equivelants. . .




  • SQL Server Profiler

  • Extended Events

  • SQL Server Audit

  • System Dynamic Management Views


  • sp_whoisactive




    • Automate capturing SQL Server activity with SP_WHOISACTIVE and SP_WHO2 via a SQL Agent job






DBMS_SESSION



Based on the general description of the DBMS_SESSION package functionality per the Oracle docs, use ALTER EVENT SESSION and ALTER ROLE or sp_addrolemember for providing equivalent functionality with SQL Server.





  • DBMS_SESSION



    This package provides access to SQL ALTER SESSION and SET ROLE
    statements, and other session information, from PL/SQL. You can use
    DBMS_SESSION to set preferences and security levels.



    Source






DBMS_OUTPUT



Based on the general description of the DBMS_OUTPUT package functionality per the Oracle docs, you can just use PRINT or SELECT to output the message and write the logic accordingly. Without getting into all the detail of the DBMS_OUTPUT Subprograms one by one, it seems that's the general and basic functionality it provides is controlling output and debug output of stored procedures and such.





  • DBMS_OUTPUT



    The DBMS_OUTPUT package enables you to send messages from stored
    procedures, packages, and triggers. The package is especially useful
    for displaying PL/SQL debugging information




Additionally and for example, according to a response on the "How to Print the Value of a Variable in SQL Server" post it is stated and sounds right to me too based on my past MSSQL usage. . .





  • I don't think there is a straight up SQL equivalent. I don't know of
    any direct capabilities for leaving a list for a trigger or another
    routine. Usually, I would just use a #temp table or function
    parameters to pass intermediate results.



    If you want to see intermediate results for edit purposes, the PRINT
    function works - e.g. in a stored procedure, it's a common debugging
    routine to insert print statements to show intermediate results in the
    edit environment.



    Source






Further Resources




  • Serveroutput from a TSQL procedure






share|improve this answer















DBMS_APPLICATION_INFO



Note: You should test and pick which works best or which combinations of these work best for your needs. Test thoroughly and compare results while ensuring none of these cause overhead issues with the SQL Server instance. For example SQL Profiler is resource intense so use caution.



Based on the general description of the DBMS_APPLICATION_INFO package functionality per the Oracle docs, a few things with SQL Server will provide equivalent functionality. I'll list a few below for you to dig into with more detail and for a starting point, etc.





  • DBMS_APPLICATION_INFO



    Application developers can use the DBMS_APPLICATION_INFO package with
    Oracle Trace and the SQL trace facility to record names of executing
    modules or transactions in the database for later use when tracking
    the performance of various modules and debugging.



    Source




The SQL Server DBMS_APPLICATION_INFO equivelants. . .




  • SQL Server Profiler

  • Extended Events

  • SQL Server Audit

  • System Dynamic Management Views


  • sp_whoisactive




    • Automate capturing SQL Server activity with SP_WHOISACTIVE and SP_WHO2 via a SQL Agent job






DBMS_SESSION



Based on the general description of the DBMS_SESSION package functionality per the Oracle docs, use ALTER EVENT SESSION and ALTER ROLE or sp_addrolemember for providing equivalent functionality with SQL Server.





  • DBMS_SESSION



    This package provides access to SQL ALTER SESSION and SET ROLE
    statements, and other session information, from PL/SQL. You can use
    DBMS_SESSION to set preferences and security levels.



    Source






DBMS_OUTPUT



Based on the general description of the DBMS_OUTPUT package functionality per the Oracle docs, you can just use PRINT or SELECT to output the message and write the logic accordingly. Without getting into all the detail of the DBMS_OUTPUT Subprograms one by one, it seems that's the general and basic functionality it provides is controlling output and debug output of stored procedures and such.





  • DBMS_OUTPUT



    The DBMS_OUTPUT package enables you to send messages from stored
    procedures, packages, and triggers. The package is especially useful
    for displaying PL/SQL debugging information




Additionally and for example, according to a response on the "How to Print the Value of a Variable in SQL Server" post it is stated and sounds right to me too based on my past MSSQL usage. . .





  • I don't think there is a straight up SQL equivalent. I don't know of
    any direct capabilities for leaving a list for a trigger or another
    routine. Usually, I would just use a #temp table or function
    parameters to pass intermediate results.



    If you want to see intermediate results for edit purposes, the PRINT
    function works - e.g. in a stored procedure, it's a common debugging
    routine to insert print statements to show intermediate results in the
    edit environment.



    Source






Further Resources




  • Serveroutput from a TSQL procedure







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 12 at 5:17

























answered Feb 10 at 16:52









Pimp Juice ITPimp Juice IT

25.1k114177




25.1k114177













  • Thanks Pimp , I will follow the above instruction and get back to you.

    – PAWANMANTHA
    Feb 11 at 4:21











  • I have share the same to my team and we have not done complete testing on this

    – PAWANMANTHA
    Feb 17 at 5:18











  • but your suggestions had help me lot to move further

    – PAWANMANTHA
    Feb 17 at 5:18



















  • Thanks Pimp , I will follow the above instruction and get back to you.

    – PAWANMANTHA
    Feb 11 at 4:21











  • I have share the same to my team and we have not done complete testing on this

    – PAWANMANTHA
    Feb 17 at 5:18











  • but your suggestions had help me lot to move further

    – PAWANMANTHA
    Feb 17 at 5:18

















Thanks Pimp , I will follow the above instruction and get back to you.

– PAWANMANTHA
Feb 11 at 4:21





Thanks Pimp , I will follow the above instruction and get back to you.

– PAWANMANTHA
Feb 11 at 4:21













I have share the same to my team and we have not done complete testing on this

– PAWANMANTHA
Feb 17 at 5:18





I have share the same to my team and we have not done complete testing on this

– PAWANMANTHA
Feb 17 at 5:18













but your suggestions had help me lot to move further

– PAWANMANTHA
Feb 17 at 5:18





but your suggestions had help me lot to move further

– PAWANMANTHA
Feb 17 at 5:18


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1404054%2fcan-i-achieve-dbms-application-dbms-session-dbms-output-in-sql-server-2017%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?