DB2 common problem fool

  DB2 common fool 1000 issue of Q (5) 

  Members of the application of DB2 may encounter some seemingly simple question, especially the rookie, I would like to sum up the simple, issued to everyone that we can hope for help, we also welcome to explore, Common development and progress! 
  Following mainly based on the DB27.X. The following characters to lowercase. 

  In this paper, DB2 do not have to do is master of. 

  DB2 function 135. AVG () 
  Back to a group of numerical averages. 
  SELECTAVG (SALARY) FROMBSEMPMS; 

  136.CORR (), CORRELATION () 
  Back to the relationship between a numerical coefficient. 
  SELECTCORRELATION (SALARY, BONUS) FROMBSEMPMS; 

  137.COUNT () 
  Back to a group of firms or the number of values. 
  SELECTCOUNT (*) FROMBSEMPMS; 

  138.COVAR (), COVARIANCE () 
  To return to a value of covariance. 
  SELECTCOVAR (SALARY, BONUS) FROMBSEMPMS; 

  139.MAX () 
  Back to a group of maximum value. 
  SELECTMAX (SALARY) FROMBSEMPMS; 

  140.MIN () 
  Back to a group of values in the minimum. 
  SELECTMIN (SALARY) FROMBSEMPMS; 

  141.STDDEV () 
  A set of values to return to the standard deviation. 
  SELECTSTDDEV (SALARY) FROMBSEMPMS; 

  142.SUM () 
  Back to a group of data and. 
  SELECTSUM (SALARY) FROMBSEMPMS; 

  143.VAR (), VARIANCE () 
  A set of values to return to the variance. 
  SELECTVARIANCE (SALARY) FROMBSEMPMS; 

  144.ABS (), ABSVAL () 
  Back to the absolute value parameters. 
  SELECTABS (-3.4) FROMBSEMPMS; 

  145.ACOS () 
  Back to the parameters of the anti-cosine value. 
  SELECTACOS (0.9) FROMBSEMPMS; 

  146.ASCII () 
  Integer parameters to return to the far left of the characters of ASCII codes. 
  SELECTASCII ( 'R') FROMBSEMPMS; 

  147.ASIN () 
  Back to that point arc with the parameters of the function string anyway. 
  SELECTASIN (0.9) FROMBSEMPMS; 

  148.ATAN () 
  Anyway, back to cut the value of parameters, the parameters that point arc with the parameters. 
  SELECTATAN (0.9) FROMBSEMPMS; 

  best_dba published in the June 21, 2006 circle Comments (0) comments 

  DB2 common fool 1000 issue of Q (4) 

  100. How do I delete sequence » 
DROPSEQUENCESEQUENCE_NAME

  101.DB2 support Import (IMPORT) file format has » 
  A: DEL, ASC, IXF, WSF, etc. 

  102.DB2 support Export (EXPORT) file format has » 
  A: DEL, IXF, WSF, and so on. 
  Do not support the ASC format. 

  103.DB2 support the load (LOAD) file format has » 
  A: DEL, ASC, IXF, etc.. 
  Do not support the WSF format. 

  104.DB2 support the file format is DB2MOVE » 
  A: IXF, etc.. 
  Do not support the ASC, DEL, WSF format. 

  105.DB2 database monitoring of the two components of the » 
  Snapshot Monitoring (SNAPSHOTMONITOR) to be transferred back to a specific point in time snapshot of the database activities. 
  Monitoring events (EVENTMONITOR) recorded the incident data. 

  106. System Monitoring data element types » 
  Counter (COUNTER) recorded in the number of activities. 
  Measurement (GAUGE) or measuring the current value. 
  Waterline (WATERMARK) from the control elements to achieve the maximum or minimum values. 
  Information (INFORMATION) monitoring activities details of the type of reference. 
  Point in time (TIMESTAMP) activities in the period of time. 
  Time (TIME) to return to the time it takes for an event. 

  107. Know how to monitor the reactor for the number of page » 
  (NUMBEROFMONITORINGAPPLICATIONS +1) * (NUMBEROFDATABASES * (800 + (NUMBEROFTABLES 

  ACCESSED * 20) + ((NUMBEROFAPPLICATIONSCONNECTED +1) * (200 + (NUMBEROFTABLE 

  SPACES * 100 )))))/ 4096 
  The size of the parameters MON_HEAD_SZ control. 

  108. How to create a monitor events » 
  CREATEEVENTMONITORTABLEMONFORTABLESWRITETOFILE'D: \ TEMP ' 

  109. How to activate the incident Monitor » 
SETEVENTMONITORTABLEMONSTATE1

  110. How to stop the incident Monitor » 
SETEVENTMONITORTABLEMONSTATE0

  111. Enquiries monitor how the state » 
  SELECTEVMONNAME, EVENT_MON_STATE (EVMONNAME) FROMSYSCAT.EVENTMONITORS 

  112. How do I delete the incident Monitor » 
DROPEVENTMONITORTABLEMON

  WINDOWS 113.UNIX and create a pipeline incident Monitor (PIPE Italian EVNT see MONITOR) the different » 
  Step 1: definition of the incident monitor UNIX: 
CONNECTTOSAMPLE
  CREATEEVENTMONITORSTMB2FORSTATEMENTSWRITETOPIPE '/ TMP/EVPIPE1' 
WINDOWS:
CONNECTTOSAMPLE
  CREATEEVENTMONITORSTMB2FORSTATEMENTSWRITETOPIPE '\ \. \ TMP \ EVPIPE1' 

  The second step: the establishment named pipe UNIX: 
  Can use MKFIFO () function or MKFIFO order. 
WINDOWS:
  Can use CREATENAMEDPIPE () function, the name and CREATEEVENTMONITOR pipeline provides the same name. 

  Step 3: Open named pipe UNIX: 
  Use OPEN () function. 
WINDOWS:
  The use of CONNECTNAMEDPIPE () function. 
  DB2EVMON orders can also be used, such as: 
DB2EVMON-DBSAMPLE-EVMSTMB2

  Step 4: Activate named pipe event monitor automatically activated unless the named pipe event monitor, otherwise SETEVENTMONITORSTMB2STATE1 

  Step 5: read data from the named pipe UNIX: 
  Can use the READ () function. 
WINDOWS:
  Can use READFILE () function. 

  Step 6: stop the incident monitor SETEVENTMONITORSTMB2STATE0 

  Step 7: Close named pipe UNIX: 
  Can use CLOSE () function. 
WINDOWS:
  Can use DISCONNECTNAMEDPIPE () function. 

  Step 8: delete named pipe UNIX: 
  Can use UNLINK () function. 
WINDOWS:
  Can use CLOSEHANDLE () function. 

  114.DB2 the SQL statement of the categories » 
  DCL: data control language, to provide access to database objects. 
  DDL: data definition language, create, modify and delete database object. 
  DML: data manipulation language used to insert, update, delete data. [Page] 

  What are the competence of 115.DCL » 
  CONTROL AUTHORITY: If users to create an object, the user can complete access to the target. 
  GRANT statement will be granted access to users. 
  REVOKE statement revoke a user's permission. 

  What are the 116.DDL » 
CREATE
DECLARE
ALTER
DROP
  Etc. 
  What are the 117.DML » 
INSERT
SELECT
UPDATE
DELETE
  Such as 118. DB2 is not Boolean type » 
  No 119. DB2 query how the built-in functions » 
  Carrying documents ADMINISTION -> SQLREFERENCE -> FUNCTIONS, 

  120. DB2 how to implement the script file » 
DB2-VTFFILENAME

  ORACLE 121.DB2 as in the ROWNUM ()是» 
  ROW_NUMBER () OVER () 

  122.DB2 how to get the wrong code Note » 
  DB2? SQLCODE 

  123.DB2 in VARCHAR converted to a function for the INTEGER » 
  CAST () 

  124.DB2 in INTEGER converted to a function for the VARCHAR » 
  CHAR () 

  125.DB2 in VARCHAR converted to a function for DATE » 
  DATE () 

  126.DB2 in DATE converted to a function for the VARCHAR » 
  CHAR () 

  127.DB2 whether to amend the TRIGGER » 
  Not only delete the reconstruction of 128. WINDOWS know how the port of DB2 » 
  \ WINNT \ SYSTEM32 \ DRIVERS \ ETC \ SERVICES 

  129.DB2 how to implement storage process » 
  Can DB2CALLPROCEDURE_NAME 

  130. DB2 how to enter the DOS order » 
DB2CMD

  131. DB2 how to get the process of « 
DB2LISTAPPLICATIONS

  132. DB2 how to kill the process » 
  FORCEAPPLICATION (ID) 

  133.A users to install DB2, how user-initiated B DATABASE? 
  In the B users. PROFILE added. / HOME/DB2INST/SQLLIB/DB2PROFILE 

  134.DB2 similar ORACLE snapshot是» 

  best_dba published in the June 21, 2006 circle Comments (0) comments 

  DB2 common fool 1000 issue of Q (3) 

  Members of the application of DB2 may encounter some seemingly simple question, especially the rookie, I would like to sum up the simple, issued to everyone that we can hope for help, we also welcome to explore, Common development and progress! 

  Following mainly based on the DB27.X. The following characters to lowercase. 

  In this paper, DB2 do not have to do is master of. 

  For all lowercase characters. 

  91. DB2 how to create a summary table » 
  DB2 Summary Table ORACLE function similar to the entities of view! 
  Grammar: 
  CREATESUMMARYTABLETABLE_NAMEAS (FULLSELECT) … 
  For example: 
  Definition of an updated version of the summary table below: 
  CREATESUMMARYTABLETABLE_NAMEAS (SELECT * FROMTABLE_NAME1WHERECOL1 = AAA) 
DATAINITIALLYDEFERREDREFRESHDEFERRED
  DATAINITIALLYDEFERRED which data can not be provided as part of CREATETABLE statement inserted in the table. 
  REFRESHDEFERRED provided in the table data can be used at any time REFRESHTABLE statement was refreshing! 

  92. How refreshing summary tables » 
REFRESHTABLESUM_TABLE
  One SUM_TABLE for summary tables. 

  93. How to amend the Summary Table » 
  ALTERTABLESUM_TABLE … 

  94. How to create a temporary table » 
  Syntax: 
DECLAREGLOBALTEMPORARYTABLETABLE_NAME
  AS (FULLSELECT) DEFINITIONONLY 
EXCLUDINGIDENTITYCOLUMNATTRIBUTES
ONCOMMITDELETEROWS
NOTLOGGED
  The first line provides the name of a temporary table. 
  The second line out of the temporary table provides the definition. 
  The third line is not provided results from the source table definition of the identity copy out. 
  If there are no provisions of the fourth line to open WITHGOLD cursor, will delete all the lines of the table. 
  The fifth line provides no change in a recorded form. 
  For example: 
DECLAREGLOBALTEMPORARYTABLEDEC_BSEMPMS
  AS (SELECT * FROMBSEMPMS) DEFINITIONONLY 
EXCLUDINGIDENTITYCOLUMNATTRIBUTES
ONCOMMITDELETEROWS
NOTLOGGED

  95. View of management » 
  How to create a view: 
  CREATEVIEWVIEW_NAMEASSELECT * FROMTABLE_NAMEWHERE … 
  Delete view: 
DROPVIEWVIEW_NAME

  96. How do I know view the definition of content » 
  SELECT * FROMSYSCAT.VIEWS in the TEXT column. 

  97. How to create aliases » 
CREATEALIASALIAS_NAMEFORPRO_NAME
  Behind the PRO_NAME can be TABLE, VIEW, ALIAS, NICKNAME, and so on. 

  98. How to create a sequence » 
  For example: 
CREATESEQUENCESEQUENCE_NAME
STARTWITHSTART_NUMBER
INCREMENTBYVALUE1
NOMAXVALUE
NOCYCLE
CACHEMAXIMUMNUMBEROFSEQUENCEVALUES
  The first line provides the name of sequence. 
  The second line provides the beginning of numerical sequence. 
  Third line of the additional requirements of each rate. 
  The fourth line has not provided the largest numerical restrictions. 
  The fifth line provides the largest numerical restrictions. 
  99. How do I change the sequence » 
  ALTERSEQUENCESEQUENCE_NAME … 
  Can modify the parameters of the START_NUMBER STARTWITH 
  INCREMENT the VALUE1 
  Numerical NOCYCLE NOMAXVALUE the maximum number of attributes MAXIMUMNUMBEROFSEQUENCEVALUES 

  best_dba published in the June 21, 2006 circle Comments (0) comments 

  DB2 common fool 1000 issue of Q (2) 

  Members of the application of DB2 may encounter some seemingly simple question, especially the rookie, I would like to sum up the simple, issued to everyone that we can hope for help, we also welcome to explore, Common development and progress! 
  Following mainly based on the DB27.X. The following characters to lowercase. 

  In this paper, DB2 do not have to do is master of. 
  For all lowercase characters. 

  51. Examples of the default installation of DB2 name is « 
  In WINDOWS or OS / 2 is in default DB2 
  In LINUX or UNIX environment is the default DB2INST1 

  52. After the installation of the default account is » 
  In WINDOWS or OS / 2 in the default is DB2ADMIN 
  In LINUX or UNIX environment is the default DB2AS 

  53. Examples of the type which » 
  CLIENT (customers) 
  STANDALONE (independent) 
  SATELLITE (Satellite) 
EEDB2
EEE

  54. Examples of how to create » 
  DB2ICRTINSTNAME <… PARAMETERS> 

  55. How to list all available on the system examples » 
DB2ILIST

  56. How do I know if the current dialogue which is used in cases » 
GETINSTANCE

  57. Examples of how to update the configuration » 
DB2IUPDT

  58. Examples of how to delete » 
DB2IDROPINSTANCE_NAME
  Concrete steps are as follows: 
  Stop all examples of applications in all open a command line on the implementation of DB2TERMINATE 
  Run DB2STOP 
  Backup DB2INSTPROF registered variables that the examples directory to withdraw from all examples of the use of landing DB2IDROP 
  Can also delete ID 

  59. How to list on the local system licensing information for all products » 
DB2LICM-L

  60. How to increase a product license » 
DB2LICM-AFILENAME

  61. How do I delete a product license » 
DB2LICM-RPRODUCTPASSWORD

  62. How to update the number who have purchased the license » 
DB2LICM-U

  63. How has the use of compulsory purchase only the number of « 
DB2LICM-EHARD
  64. On how to update the system used by the licensing type » 
DB2LICM-P REGISTEREDCONCURRENT

  65. How to update the system on the number of processors » 
DB2LICM-N

  66. Permit documentation for how the version information » 
DB2LICM-V

  67. DB2LICM how to query the help of information » 
DB2LICM-H

  68. At least a database which includes table space » 
  A directory table space of one or more users table space of one or more temporary table space [page] 

  69. According to data storage and movement between the different control methods, which the two sub-table space » 
  The space management system (SMS) 
  Database management of the space (DMS) 

  70. Directory of how to list the contents of the database system » 
LISTDATABASEDIRECTORY

  71.CREATEDATABASE is SQL order? » 
  Instead, the system is the order of 72. How to view the profile database ABC content » 
GETDATABASECONFIGURATIONFORABC

  73. How will the ABC database parameters set to default values » 
RESETDATABASECONFIGURATIONFORABC

  74. How to edit the database ABC configuration parameters numerical » 
UPDATEDATABASECONFIGURATIONFORABC
USING

  75. How to restart the database » 
RESTARTDATABASEDATABASE_NAME

  76. How to activate the database » 
ACTIVATEDATABASEDATABASE_NAME

  77. How can I stop database » 
DEACTIVATEDATABASEDATABASE_NAME

  78. How do I delete a database » 
DROPDATABASEDATABASE_NAME

  79. How to create a model » 
CREATESCHEMASCHEMA_NAME

  80. How to set up a model » 
  SETSCHEMA = SCHEMA_NAME 

  81. What are the types of table » 
  The results form the basic outline form table-type table-type table statement temporary table system temporary table 

  82. How to define a sequence » 
CREATESEQUENCEORDERSEQSTARTWITH1INCREMENTBY1NOMAXVALUENOCYCLECACHE24

  83. How to put up tables at state inspection » 
SETINTEGRITYTABLE_NAMEOFF

  84. How to obtain forms of exclusion lock » 
LOCKTABLETABLE_NAMEINEXCLUSIVEMODE

  85. How to adjust the table did not check the data online » 
SETINTEGRITYFORTABLE_NAMEALLIMMEDIATEUNCHECKED

  86. Table how to lift the lock » 
COMMIT

  87. How do I turn off the log table » 
ALTERTABLETABLE_NAMEACTIVENOTLOGGEDINIALLY

  88. How do I delete table » 
DROPSCHEMA.TABLE_NAME

  89. How to rename the table » 
RENAMETABLE_OLDTOTABLE_NEW

  90. How to take the current time » 
SELECTCURRENTTIMESTAMPFROMSYSIBM.SYSDUMMY1

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • DZone
  • Netvouz
  • NewsVine
  • Technorati

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Tags: