home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / databases / sybase-faq / part6 < prev    next >
Encoding:
Internet Message Format  |  2004-04-21  |  59.8 KB

  1. Path: senator-bedfellow.mit.edu!dreaderd!not-for-mail
  2. Message-ID: <databases/sybase-faq/part6_1082468590@rtfm.mit.edu>
  3. Supersedes: <databases/sybase-faq/part6_1074677126@rtfm.mit.edu>
  4. Expires: 2 Aug 2004 13:43:10 GMT
  5. References: <databases/sybase-faq/part1_1082468590@rtfm.mit.edu>
  6. X-Last-Updated: 2003/03/02
  7. From: dowen@midsomer.org (David Owen)
  8. Newsgroups: comp.databases.sybase,comp.answers,news.answers
  9. Subject: Sybase FAQ: 6/19 - ASE Admin (3 of 7)
  10. Reply-To: dowen@midsomer.org (David Owen)
  11. Followup-To: comp.databases.sybase
  12. Distribution: world
  13. Organization: Midsomer Consultants Inc.
  14. Approved: news-answers-request@MIT.EDU
  15. Keywords: FAQ, DATABASES, SYBASE, ASA, ASE, REP
  16. Originator: faqserv@penguin-lust.MIT.EDU
  17. Date: 20 Apr 2004 13:45:05 GMT
  18. Lines: 1324
  19. NNTP-Posting-Host: penguin-lust.mit.edu
  20. X-Trace: 1082468705 senator-bedfellow.mit.edu 564 18.181.0.29
  21. Xref: senator-bedfellow.mit.edu comp.databases.sybase:106204 comp.answers:56950 news.answers:270290
  22.  
  23. Archive-name: databases/sybase-faq/part6
  24. URL: http://www.isug.com/Sybase_FAQ
  25. Version: 1.7
  26. Maintainer: David Owen
  27. Last-modified: 2003/03/02
  28. Posting-Frequency: posted every 3rd month
  29.    A how-to-find-the-FAQ article is posted on the intervening months.
  30.  
  31.                           Advanced ASE Administration                          
  32.                                                                                
  33.  
  34.  
  35.     1.3.1   How do I clear a log suspend'd connection?
  36.     1.3.2   What's the best value for cschedspins?
  37.     1.3.3   What traceflags are available?
  38.     1.3.4   How do I use traceflags 5101 and 5102?
  39.     1.3.5   What is cmaxpktsz good for?
  40.     1.3.6   What do all the parameters of a buildmaster -d<device> -yall mean?
  41.     1.3.7   What is CIS and how do I use it?
  42.     1.3.8   If the master device is full how do I make the master database
  43.     bigger?
  44.     1.3.9   How do I run multiple versions of Sybase on the same server?
  45.     1.3.10  How do I capture a process's SQL?
  46.    
  47.  
  48.  
  49. General Troubleshooting User Database Administration ASE FAQ
  50.  
  51. -------------------------------------------------------------------------------
  52.  
  53. 1.3.1 How to clear a log suspend
  54.  
  55. -------------------------------------------------------------------------------
  56.  
  57. A connection that is in a log suspend state is there because the transaction
  58. that it was performing couldn't be logged. The reason it couldn't be logged is
  59. because the database transaction log is full. Typically, the connection that
  60. caused the log to fill is the one suspended. We'll get to that later.
  61.  
  62. In order to clear the problem you must dump the transaction log. This can be
  63. done as follows:
  64.  
  65.     dump tran db_name to data_device
  66.     go
  67.  
  68. At this point, any completed transactions will be flushed out to disk. If you
  69. don't care about the recoverability of the database, you can issue the
  70. following command:
  71.  
  72.     dump tran db_name with truncate_only
  73.  
  74. If that doesn't work, you can use the with no_log option instead of the with
  75. truncate_only.
  76.  
  77. After successfully clearing the log the suspended connection(s) will resume.
  78.  
  79. Unfortunately, as mentioned above, there is the situation where the connection
  80. that is suspended is the culprit that filled the log. Remember that dumping the
  81. log only clears out completed transaction. If the connection filled the log
  82. with one large transaction, then dumping the log isn't going to clear the
  83. suspension.
  84.  
  85. System 10
  86.  
  87. What you need to do is issue an ASE kill command on the connection and then
  88. un-suspend it:
  89.  
  90.     select lct_admin("unsuspend", db_id("db_name"))
  91.  
  92. System 11
  93.  
  94. See Sybase Technical News Volume 6, Number 2
  95.  
  96. Retaining Pre-System 10 Behaviour
  97.  
  98. By setting a database's abort xact on log full option, pre-System 10 behaviour
  99. can be retained. That is, if a connection cannot log its transaction to the log
  100. file, it is aborted by ASE rather than suspended.
  101.  
  102. Return to top
  103.  
  104. -------------------------------------------------------------------------------
  105.  
  106. 1.3.2 What's the best value for cschedspins?
  107.  
  108. -------------------------------------------------------------------------------
  109.  
  110. It is crucial to understand that cschedspins is a tunable parameter
  111. (recommended values being between 1-2000) and the optimum value is completely
  112. dependent on the customer's environment. cschedspins is used by the scheduler
  113. only when it finds that there are no runnable tasks. If there are no runnable
  114. tasks, the scheduler has two options:
  115.  
  116.  1. Let the engine go to sleep (which is done by an OS call) for a specified
  117.     interval or until an event happens. This option assumes that tasks won't
  118.     become runnable because of tasks executing on other engines. This would
  119.     happen when the tasks are waiting for I/O more than any other resource such
  120.     as locks. Which means that we could free up the CPU resource (by going to
  121.     sleep) and let the system use it to expedite completion of system tasks
  122.     including I/O.
  123.  2. Go and look for a ready task again. This option assumes that a task would
  124.     become runnable in the near term and so incurring the extra cost of an OS
  125.     context switch through the OS sleep/wakeup mechanism is unacceptable. This
  126.     scenario assumes that tasks are waiting on resources such as locks, which
  127.     could free up because of tasks executing on other engines, more than they
  128.     wait for I/O.
  129.  
  130. cschedspins controls how many times we would choose option 2 before choosing
  131. option 1. Setting cschedspins low favours option 1 and setting it high favours
  132. option 2. Since an I/O intensive task mix fits in with option 1, setting
  133. cschedspins low may be more beneficial. Similarly since a CPU intensive job mix
  134. favours option 2, setting cschedspins high may be beneficial.
  135.  
  136. The consensus is that a single CPU server should have cschedspins set to 1.
  137. However, I strongly recommend that users carefully test values for cschedspins
  138. and monitor the results closely. I have seen more than one site that has shot
  139. themselves in the foot so to speak due to changing this parameter in production
  140. without a good understanding of their environment.
  141.  
  142. Return to top
  143.  
  144. -------------------------------------------------------------------------------
  145.  
  146. 1.3.3 Trace Flag Definitions
  147.  
  148. -------------------------------------------------------------------------------
  149.  
  150. To activate trace flags, add them to the RUN_* script. The following example is
  151. using the 1611 and 260 trace flags. Note that there is no space between the
  152. '-T' and the traceflag, despite what is written in some documentation.
  153.  
  154.     Use of these traceflags is not recommended by Sybase. Please use at your
  155.     own risk.
  156.    
  157. % cd ~sybase/install
  158. % cat RUN_BLAND
  159. #!/bin/sh
  160. #
  161. # SQL Server Information:
  162. #  name:                          BLAND
  163. #  master device:                 /usr/sybase/dbf/BLAND/master.dat
  164. #  master device size:            25600
  165. #  errorlog:                      /usr/sybase/install/errorlog_BLAND
  166. #  interfaces:                    /usr/sybase
  167. #
  168. /usr/sybase/dataserver -d/usr/sybase/dbf/BLAND/master.dat \
  169. -sBLAND -e/usr/sybase/install/errorlog_BLAND -i/usr/sybase \
  170. -T1611 -T260
  171. -------------------------------------------------------------------------------
  172.  
  173.                                                                                
  174.                                   Trace Flags                                  
  175. +-----------------------------------------------------------------------------+
  176. |      |                                                                      |
  177. |------+----------------------------------------------------------------------|
  178. | Flag |                             Description                              |
  179. |------+----------------------------------------------------------------------|
  180. | 108  | (Documented) To allow dynamic and host variables in create view      |
  181. |      | statements in ASE 12.5 and above.                                    |
  182. |------+----------------------------------------------------------------------|
  183. | 200  | Displays messages about the before image of the query-tree.          |
  184. |------+----------------------------------------------------------------------|
  185. | 201  | Displays messages about the after image of the query-tree.           |
  186. |------+----------------------------------------------------------------------|
  187. | 241  | Compress all query-trees whenever the SQL dataserver is started.     |
  188. |------+----------------------------------------------------------------------|
  189. |      | Reduce TDS (Tabular Data Stream) overhead in stored procedures. Turn |
  190. |      | off done-in-behaviour packets. Do not use this if your application   |
  191. |      | is a ct-lib based application; it'll break.                          |
  192. | 260  |                                                                      |
  193. |      | Why set this on? Glad you asked, typically with a db-lib application |
  194. |      | a packet is sent back to the client for each batch executed within a |
  195. |      | stored procedure. This can be taxing in a WAN/LAN environment.       |
  196. |------+----------------------------------------------------------------------|
  197. |      | Changes the hierarchy and casting of datatypes to pre-11.5.1         |
  198. |      | behaviour. There was an issue is some very rare cases where a wrong  |
  199. |      | result could occur, but that's been cleared up in 11.9.2 and above.  |
  200. |      |                                                                      |
  201. | 291  | The trace can be used at boot time or at the session level. Keep in  |
  202. |      | mind that it does not disqualify a table scan from occurring. What   |
  203. |      | it will do is result in fewer datatype mismatch situations and thus  |
  204. |      | the optimizer will be able to estimate the costs of SARGs and joins  |
  205. |      | on columns involved in a mismatch.                                   |
  206. |------+----------------------------------------------------------------------|
  207. | 299  | This trace flag instructs the dataserver to not recompile a child    |
  208. |      | stored procedure that inherits a temp table from a parent procedure. |
  209. |------+----------------------------------------------------------------------|
  210. | 302  | Print information about the optimizer's index selection.             |
  211. |------+----------------------------------------------------------------------|
  212. | 303  | Display OR strategy                                                  |
  213. |------+----------------------------------------------------------------------|
  214. |      | Revert special or optimizer strategy to that strategy used in        |
  215. | 304  | pre-System 11 (this traceflag resolved several bug issues in System  |
  216. |      | 11, most of these bugs are fixed in ASE 11.0.3.2)                    |
  217. |------+----------------------------------------------------------------------|
  218. | 310  | Print information about the optimizer's join selection.              |
  219. |------+----------------------------------------------------------------------|
  220. | 311  | Display the expected IO to satisfy a query. Like statistics IO       |
  221. |      | without actually executing.                                          |
  222. |------+----------------------------------------------------------------------|
  223. | 317  | Provide extra optimization information.                              |
  224. |------+----------------------------------------------------------------------|
  225. | 319  | Reformatting strategies.                                             |
  226. |------+----------------------------------------------------------------------|
  227. | 320  | Turn off the join order heuristic.                                   |
  228. |------+----------------------------------------------------------------------|
  229. | 324  | Turn off the like optimization for ad-hoc queries using              |
  230. |      | @local_variables.                                                    |
  231. |------+----------------------------------------------------------------------|
  232. |      | (Only valid in ASE versions prior to 11.9.2.)  Instructs the server  |
  233. |      | to use arithmetic averaging when calculating density instead of a    |
  234. | 326  | geometric weighted average when updating statistics.  Useful for     |
  235. |      | building better stats when an index has skew on the leading column.  |
  236. |      | Use only for updating the stats of a table/index with known skewed   |
  237. |      | data.                                                                |
  238. |------+----------------------------------------------------------------------|
  239. |      |                                                                      |
  240. |------+----------------------------------------------------------------------|
  241. | 602  | Prints out diagnostic information for deadlock prevention.           |
  242. |------+----------------------------------------------------------------------|
  243. | 603  | Prints out diagnostic information when avoiding deadlock.            |
  244. |------+----------------------------------------------------------------------|
  245. | 699  | Turn off transaction logging for the entire SQL dataserver.          |
  246. |------+----------------------------------------------------------------------|
  247. | 1204 | Send deadlock detection to the errorlog.                             |
  248. | *    |                                                                      |
  249. |------+----------------------------------------------------------------------|
  250. | 1205 | Stack trace on deadlock.                                             |
  251. |------+----------------------------------------------------------------------|
  252. | 1206 | Disable lock promotion.                                              |
  253. |------+----------------------------------------------------------------------|
  254. | 1603 | Use standard disk I/O (i.e. turn off asynchronous I/O).              |
  255. | *    |                                                                      |
  256. |------+----------------------------------------------------------------------|
  257. | 1605 | Start secondary engines by hand                                      |
  258. |------+----------------------------------------------------------------------|
  259. |      | Create a debug engine start file. This allows you to start up a      |
  260. |      | debug engine which can access the server's shared memory for running |
  261. |      | diagnostics. I'm not sure how useful this is in a production         |
  262. | 1606 | environment as the debugger often brings down the server. I'm not    |
  263. |      | sure if Sybase have ported the debug stuff to 10/11. Like most of    |
  264. |      | their debug tools it started off quite strongly but was never        |
  265. |      | developed.                                                           |
  266. |------+----------------------------------------------------------------------|
  267. |      | Startup only engine 0; use dbcc engine("online") to incrementally    |
  268. | 1608 | bring up additional engines until the maximum number of configured   |
  269. |      | engines.                                                             |
  270. |------+----------------------------------------------------------------------|
  271. | 1610 | Boot the SQL dataserver with TCP_NODELAY enabled.                    |
  272. | *    |                                                                      |
  273. |------+----------------------------------------------------------------------|
  274. | 1611 | If possible, pin shared memory -- check errorlog for success/        |
  275. | *    | failure.                                                             |
  276. |------+----------------------------------------------------------------------|
  277. | 1613 | Set affinity of the SQL dataserver engine's onto particular CPUs --  |
  278. |      | usually pins engine 0 to processor 0, engine 1 to processor 1...     |
  279. |------+----------------------------------------------------------------------|
  280. | 1615 | SGI only: turn on recoverability to filesystem devices.              |
  281. |------+----------------------------------------------------------------------|
  282. |      | Linux only: Revert to using cached filesystem I/O.  By default, ASE  |
  283. | 1625 | on Linux (11.9.2 and above) opens filesystem devices using O_SYNC,   |
  284. |      | unlike other Unix based releases, which means it is safe to use      |
  285. |      | filesystems devices for production systems.                          |
  286. |------+----------------------------------------------------------------------|
  287. | 2512 | Prevent dbcc from checking syslogs. Useful when you are constantly   |
  288. |      | getting spurious allocation errors.                                  |
  289. |------+----------------------------------------------------------------------|
  290. | 3300 | Display each log record that is being processed during recovery. You |
  291. |      | may wish to redirect stdout because it can be a lot of information.  |
  292. |------+----------------------------------------------------------------------|
  293. | 3500 | Disable checkpointing.                                               |
  294. |------+----------------------------------------------------------------------|
  295. | 3502 | Track checkpointing of databases in errorlog.                        |
  296. |------+----------------------------------------------------------------------|
  297. | 3601 | Stack trace when error raised.                                       |
  298. |------+----------------------------------------------------------------------|
  299. | 3604 | Send dbcc output to screen.                                          |
  300. |------+----------------------------------------------------------------------|
  301. | 3605 | Send dbcc output to errorlog.                                        |
  302. |------+----------------------------------------------------------------------|
  303. | 3607 | Do not recover any database, clear behaviour start up checkpoint     |
  304. |      | process.                                                             |
  305. |------+----------------------------------------------------------------------|
  306. | 3608 | Recover master only. Do not clear tempdb or start up checkpoint      |
  307. |      | process.                                                             |
  308. |------+----------------------------------------------------------------------|
  309. | 3609 | Recover all databases. Do not clear tempdb or start up checkpoint    |
  310. |      | process.                                                             |
  311. |------+----------------------------------------------------------------------|
  312. | 3610 | Pre-System 10 behaviour: divide by zero to result in NULL instead of |
  313. |      | error - also see Q6.2.5.                                             |
  314. |------+----------------------------------------------------------------------|
  315. | 3620 | Do not kill infected processes.                                      |
  316. |------+----------------------------------------------------------------------|
  317. | 4001 | Very verbose logging of each login attempt to the errorlog. Includes |
  318. |      | tons of information.                                                 |
  319. |------+----------------------------------------------------------------------|
  320. | 4012 | Don't spawn chkptproc.                                               |
  321. |------+----------------------------------------------------------------------|
  322. | 4013 | Place a record in the errorlog for each login to the dataserver.     |
  323. |------+----------------------------------------------------------------------|
  324. | 4020 | Boot without recover.                                                |
  325. |------+----------------------------------------------------------------------|
  326. |      | Forces all I/O requests to go through engine 0. This removes the     |
  327. | 5101 | contention between processors but could create a bottleneck if       |
  328. |      | engine 0 becomes busy with non-I/O tasks. For more information...    |
  329. |      | 5101/5102.                                                           |
  330. |------+----------------------------------------------------------------------|
  331. | 5102 | Prevents engine 0 from running any non-affinitied tasks. For more    |
  332. |      | information...5101/5102.                                             |
  333. |------+----------------------------------------------------------------------|
  334. | 7103 | Disable table lock promotion for text columns.                       |
  335. |------+----------------------------------------------------------------------|
  336. | 8203 | Display statement and transaction locks on a deadlock error.         |
  337. |------+----------------------------------------------------------------------|
  338. | *    | Starting with System 11 these are sp_configure'able                  |
  339. +-----------------------------------------------------------------------------+
  340.  
  341. Return to top
  342.  
  343. -------------------------------------------------------------------------------
  344.  
  345. 1.3.4 Trace Flags -- 5101 and 5102
  346.  
  347. -------------------------------------------------------------------------------
  348.  
  349. 5101
  350.  
  351. Normally, each engine issues and checks for its own Disk I/O on behalf of the
  352. tasks it runs. In completely symmetric operating systems, this behavior
  353. provides maximum I/O throughput for ASE. Some operating systems are not
  354. completely symmetric in their Disk I/O routines. For these environments, the
  355. server can be booted with the 5101 trace flag. While tasks still request disk I
  356. /O from any engine, the actual request to/from the OS is performed by engine 0.
  357. The performance benefit comes from the reduced or eliminated contention on the
  358. locking mechanism inside the OS kernel. To enable I/O affinity to engine 0,
  359. start ASE with the 5101 Trace Flag.
  360.  
  361. Your errorlog will indicate the use of this option with the message:
  362.  
  363.         Disk I/O affinitied to engine: 0
  364.  
  365. This trace flag only provides performance gains for servers with 3 or more
  366. dataserver engines configured and being significantly utilized.
  367.  
  368. Use of this trace flag with fully symmetric operating systems will degrade
  369. performance!
  370.  
  371. 5102
  372.  
  373. The 5102 trace flag prevents engine 0 from running any non-affinitied tasks.
  374. Normally, this forces engine 0 to perform Network I/O only. Applications with
  375. heavy result set requirements (either large results or many connections issuing
  376. short, fast requests) may benefit. This effectively eliminates the normal
  377. latency for engine 0 to complete running its user thread before it issues the
  378. network I/O to the underlying network transport driver. If used in conjunction
  379. with the 5101 trace flag, engine 0 would perform all Disk I/O and Network I/O.
  380. For environments with heavy disk and network I/O, engine 0 could easily
  381. saturate when only the 5101 flag is in use. This flag allows engine 0 to
  382. concentrate on I/O by not allowing it to run user tasks. To force task affinity
  383. off engine 0, start ASE with the 5102 Trace Flag.
  384.  
  385. Your errorlog will indicate the use of this option with the message:
  386.  
  387.         I/O only enabled for engine: 0
  388. -------------------------------------------------------------------------------
  389.  
  390. Warning: Not supported by Sybase. Provided here for your enjoyment.
  391.  
  392. Return to top
  393.  
  394. -------------------------------------------------------------------------------
  395.  
  396. 1.3.5 What is cmaxpktsz good for?
  397.  
  398. -------------------------------------------------------------------------------
  399.  
  400. cmaxpktsz corresponds to the parameter "maximum network packet size" which you
  401. can see through sp_configure. I recommend only updating this value through
  402. sp_configure. If some of your applications send or receive large amounts of
  403. data across the network, these applications can achieve significant performance
  404. improvement by using larger packet sizes. Two examples are large bulk copy
  405. operations and applications reading or writing large text or image values.
  406. Generally, you want to keep the value of default network packet size small for
  407. users performing short queries, and allow users who send or receive large
  408. volumes of data to request larger packet sizes by setting the maximum network
  409. packet size configuration variable.
  410.  
  411. caddnetmem corresponds to the parameter "additional netmem" which you can see
  412. through sp_configure. Again, I recommend only updating this value through
  413. sp_configure. "additional netmem" sets the maximum size of additional memory
  414. that can be used for network packets that are larger than ASE's default packet
  415. size. The default value for additional netmem is 0, which means that no extra
  416. space has been allocated for large packets. See the discussion below, under
  417. maximum network packet size, for information on setting this configuration
  418. variable. Memory allocated with additional netmem is added to the memory
  419. allocated by memory. It does not affect other ASE memory uses.
  420.  
  421. ASE guarantees that every user connection will be able to log in at the default
  422. packet size. If you increase maximum network packet size and additional netmem
  423. remains set to 0, clients cannot use packet sizes that are larger than the
  424. default size: all allocated network memory will be reserved for users at the
  425. default size. In this situation, users who request a large packet size when
  426. they log in receive a warning message telling them that their application will
  427. use the default size. To determine the value for additional netmem if your
  428. applications use larger packet sizes:
  429.  
  430.   * Estimate the number of simultaneous users who will request the large packet
  431.     sizes, and the sizes their applications will request.
  432.   * Multiply this sum by three, since each connection needs three buffers.
  433.   * Add 2% for overhead, rounded up to the next multiple of 512
  434.  
  435. Return to top
  436.  
  437. -------------------------------------------------------------------------------
  438.  
  439. 1.3.6 Buildmaster Configuration Definitions
  440.  
  441. -------------------------------------------------------------------------------
  442.  
  443.    
  444.     Attention! Please notice, be very careful with these parameters. Use only
  445.     at your own risk. Be sure to have a copy of the original parameters. Be
  446.     sure to have a dump of all dbs (include master) handy.
  447.    
  448.     Since the release of 11.x (and above), there is almost no need for 
  449.     buildmaster to configure parameters.  In fact, buildmaster has gone been
  450.     removed from ASE 12.5. This section is really kept for anyone out there
  451.     running old versions of ASE. I still see the odd post from people asking
  452.     about 4.9.2, so this is for you.
  453.    
  454.     Anyone else who feels a need to use buildmaster should check sp_configure
  455.     and/or SERVERNAME.cfg to see if the configuration parameter is there before
  456.     using buildmaster.
  457.    
  458.     YOU HAVE BEEN WARNED. See the  .
  459.    
  460. -------------------------------------------------------------------------------
  461.  
  462. The following is a list of configuration parameters and their effect on the
  463. ASE. Changes to these parameters can affect performance of the server. Sybase
  464. does not recommend modifying these parameters without first discussing the
  465. change with Sybase Tech Support. This list is provided for information only.
  466.  
  467. These are categorized into two kinds:
  468.  
  469.   * Configurable through sp_configure and
  470.   * not configurable but can be changed through 'buildmaster -y<variable>=value
  471.     -d<dbdevice>'
  472.  
  473. Configurable variables:
  474.  
  475. crecinterval:
  476.  
  477. The recovery interval specified in minutes.
  478.  
  479. ccatalogupdates:
  480.  
  481. A flag to inform whether system catalogs can be updated or not.
  482.  
  483. cusrconnections:
  484.  
  485.                 This is the number of user connections allowed in SQL
  486.                 Server.  This value + 3 (one for checkpoint, network
  487.                 and mirror handlers) make the number of pss configured
  488.                 in the server.
  489. -------------------------------------------------------------------------------
  490.  
  491. cfgpss:
  492.  
  493.                 Number of PSS configured in the server. This value will
  494.                 always be 3 more than cusrconnections. The reason is we
  495.                 need PSS for checkpoint, network and mirror handlers.
  496.  
  497.                 THIS IS NOT CONFIGURABLE.
  498. -------------------------------------------------------------------------------
  499.  
  500. cmemsize:
  501.  
  502.                 The total memory configured for the Server in 2k
  503.                 units.  This is the memory the server will use for both
  504.                 Server and Kernel Structures.  For Stratus or any 4k
  505.                 pagesize implementation of ASE, certain values
  506.                 will change as appropriate.
  507.  
  508. cdbnum:
  509.  
  510.                 This is the number of databases that can be open in SQL
  511.                 Server at any given time.
  512.  
  513. clocknum:
  514.  
  515.                 Variable that defines and controls the number of logical
  516.                 locks configured in the system.
  517.  
  518. cdesnum:
  519.  
  520.                 This is the number of open objects that can be open at
  521.                 a given point of time.
  522.  
  523. cpcacheprcnt:
  524.  
  525.                 This is the percentage of cache that should be used
  526.                 for procedures to be cached in.
  527.  
  528. cfillfactor:
  529.  
  530. Fill factor for indexes.
  531.  
  532. ctimeslice:
  533.  
  534.                 This value is in units of milli-seconds. This value determines
  535.                 how much time a task is allowed to run before it yields.
  536.                 This value is internally converted to ticks. See below
  537.                 the explanations for cclkrate, ctimemax etc.
  538.  
  539. ccrdatabasesize:
  540.  
  541.                 The default size of the database when it is created.
  542.                 This value is Megabytes and the default is 2Meg.
  543.  
  544. ctappreten:
  545.  
  546. An outdated not used variable.
  547.  
  548. crecoveryflags:
  549.  
  550.                 A toggle flag which will display certain recovery information
  551.                 during database recoveries.
  552.  
  553. cserialno:
  554.  
  555.                 An informational variable that stores the serial number
  556.                 of the product.
  557.  
  558. cnestedtriggers:
  559.  
  560. Flag that controls whether nested triggers allowed or not.
  561.  
  562. cnvdisks:
  563.  
  564.                 Variable that controls the number of device structures
  565.                 that are allocated which affects the number of devices
  566.                 that can be opened during server boot up. If user
  567.                 defined 20 devices and this value is configured to be
  568.                 10, during recovery only 10 devices will be opened and
  569.                 the rest will get errors.
  570. cfgsitebuf:
  571.                 This variable controls maximum number of site handler
  572.                 structures that will be allocated. This in turn
  573.                 controls the number of site handlers that can be
  574.                 active at a given instance.
  575. cfgrembufs:
  576.                 This variable controls the number of remote buffers
  577.                 that needs to send and receive from remote sites.
  578.                 Actually this value should be set to number of
  579.                 logical connections configured. (See  below)
  580. cfglogconn:
  581.                 This is the number of logical connections that can
  582.                 be open at any instance. This value controls
  583.                 the number of resource structure allocated and
  584.                 hence it will affect the overall logical connection
  585.                 combined with different sites. THIS IS NOT PER SITE.
  586.  
  587. cfgdatabuf:
  588.  
  589.                 Maximum number of pre-read packets per logical connections.
  590.                 If logical connection is set to 10, and cfgdatabuf is set
  591.                 to 3 then the number of resources allocated will be
  592.                 30.
  593.  
  594. cfupgradeversion:
  595.  
  596. Version number of last upgrade program ran on this server.
  597.  
  598. csortord:
  599.  
  600. Sort order of ASE.
  601.  
  602. cold_sortdord:
  603.  
  604.                 When sort orders are changed the old sort order is
  605.                 saved in this variable to be used during recovery
  606.                 of the database after the Server is rebooted with
  607.                 the sort order change.
  608.  
  609. ccharset:
  610.  
  611. Character Set used by ASE
  612.  
  613. cold_charset:
  614.  
  615.                 Same as cold_sortord except it stores the previous
  616.                 Character Set.
  617. -------------------------------------------------------------------------------
  618.  
  619. cdflt_sortord:
  620.  
  621.                 page # of sort order image definition. This should
  622.                 not be changed at any point. This is a server only
  623.                 variable.
  624.  
  625. cdflt_charset:
  626.  
  627.                 page # of character set image definition. This should
  628.                 not be changed at any point. This is a server only
  629.                 variable.
  630.  
  631. cold_dflt_sortord:
  632.  
  633.                 page # of previous sort order image definition. This
  634.                 should not be changed at any point. This is a server
  635.                 only variable.
  636.  
  637. cold_dflt_charset:
  638.  
  639.                 page # of previous chracter set image definition. This
  640.                 should not be changed at any point.  This is a server
  641.                 only variable.
  642. -------------------------------------------------------------------------------
  643.  
  644. cdeflang:
  645.  
  646. Default language used by ASE.
  647.  
  648. cmaxonline:
  649.  
  650.         Maximum number of engines that can be made online. This
  651.         number should not be more than the # of cpus available on this
  652.         system. On Single CPU system like RS6000 this value is always
  653.         1.
  654.  
  655. cminonline:
  656.  
  657.         Minimum number of engines that should be online. This is 1 by
  658.         default.
  659.  
  660. cengadjinterval:
  661.  
  662. A noop variable at this time.
  663.  
  664. cfgstacksz:
  665.  
  666.         Stack size per task configured. This doesn't include the guard
  667.         area of the stack space. The guard area can be altered through
  668.         cguardsz.
  669. -------------------------------------------------------------------------------
  670.  
  671. cguardsz:
  672.  
  673.         This is the size of the guard area. ASE will
  674.         allocate stack space for each task by adding cfgstacksz
  675.         (configurable through sp_configure) and cguardsz (default is
  676.         2K).  This has to be a multiple of PAGESIZE which will be 2k
  677.         or 4k depending on the implementation.
  678.  
  679. behaviour:
  680.  
  681.         Size of fixed stack space allocated per task including the
  682.         guard area.
  683. -------------------------------------------------------------------------------
  684.  
  685. Non-configurable values :
  686.  
  687. -------------------------------------------------------------------------------
  688.  
  689. TIMESLICE, CTIMEMAX ETC:
  690.  
  691. -------------------------------------------------------------------------------
  692.  
  693. 1 millisecond = 1/1000th of a second.
  694. 1 microsecond = 1/1000000th of a second. "Tick" : Interval between two clock
  695. interrupts occur in real time.
  696.  
  697. "cclkrate" :
  698.  
  699.         A value specified in microsecond units.
  700.         Normally on systems where a fine grained timer is not available
  701.         or if the Operating System cannot set sub-second alarms, this
  702.         value is set to 1000000 milliseconds which is 1 second. In
  703.         other words an alarm will go off every 1 second or you will
  704.         get 1 tick per second.
  705.  
  706.         On Sun4 this is set to 100000 milliseconds which will result in
  707.         an interrupt going at 1/10th of a second. You will get 6 ticks
  708.         per second.
  709.  
  710. "avetimeslice" :
  711.  
  712.         A value specified in millisecond units.
  713.         This is the value given in "sp_configure",<timeslice value>.
  714.         Otherwise the milliseconds are converted to milliseconds and
  715.         finally  to tick values.
  716.  
  717.                 ticks = <avetimeslice> * 1000 / cclkrate.
  718.  
  719. "timeslice" :
  720.  
  721. -------------------------------------------------------------------------------
  722.         The unit of this variable is in ticks.
  723.         This value is derived from "avetimeslice". If "avetimeslice"
  724.         is less than 1000 milliseconds then timeslice is set to 1 tick.
  725.  
  726. "ctimemax" :
  727.  
  728. The unit of this variable is in ticks.
  729.  
  730.         A task is considered in infinite loop if the consumed ticks
  731.         for a particular task is greater than ctimemax value. This
  732.         is when you get timeslice -201 or -1501 errors.
  733.  
  734. "cschedspins" :
  735.  
  736. For more information see Q1.3.2.
  737.  
  738.         This value alters the behavior of ASE scheduler.
  739.         The scheduler will either run a qualified task or look
  740.         for I/O completion or sleep for a while before it can
  741.         do anything useful.
  742.  
  743.         The cschedspins value determines how often the scheduler
  744.         will sleep and not how long it will sleep. A low value
  745.         will be suited for a I/O bound ASE but a
  746.         high value will be suited for CPU bound ASE. Since
  747.         ASE will be used in a mixed mode, this value
  748.         need to be fined tuned.
  749.  
  750.         Based on practical behavior in the field, a single engine
  751.         ASE should have cschedspins set to 1 and a multi-engine
  752.         server should have set to 2000.
  753.  
  754. Now that we've defined the units of these variables what happens when we change
  755. cclkrate ?
  756.  
  757. Assume we have a cclkrate=100000.
  758.  
  759. A clock interrupt will occur every (100000/1000000) 1/10th milliseconds.
  760. Assuming a task started with 1 tick which can go up to "ctimemax=1500" ticks
  761. can potentially take 1/10us * (1500 + 1) ticks which will be 150 milliseconds
  762. or approx. .15 milliseconds per task.
  763.  
  764. Now changing the cclkrate to 75000
  765.  
  766. A clock interrupt will occur every (75000/1000000) 1/7th milliseconds. Assuming
  767. a task started with 1 tick which can go up to ctimemax=1500 ticks can
  768. potentially take 1/7us * (1500 + 1) ticks which will be 112 milliseconds or
  769. approx. .11 milliseconds per task.
  770.  
  771. Decreasing the cclkrate value will decrease the time spent on each task. If the
  772. task could not voluntarily yield within the time, the scheduler will kill the
  773. task.
  774.  
  775. UNDER NO CIRCUMSTANCES the cclkrate value should be changed. The default
  776. ctimemax value should be set to 1500. This is an empirical value and this can
  777. be changed under special circumstances and strictly under the guidance of DSE.
  778.  
  779. -------------------------------------------------------------------------------
  780.  
  781. cfgdbname:
  782.  
  783.                 Name of the master device is saved here. This is 64
  784.                 bytes in length.
  785.  
  786. cfgpss:
  787.  
  788.                 This is a derived value from cusrconnections + 3.
  789.                 See cusrconnections above.
  790.  
  791. cfgxdes:
  792.  
  793.                 This value defines the number of transactions that
  794.                 can be done by a task at a given instance.
  795.                 Changing this value to be more than 32 will have no
  796.                 effect on the server.
  797. cfgsdes:
  798.                 This value defines the number of open tables per
  799.                 task. This will be typically for a query. This
  800.                 will be the number of tables specified in a query
  801.                 including subqueries.
  802.  
  803.                 Sybase Advises not to change this value. There
  804.                 will be significant change in the size of per user
  805.                 resource in ASE.
  806.  
  807. cfgbuf:
  808.  
  809.                 This is a derived variable based on the total
  810.                 memory configured and subtracting different resource
  811.                 sizes for Databases, Objects, Locks and other
  812.                 Kernel memories.
  813.  
  814. cfgdes:
  815.  
  816.         This is same as cdesnum. Other values will have no effect on it. 
  817.  
  818. cfgprocedure:
  819.  
  820.         This is a derived value. Based on cpcacheprcnt variable. 
  821.  
  822. cfglocks:
  823.  
  824.         This is same as clocknum. Other values will have no effect on it. 
  825.  
  826. cfgcprot:
  827.  
  828.         This is variable that defines the number of cache protectors per
  829.         task. This is used internally by ASE.
  830.  
  831.         Sybase advise not to modify this value as a default of 15 will
  832.         be more than sufficient.
  833.  
  834. cnproc:
  835.  
  836.         This is a derived value based on cusrconnections + <extra> for
  837.         Sybase internal tasks that are both visible and non-visible.
  838.  
  839. cnmemmap:
  840.  
  841.         This is an internal variable that will keep track of ASE
  842.         memory.
  843.  
  844.         Modifying this value will not have any effect.
  845.  
  846. cnmbox:
  847.  
  848.         Number of mail box structures that need to be allocated.
  849.         More used in VMS environment than UNIX environment.
  850.  
  851. cnmsg:
  852.  
  853.         Used in tandem with cnmbox.
  854.  
  855. cnmsgmax:
  856.  
  857.         Maximum number of messages that can be passed between mailboxes. 
  858.  
  859. cnblkio:
  860.  
  861.         Number of disk I/O request (async and direct) that can be
  862.         processed at a given instance. This is a global value for all
  863.         the engines and not per engine value.
  864.  
  865.         This value is directly depended on the number of I/O request
  866.         that can be processed by the Operating System. It varies
  867.         depending on the Operating System.
  868.  
  869. cnblkmax:
  870.  
  871.         Maximum number of I/O request that can be processed at any given
  872.         time.
  873.  
  874.         Normally cnblkio,cnblkmax and cnmaxaio_server should be the same.
  875.  
  876. cnmaxaio_engine:
  877.  
  878.         Maximum number of I/O request that can be processed by one engine.
  879.         Since engines are Operating System Process, if there is any limit
  880.         imposed by the Operating System on a per process basis then
  881.         this value should be set. Otherwise it is a noop.
  882.  
  883. cnmaxaio_server:
  884.  
  885.         This is the total number of I/O request ASE can do.
  886.         This value s directly depended on the number of I/O request
  887.         that can be processed by the Operating System. It varies
  888.         depending on the Operating System.
  889.  
  890. csiocnt:
  891.  
  892.         not used. 
  893.  
  894. cnbytio:
  895.  
  896.         Similar to disk I/O request, this is for network I/O request.
  897.         This includes disk/tape dumps also. This value is for
  898.         the whole ASE including other engines.
  899.  
  900. cnbytmax:
  901.  
  902.         Maximum number of network I/O request including disk/tape dumps. 
  903.  
  904. cnalarm:
  905.  
  906.         Maximum number of alarms including the alarms used by
  907.         the system. This is typically used when users do "waitfor delay"
  908.         commands.
  909.  
  910. cfgmastmirror:
  911.  
  912.         Mirror device name for the master device. 
  913.  
  914. cfgmastmirror_stat:
  915.  
  916.         Status of mirror devices for the master device  like  serial/dynamic
  917.         mirroring etc.
  918.  
  919. cindextrips:
  920.  
  921.         This value determines the ageing of a index buffer before it
  922.         is removed from the cache.
  923.  
  924. coamtrips:
  925.  
  926.         This value determines the aging of a OAM buffer before it
  927.         is removed from the cache.
  928.  
  929. cpreallocext:
  930.  
  931.         This value determines the number of extents that will be
  932.         allocated while doing BCP.
  933.  
  934. cbufwashsize:
  935.  
  936.         This value determines when to flush buffers in the cache
  937.         that are modified.
  938.  
  939. Return to top
  940.  
  941. -------------------------------------------------------------------------------
  942.  
  943. 1.3.7: What is CIS and how can I use it?
  944.  
  945. -------------------------------------------------------------------------------
  946.  
  947. CIS is the new name for Omni ASE.  The biggest difference is that CIS is
  948. included with Adaptive Server Enterprise as standard.  Actually, this is not
  949. completely accurate; the ability to connect to other ASEs and ASEs, including
  950. Microsoft's, is included as standard.  If you need to connect to DB2 or Oracle
  951. you have to obtain an additional licence.
  952.  
  953. So, what is it?
  954.  
  955. CIS is a means of connecting two servers together so that seamless cross-server
  956. joins can be executed.  It is not just restricted to selects, pretty much any
  957. operation that can be performed on a local table can also be performed on a
  958. remote table.  This includes dropping it, so be careful!
  959.  
  960. What servers can I connect to?
  961.  
  962.   * Sybase ASE
  963.   * Microsoft SQL Server
  964.   * IBM DB2
  965.   * Oracle
  966.  
  967. What are the catches?
  968.  
  969. Well, nothing truly comes for free.  CIS is not a means of providing true load
  970. sharing, although you will find nothing explicitly in the documentation to tell
  971. you this.   Obviously there is a performance hit which seems to affect cursors
  972. worst of all.   CIS itself is implemented using cursors and this may be part of
  973. the explanation.
  974.  
  975. OK, so how do I use it?
  976.  
  977. Easy!  Add the remote server using sp_addserver.  Make sure that you define it
  978. as type sql_server or ASEnterprise.  Create an "existing" table using the
  979. definition of the remote table.  Update statistics on this new "existing"
  980. table.  Then simply use it in joins exactly as if it were a local table.
  981.  
  982. Return to top
  983.  
  984. -------------------------------------------------------------------------------
  985.  
  986. 1.3.8: If the master device is full, how do I make the master database bigger?
  987.  
  988. -------------------------------------------------------------------------------
  989.  
  990. It is not possible to extend the master database across another device, so the
  991. following from Eric McGrane (recently of Sybase Product Support Engineering)
  992. should help.
  993.  
  994.   * dump the current master database
  995.   * Pre-12.5 users use buildmaster to create a new master device with a larger
  996.     size. ASE 12.5 users use dataserver to build the new, larger, master
  997.     database.
  998.   * start the server in single user mode using the new master device
  999.   * login to the server and execute the following tsql:
  1000.    
  1001.    
  1002.     select * from sysdevices
  1003.    
  1004.    
  1005.   * take note of the high value
  1006.   * load the dump of the master you had just taken
  1007.   * restart the server (as it will be shut down when master is done loading),
  1008.     again
  1009.     in single user mode so that you can update system tables
  1010.   * login to the server and update sysdevices setting high for master to the
  1011.     value
  1012.     that you noted previously
  1013.   * shut the server down and start it back up, but this time not in single user
  1014.     mode.
  1015.  
  1016. The end result of the above is that you will now have a larger master device
  1017. and you can alter your master database to be a larger size. For details about
  1018. starting the server in single user mode and how to use buildmaster (if you need
  1019. the details) please refer to the documentation.
  1020.  
  1021. Return to top
  1022.  
  1023. -------------------------------------------------------------------------------
  1024.  
  1025. 1.3.9: How do I run multiple versions of Sybase on the same server?
  1026.  
  1027. -------------------------------------------------------------------------------
  1028.  
  1029. The answer to this relies somewhat on the platform that you are using.
  1030.  
  1031. Unix
  1032.  
  1033. ASE Versions Before 12.0
  1034.  
  1035. This applies to Unix and variants, Linux included. Install the various releases
  1036. of software into logical places within your filesystem. I like to store all
  1037. application software below a single directory for ease of maintenance, choose
  1038. something like /sw. I know that some are keen on /opt and others /usr/local. It
  1039. is all down to preference and server usage. If you have both Oracle and Sybase
  1040. on the same server you might want /sw/sybase or /opt/sybase. Be a little
  1041. careful here if your platform is Linux or FreeBSD. The standard installation
  1042. directories for Sybase on those platforms is /opt/sybase. Finally, have a
  1043. directory for the release, say ASE11_9_2 or simply 11.9.2 if you only ever have
  1044. Sybase ASE running on this server. A little imagination is called for!
  1045.  
  1046. So, now you have a directory such as /sw/sybase/ASE/11.9.2 (my preferred choice
  1047. :-), and some software installed under the directories, what now? In the most
  1048. minimal form, that is all you need. Non of the environment variables are
  1049. essential. You could quite successfully run
  1050.  
  1051.   /sw/sybase/ASE/11.9.2/bin/isql -Usa -SMYSERV -I/sw/sybase/ASE/11.9.2/interfaces
  1052.  
  1053. and get to the server, but that is a lot of typing. By setting the SYBASE
  1054. environment variable to /sw/sybase/ASE/11.9.2 you never need tell isql or other
  1055. apps where to find the interfaces. Then, you can set the path with a cool
  1056.  
  1057.   PATH=$SYBASE/bin:$PATH
  1058.  
  1059. to pick up the correct set of Sybase binaries. That reduces the previous mass
  1060. of typing to
  1061.  
  1062.   isql -Usa -SMYSERV
  1063.  
  1064. which is much more manageable.
  1065.  
  1066. You can create yourself a couple of shell scripts to do the changes for you. So
  1067. if the script a11.9 contained:
  1068.  
  1069.   SYBASE=/sw/sybase/ASE/11.9.2
  1070.   PATH=$SYBASE/bin:$SYBASE
  1071.  
  1072.   # Remember to export the variables!
  1073.   EXPORT PATH SYBASE
  1074.  
  1075. and a11.0 contained:
  1076.  
  1077.   SYBASE=/sw/sybase/ASE/11.0.3.3
  1078.   PATH=$SYBASE/bin:$SYBASE
  1079.  
  1080.   # Remember to export the variables!
  1081.   EXPORT PATH SYBASE
  1082.  
  1083. you would toggle between being connect to and 11.9.2 server and a 12.0 server,
  1084. depending upon which one you executed last. The scripts are not at all
  1085. sophisticated, you could quite easily have one script and pass a version string
  1086. into it. You will notice that the PATH variable gets longer each time the
  1087. script is executed. You could add greps to see if there was already a Sybase
  1088. instance on the path. Have I mentioned imagination?
  1089.  
  1090. ASE 12.0 and Beyond
  1091.  
  1092. Sybase dramatically changed the structure of the installation directory tree
  1093. with ASE 12. You still have a SYBASE environment variable pointing to the
  1094. route, but now the various packages fit below that directory. So, if we take /
  1095. sw/sybase as the root directory, we have the following (the following is for a
  1096. 12.5 installation, but all versions follow the same format):
  1097.  
  1098.   /sw/sybase/ASE-12_5
  1099.             /OCS-12_5
  1100.  
  1101. Below ASE-12_5 is most of the stuff that we have come to expect under $SYBASE,
  1102. the install, bin and scripts directories. This is also where the SERVER.cfg
  1103. file has moved to. (Note the the interfaces file is still in $SYBASE.) The bin
  1104. directory on this side includes the dataserver, diagserver and srvbuild
  1105. binaries.
  1106.  
  1107. The OCS-12_5 is the open client software directory. It means that Sybase can
  1108. update the client software without unduly affecting the server. isql, bcp and
  1109. other clients are to be found here.
  1110.  
  1111. It does take a little getting used to if you have been using the pre-12 style
  1112. for a number of years. However, in its defence, it is much more logical, even
  1113. if it about triples the length of your PATH variable!
  1114.  
  1115. That is another good part of the new installation. Sybase actually provides you
  1116. with the shell script to do all of this. There is a file in /sw/sybase called
  1117. SYBASE.sh (there is an equivalent C shell version in the same place) that sets
  1118. everything you need!
  1119.  
  1120. Interfaces File
  1121.  
  1122. The only real addition to all of the above is an easier way to manage the
  1123. interfaces file. As mentioned before, ASE based apps look for the interfaces
  1124. file in $SYBASE/interfaces by default. Unix is nice in that it allows you to
  1125. have symbolic links that make it appear as if a file is somewhere that it
  1126. isn't. Place the real interfaces file somewhere independent of the software
  1127. trees. /sw/sybase/ASE/interfaces might be a sound logical choice. Now, cd to
  1128. $SYBASE and issue
  1129.  
  1130.   ln -s /sw/sybase/ASE/interfaces
  1131.  
  1132. and the interfaces will appear to exist in the $SYBASE directory, but will in
  1133. fact remain in its own home.
  1134.  
  1135. Note: make sure that interfaces file is copied to its own home before removing
  1136. it from $SYBASE.
  1137.  
  1138. Now you can put symbolic links in each and every software installation and only
  1139. have to worry about maintaining the server list, on that server, in one place.
  1140. Having the interfaces file common to many physical servers is trickier, but not
  1141. impossible. Personally I would choose to put it in a central CVS repository and
  1142. use that to keep each server reasonably up-to-date.
  1143.  
  1144. NT/2000
  1145.  
  1146. Firstly, I have tried the following on W2K and it all works OK. I have read a
  1147. number of reports of people having difficulty getting clean installs under NT.
  1148. 11.5 and 12.0 mainly. I cannot remeber having a problem with either of those
  1149. myself, but I only ever installed it to test that stuff I write runs on all
  1150. platforms. I have no intention of upgrading to XP until MS pays me to do it. It
  1151. looks like a cheap plastic version of an operating system and I pity anyone
  1152. that is forced to use it.
  1153.  
  1154. NT is tougher than UNIX to run multiple instances on, mainly due to the fact
  1155. that it wants to do stuff for you in the background, namely configure
  1156. environment variables. The following worked for me with the following versions
  1157. of Sybase ASE all installed and running on a single server: 11.5.1, 11.9.2,
  1158. 12.5. I don't have a version of ASE 12.0 for NT. If I can persuade Sybase to
  1159. send them it to me, I might be able to get that running too. Notably, each and
  1160. every one of the databases runs as a service!!!
  1161.  
  1162.  1. Start by installing each software release into its own area. Make sure that
  1163.     it is a local disk. (See Q2.2.3.) I chose to install ASE 12.5 into C:\
  1164.     Sybase12_5 and ASE 11.9.2 into C:\Sybase11_9_2 etc. When it asks you about
  1165.     configuring the server, select "no" or "cancel".
  1166.  2. Add a user for each installation that you are going to run. Again, I added
  1167.     a user sybase12_5 for ASE 12.5 and sybase11_9_2 for ASE 11.9.2.
  1168.  3. As a system account, edit the environment variables (On W2K this is
  1169.     Settings->Control Panel->System->Advanced->Environment Variables...) and
  1170.     remove any reference to Sybase from the system path. Make sure that you
  1171.     store away what has been set. A text file on your C drive is a good idea at
  1172.     this stage.
  1173.  4. Similarly, remove references to Sybase from the Lib, Include and CLASSPATH
  1174.     variables, storing the strings away.
  1175.  5. Remove the SYBASE, DSEDIT and DSQUERY variable.
  1176.  6. As I said before, I do not own 12.0, so I cannot tell you what to do about
  1177.     the new Sybase variables SYBASE_OCS, SYBASE_ASE, SYBASE_FTS, SYBASE_JRE
  1178.     etc. I can only assume that you need to cut them out too. If you are
  1179.     installing pre-12 with only 1 of 12 or 12.5, then it is not necessary.
  1180.  7. Login as each new Sybase user in turn and add to each of these a set of
  1181.     local variables corresponding to path, Include, Lib and set them to be the
  1182.     appropriate parts from the strings you removed from the system versions
  1183.     above. So, if you installed ASE 12.5 in the method described, you will have
  1184.     a whole series of variables with settings containing "C:\Sybase_12_5", add
  1185.     all of these to local variables belonging to the user sybase12_5. Repeat
  1186.     for each instance of ASE installed. This is a tedious process and I don't
  1187.     know a way of speading it up. It may be possible to edit the registry, but
  1188.     I was not happy doing that.
  1189.  8. If you have made each of the Sybase users administrators, then you can
  1190.     configure the software from that account, and install a new ASE server.
  1191.     Remember that each one needs its own port. 11.5.1 and 11.9.2 did not give
  1192.     me an option to change the port during the install, so I had to do that
  1193.     afterwards by editing the SQL.INI for each server in its own installation
  1194.     tree.
  1195.  9. If you are not able to make each user and administrator, you will need to
  1196.     work with an admin to configure the software. (ASE requires administrative
  1197.     rights in order to be able to add the service entries.) You will need to
  1198.     log in as this admin account, set the path to the appropriate value for
  1199.     each installation, install the software and then set the path to the new
  1200.     values, install the next ASE etc. On NT for sure you will have to log out
  1201.     and log in after changing the path variable. 2000 may be less brain dead.
  1202.     Just be thankful you are not having to reboot!
  1203. 10. Log back in as your tame administrator account and go into the control
  1204.     panel. You need to start the "Services" applet. This is either there if you
  1205.     are running NT or you have to go into "Administrative Tools" for 2000.
  1206.     Scroll down and select the first of the services, which should be of the
  1207.     form
  1208.    
  1209.     "Sybase SQLServer _MYSERVER".
  1210.    
  1211.     Right click and select "Properties" (I think this is how it was for NT, but
  1212.     you want that services properties, however you get there.) In 2000 there is
  1213.     a "Log On" tab. NT has a button (I think) that serves the same purpose.
  1214.     Whether tab or button, click on it. You should have a panel that starts, at
  1215.     the top, with "Log on as" and a a pair of radio options. The top one will
  1216.     probably be selected, "Local System account". Choose the other and enter
  1217.     the details for the sybase account associated with this server. So if the
  1218.     server is ASE 12.5 enter "sybase12_5" for "This account" and enter the
  1219.     password associated with this account in the next two boxes. Select enough
  1220.     "OK"s to take you out of the service properties editor.
  1221. 11. None of the installations made a good job of the services part. All of them
  1222.     added services for all of the standard servers (data, backup, monitor and
  1223.     XP), even though I had not configured any but XP server. (The NT
  1224.     installation is of a different form to the UNIX/Linux versions.) The 12.5
  1225.     XP configuration was OK, but the pre-12 ones were not. You will have to go
  1226.     in and manually set the user to connect as (as described earlier). If you
  1227.     do not do this, the services will not start properly.
  1228. 12. You should then be able to start any or all of the services by pressing the
  1229.     "play" button.
  1230. 13. Finally, you need to re-edit the local copies of the path, Include and Lib
  1231.     variables for your tame admin account if you use that account to connect to
  1232.     Sybase.
  1233.  
  1234. It worked for me, as I said. I was able to run all 3 services simultaneously
  1235. and connect from the local and external machines. There is no trick as neat as
  1236. the symbolic link on Unix. Links under NT work differently.
  1237.  
  1238. Return to top
  1239.  
  1240. -------------------------------------------------------------------------------
  1241.  
  1242. 1.3.10: How do I capture a process's SQL?
  1243.  
  1244. -------------------------------------------------------------------------------
  1245.  
  1246. This is a bit of a wide question, and there are many answers to it. Primarily,
  1247. it depends on why you are trying to capture it. If you are trying to debug a
  1248. troublesome stored procedure that is behaving differently in production to how
  1249. it did in testing, then you might look at the DBCC method. Alternatively, if
  1250. you wanted to do some longer term profiling, then auditing or one of the third
  1251. party tools might be the way forward. If you know of methods that are not
  1252. included here, please let me know.
  1253.  
  1254. DBCCs
  1255.  
  1256. If you want to look at the SQL a particular process is running at the moment,
  1257. one of the following should work. Not sure which versions of ASE these work
  1258. with. Remember to issue dbcc traceon(3604) before running any of the dbcc's so
  1259. that you can see the output at your terminal.
  1260.  
  1261.   * dbcc sqltext(spid)
  1262.   * dbcc pss(0, spid, 0)
  1263.  
  1264. The first of the commands issues the SQL of the spid only a bit like this:
  1265.  
  1266. [27] BISCAY.master.1> dbcc sqltext(9)
  1267. [27] BISCAY.master.2> go
  1268. SQL Text: select spid,        status,        suser_name(suid),        hostname,
  1269. db_name(dbid),        cmd,        cpu,        physical_io,        memusage,
  1270. convert(char(5),blocked)   from master..sysprocesses
  1271. DBCC execution completed. If DBCC printed error messages, contact a user with
  1272. System Administrator (SA) role.
  1273. [28] BISCAY.master.1>
  1274.  
  1275. The second issues an awful lot of other stuff before printing the text at the
  1276. bottom. Mercifully, this means that you don't have to scroll up to search for
  1277. the SQL text, which is in much the same format as with dbcc sqltext.
  1278.  
  1279. There are a number of third party tools that will execute these commands from a
  1280. list of processes. One of the problems is that you do have to be 'sa' or have
  1281. 'sa_role' in order to run them.
  1282.  
  1283. Certainly the first, and possibly both, have one major drawback, and that is
  1284. that they are limited to displaying about 400 bytes worth of text, which can be
  1285. a bit annoying. However, if what you are trying to do is catch a piece of rogue
  1286. SQL that is causing a table scan or some other dastardly trick, a unique
  1287. comment in the early part of the query will lead to its easy identification.
  1288.  
  1289. Monitor Server
  1290.  
  1291. Since ASE 11.5, monitor server has had the capability for capturing a processes
  1292. SQL. See Q1.6.2 for how to configure a Monitor Server Client. When you are
  1293. done, you can get see the SQL text from a process using the "Process Current
  1294. SQL Statement" monitor. The output looks like this.
  1295.  
  1296. Auditing
  1297.  
  1298. The second way of wanting to do this is for a number of processes for a period
  1299. of time. There are several methods of doing this. Probably the most popular is
  1300. to use auditing, and it is almost certainly the most popular because it
  1301. requires no additional software purchases.
  1302.  
  1303. Auditing is a very powerful tool that can collect information on just about
  1304. everything that happens on the server. It can be configured to capture
  1305. 'cmdtext' for any or all users on a system. The data will be loaded into the
  1306. sysaudits database for later perusal. The SQL captured is not limited to a
  1307. number of bytes, like the previous examples, but if it is more than 255 bytes
  1308. long, then it will span several audit records, which must be put back together
  1309. to see the whole picture. To be honest, I am not sure what happens now that
  1310. varchars can be greater than 255 bytes in length. Personal experience with
  1311. auditing leaves to think that the load on the server is up to about 3%,
  1312. depending on the number of engines you have (the more engines, the more of a
  1313. load auditing is) and, obviously, the number of processes you wish to monitor.
  1314. I calculated 3% based on auditing all of 400 users, each of which had 2
  1315. connections to the server, on a server with 7 engines.
  1316.  
  1317. Ribo
  1318.  
  1319. Another option for capturing the SQL text is to use the free Ribo utility that
  1320. is provided with as part of ASE these days. This is a small server written in
  1321. Java as an example of what can be done using jConnect. This utility is nice in
  1322. that it does not place any load on the ASE server. However, it probably has an
  1323. effect on the client that is using it. This utility's other draw back is that
  1324. each client that you wish to monitor via Ribo must be directly configured to
  1325. use it. It is not possibly mid-session to just magically turn it on.
  1326.  
  1327. The way it works is to act as an intermediary between the ASE server and the
  1328. client wishing to connect. All is SQL is passed through and executed exactly as
  1329. if the client was directly connected, and the results passed back. What the
  1330. Ribo server does is enable you to save the inbound SQL to a file.
  1331.  
  1332. 3rd Party Tools
  1333.  
  1334. Again, there are a number of third party tools that do this job as well,
  1335. OpenSwitch being one of them. There are also a number of third party tools that
  1336. do a better job than this. They do not have any impact on the client or the
  1337. server. They work by sniffing the network for relevant packets and then put
  1338. them pack together. In actuality, they do a lot more than just generate the
  1339. SQL, but they are capable of that.
  1340.  
  1341. Return to top
  1342.  
  1343. -------------------------------------------------------------------------------
  1344.  
  1345. General Troubleshooting User Database Administration ASE FAQ
  1346.  
  1347.