반응형
/********************************************************************************************
-- Title : [SQL Server] 로컬, 원격 실행시 Profiler EventClass, TextData 수집 내역
-- Reference : dbrang.tistory.com
-- Key word : profiler, 프로파일러, 원격, 로컬, remote, local, RPC
********************************************************************************************/
-- 로컬에 SQL2005, 원격에 SQL2000
-- 로컬에 Profiler 실행

/****************************************
-- at SQL 2005(로컬)
****************************************/
select * from dbo.ttt;
--SQL:BatchCompleted     select * from dbo.ttt;

create proc up_ttt
as
select * from dbo.ttt;
go
exec up_ttt;
--SQL:BatchCompleted     exec up_ttt;

select * from sql2000srv.pubs.dbo.jobs;
--SQL:BatchCompleted     select * from sql2000srv.pubs.dbo.jobs;

exec sql2000srv.pubs.dbo.up_jobs;
--SQL:BatchCompleted     exec sql2000srv.pubs.dbo.up_jobs;

exec up_jobs_at2k5;
--SQL:BatchCompleted     exec up_jobs_at2k5;

/****************************************
-- at SQL 2000(원격)
****************************************/
select * from sql2005srv.adventureworks.dbo.ttt
/*
SQL:BatchCompleted set implicit_transactions on
RPC:Completed         declare @p1 int
                               set @p1=1
                               declare @p2 bigint
                               set @p2=170497317037847
                               exec sp_getschemalock @p1 output,@p2 output,N'"adventure~"."dbo"."ttt"'
                               select @p1, @p2 
RPC:Completed         declare @p1 int
                               set @p1=5
                               exec sp_prepexec @p1 output,NULL,N'SELECT Tbl1001."a" "Col1003",
                               Tbl1001."b" "Col1004",Tbl1001."c" "Col1005",Tbl1001."bin_chksum" "Col1006" 
                               FROM "adventureworks"."dbo"."ttt" Tbl1001'
                               select @p1 
RPC:Completed         exec sp_unprepare 5 
RPC:Completed         exec sp_releaseschemalock 1
SQL:BatchCompleted IF @@TRANCOUNT > 0 ROLLBACK TRAN
SQL:BatchCompleted set implicit_transactions off
RPC:Completed         exec sp_reset_connection
*/

create proc up_ttt_2k
as
select * from sql2005srv.adventureworks.dbo.ttt
go
/*
RPC:Completed         exec sp_reset_connection
SQL:BatchCompleted set implicit_transactions on
RPC:Completed         declare @p1 int
                               set @p1=1
                               declare @p2 bigint
                               set @p2=170497317037847
                               exec sp_getschemalock @p1 output,@p2 output,N'"adventure~"."dbo"."ttt"'
                               select @p1, @p2
RPC:Completed         declare @p1 int
                               set @p1=7
                               exec sp_prepexec @p1 output,NULL,N'SELECT Tbl1001."a" "Col1003",
                               Tbl1001."b" "Col1004",Tbl1001."c" "Col1005",Tbl1001."bin_chksum" "Col1006" 
                               FROM "adventureworks"."dbo"."ttt" Tbl1001'
                               select @p1
RPC:Completed         exec sp_unprepare 7
RPC:Completed         exec sp_releaseschemalock 1
SQL:BatchCompleted IF @@TRANCOUNT > 0 ROLLBACK TRAN
SQL:BatchCompleted set implicit_transactions off
RPC:Completed         exec sp_reset_connection
*/

exec sql2005srv.adventureworks.dbo.up_ttt
/*
RPC:Completed         exec "adventureworks"."dbo"."up_ttt";1
RPC:Completed         exec sp_reset_connection
*/

create proc up_rpc_ttt
as
exec sql2005srv.adventureworks.dbo.up_ttt
go
/*
RPC:Completed         exec "adventureworks"."dbo"."up_ttt";1
RPC:Completed         exec sp_reset_connection
*/
반응형

+ Recent posts