DatabaseProcApplicationCreatedLinks
sybsystemprocssp_helpconfig_usage  14 déc. 14Defects Propagation Dependencies

1     
2     /*
3     ** Messages for "sp_helpconfig"
4     **
5     ** 17260, "Can't run %1! from within a transaction."
6     **
7     ** 18283, "Configuration parameter '%1!' is not supported in this
8     **	  system stored procedure, or the usage is incorrect. Please refer
9     **	  to System Administration Guide for help."
10    **
11    ** 18395, "Configuration parameter, '%1!', will consume %2!K of memory if
12    **        configured at %3!.
13    **
14    ** 18396, "Configuration parameter, '%1!', can be configured to %2! to
15    **        fit in %3! of memory.
16    **
17    ** 18397, "Changing the value of '%1!' does not increase the amount of memory
18    **        SQL Server uses.
19    **
20    ** 18401, "Configuration parameter, 'max memory', will need to be set to 
21    **        %1! (%2!K) in order for 'total data cache size' to have a value of 
22    **        %3!K.
23    **
24    ** 18403, "Configuration parameter, 'max memory', will need to be set to
25    **	  %1! (%2!K) in order for the procedure cache to have a value of %3!.
26    **
27    ** 18521, "Omni services must be enabled and loaded in order to perform
28    **	  memory calculations."
29    **
30    ** 18916, "Changing the value of '%1!' to '%2!' increases the amount of
31    ** 	  memory ASE uses by %3! K.
32    **
33    ** 18917, "Changing the value of '%1!' to '%2!' reduces the amount of
34    ** 	  memory ASE uses by %3! K. The reduced memory could be reused
35    **	  when this configure value changes, but will not be released
36    **	  until ASE restarts."
37    **
38    */
39    
40    /*
41    ** sp_helpconfig_usage
42    **
43    **	Generate help / usage info for sp_helpconfig.
44    {
45    */
46    create or replace procedure sp_helpconfig_usage
47    as
48        begin
49            declare @msg varchar(256)
50                , @cips_cfg varchar(80)
51                , @estimate_str varchar(20)
52                , @tabchar char(1)
53    
54            set @cips_cfg = "compression info pool size"
55                , @estimate_str = 'estimate'
56                , @tabchar = char(9)
57    
58            print "sp_helpconfig [ 'help' ] | [ '<config option name>' [, '<memory size>' | '%1! ...' ] ]"
59                , @estimate_str
60    
61            exec sp_getmessage 19541, @msg out
62            print @msg
63            print " "
64    
65            print "Generate help for a particular config option:"
66            print "  sp_helpconfig 'number of user connections'"
67            print " "
68    
69            print "Convert memory to-be-allocated for a config option to appropriate units:"
70            print "  sp_helpconfig 'number of open objects', '2m'"
71            print " "
72    
73            print "Estimate the memory required for a config option given a specific current configuration / work load:"
74            print "  sp_helpconfig '%1!', '%2!'", @cips_cfg, @estimate_str
75            print " "
76    
77            print "  '%1!' clause specifiction for %2!:", @estimate_str, @cips_cfg
78            print "    %1! USING <arg> = <value> [, <arg> = <value> ...]"
79                , @estimate_str
80            print ""
81    
82            print "    Arguments supported are:"
83    
84            print "%1!maxconcusers:%2!Max # of concurrent users accessing compressed tables."
85                , @tabchar, @tabchar
86            print "%1!%2!%3!Default: number of user connections + number of worker processes"
87                , @tabchar, @tabchar, @tabchar
88    
89    
90            print "%1!numcolumns:%2!Ave # of columns in a compressed table"
91                , @tabchar, @tabchar
92            print "%1!%2!%3!Default: 50, or average number of columns in compressed tables in the database. Range [1, 1024]"
93                , @tabchar, @tabchar, @tabchar
94    
95    
96            print "%1!numcompobjs:%2!Number of compressed objects accessed server-wide"
97                , @tabchar, @tabchar
98            print "%1!%2!%3!Default: number of open objects, or number of compressed tables in the database"
99                , @tabchar, @tabchar, @tabchar
100   
101   
102           print "%1!numtables:%2!Ave # of compressed tables referenced per statement"
103               , @tabchar, @tabchar
104           print "%1!%2!%3!Default: 2"
105               , @tabchar, @tabchar, @tabchar
106   
107   
108           print "%1!numcompindexes:%2!Number of compressed index accessed server-wide"
109               , @tabchar, @tabchar
110           print "%1!%2!%3!Default: number of open indexes"
111               , @tabchar, @tabchar, @tabchar
112   
113   
114           print "%1!numindexkeys:%2!Ave # of keys from each compressed index rows. Range [1, 32]"
115               , @tabchar, @tabchar
116           print "%1!%2!%3!Default: 16"
117               , @tabchar, @tabchar, @tabchar
118   
119           print " "
120   
121           print "    For arguments 'maxconcusers', 'numcompobjs', 'numcompindexes', use 0 < value < 1 to choose a percentage of the default value."
122   
123           exec sp_getmessage 19541, @msg out
124           print "    %1!", @msg
125   
126           print " "
127           print "    - Estimate the memory required to access all the compressed objects in database '%1!'"
128               , "compdb"
129   
130           print " "
131           print "%1!compdb..sp_helpconfig '%2!', 'estimate'"
132               , @tabchar, @cips_cfg
133   
134           print " "
135           print "    - Estimate the memory required to access compressed objects server-wide, overriding defaults"
136           print " "
137           print "%1!sp_helpconfig '%2!', 'estimate USING maxconcusers=0.8, numcompobjs = 0.2'"
138               , @tabchar, @cips_cfg
139           print " "
140   
141           print "%1!sp_helpconfig '%2!', 'estimate USING maxconcusers=1000, numcolumns=25, numcompobjs = 20000'"
142               , @tabchar, @cips_cfg
143   
144           print " "
145           print "Generate help / usage information:"
146           print "  sp_helpconfig [help]"
147           print " "
148       end -- }
149   


exec sp_procxmode 'sp_helpconfig_usage', 'AnyMode'
go

Grant Execute on sp_helpconfig_usage to public
go
DEFECTS
 MEST 4 Empty String will be replaced by Single Space 80
 MGTP 3 Grant to public sybsystemprocs..sp_helpconfig_usage  
 MNER 3 No Error Check should check return value of exec 61
 MNER 3 No Error Check should check return value of exec 123
 MUCO 3 Useless Code Useless Begin-End Pair 48
 MTR1 2 Metrics: Comments Ratio Comments: 29% 46
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 2 = 1dec - 1exi + 2 46
 MTR3 2 Metrics: Query Complexity Complexity: 50 46

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_getmessage  
   reads table master..syslanguages (1)  
   reads table sybsystemprocs..sysusermessages  
   calls proc sybsystemprocs..sp_validlang  
      reads table master..syslanguages (1)  
   reads table master..sysmessages (1)  

CALLERS
called by proc sybsystemprocs..sp_helpconfig  
   called by proc sybsystemprocs..sp_helpconfig_gen_estimates_cpi  
      called by proc sybsystemprocs..sp_helpconfig_est_compinfo_poolsize