tag:blogger.com,1999:blog-91501946227315028342024-03-05T21:37:52.844-08:00DB2 DBA STUFFHarihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.comBlogger34125tag:blogger.com,1999:blog-9150194622731502834.post-69368321015029991182014-12-19T05:57:00.005-08:002014-12-19T05:57:35.743-08:00Binding packages to the standby database<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<h2 id="N1013A" style="background-color: white; border: 0px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial; font-size: 1.6em !important; margin: 5px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="color: #222222; font-family: Arial, sans-serif; font-size: 1.166em; line-height: 1.5em;"><br /></span></h2>
<h2 id="N1013A" style="background-color: white; border: 0px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial; margin: 5px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<span style="color: #222222; font-family: Arial, sans-serif; font-weight: normal; line-height: 1.5em;"><span style="font-size: small;">Usually, an application containing embedded SQL needs to be pre-compiled to a source file of the host language with the DB2 APIs, and then bound to the corresponding database. You can use the db2 CLP command PREP to pre-compile embedded SQL applications. By default, the package will be created automatically at pre-compile time. Optionally, you can specify BINDFILE option in PREP command, so that a bind file(.bnd) will be generated, and after pre-compilation, the BIND utility can be used to create a package in the database for this application with the bind file. When the structure or statistics of the tables that an embedded SQL application accesses are changed, the application needs to be rebound explicitly or implicitly.</span></span></h2>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
Perform the following steps for pre-compile and bind.</div>
<ol style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 1.166em; line-height: 1.5em; list-style-image: initial !important; list-style-position: initial !important; margin: 0px; outline: 0px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Run the PREP command with BINDFILE option to generate a bind file (sample.bnd), as shown in Listing 16.<h5 id="listing16" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 16. PREP command with BINDFILE option</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">=> db2 prep sample.sqc bindfile
LINE MESSAGES FOR sample.sqc
------ --------------------------------------------------------------------
SQL0060W The "C" precompiler is in progress.
SQL0091W Precompilation or binding was ended with "0"
errors and "0" warnings.</pre>
</div>
</li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Use the BIND utility to create the package in database, as shown in Listing 17.<h5 id="listing17" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 17. Using the BIND utility</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;"> => db2 bind sample.bnd
LINE MESSAGES FOR sample.bnd
------ --------------------------------------------------------------------
SQL0061W The binder is in progress.
SQL0091N Binding was ended with "0" errors and "0" warnings.</pre>
</div>
</li>
</ol>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
Note, both pre-compile and bind require you to be connected to the database.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
As previously discussed, no writes are allowed on the HADR standby database. Therefore, bind and rebind are not allowed on standby database either since they will write to the database. When you are trying to bind a package to the standby database, error SQL1773N reason code 5 will be reported as shown in Listing 18.</div>
<h5 id="listing18" style="background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 1.166em !important; margin: 5px 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 18. Errors when bind on standby database</h5>
<div class="codesection" style="background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 15.3600006103516px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">=> db2 bind sample.bnd
LINE MESSAGES FOR sample.bnd
------ --------------------------------------------------------------------
SQL0061W The binder is in progress.
SQL1773N The statement or command requires functionality
that is not supported on a read-enabled HADR standby
database. Reason code = "5".
SQL0082C An error has occurred which has terminated
processing.
SQL0092N No package was created because of previous errors.
SQL0091N Binding was ended with "3" errors and "0" warnings.</pre>
</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
When you need to bind or re-bind the package on the standby database, you must bind/re-bind on the primary database. The bind/re-bind operation is shipped and replayed on the standby server since there will be log records written for them.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
After bind/re-bind, you can copy the executable binary of the application to the server where the standby database is located, and then run the application. But, pay attention to the bind and re-bind commands. They will trigger the Replay Only window on standby.</div>
<div class="ibm-ind-link ibm-back-to-top" style="background-color: white; border: 0px; clear: both; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; height: 22px; line-height: 1.5em; outline: 0px; padding: 6px 0px; text-align: right; vertical-align: baseline;">
<br /></div>
<h2 id="N10165" style="background-color: white; border: 0px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial; font-size: 1.6em !important; margin: 5px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Isolation level on standby</h2>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; margin-top: 5px !important; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
Readers on standby database can only run in the Uncommitted Reads(UR) isolation level. The reason for this limitation is that DB2 HADR is based on log shipping. As you know, transactions on the primary server will produce log records, and the log records will be shipped to the standby database. The standby database re-does the log records, the same as rolling forward after a restore database, to ensure data consistency with the primary database. But the locks required for higher isolation levels than UR are not shipped to the standby database, and the readers will not acquire any locks while replaying the log records. In a word, data on the standby database is not protected by any locks, so applications on standby can only read in UR isolation level.</div>
<h5 id="listing19" style="background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 1.166em !important; margin: 5px 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 19. Error when reads in higher isolation than UR</h5>
<div class="codesection" style="background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 15.3600006103516px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">=> db2 "select * from t1 with RR"
C1
-----------
SQL1773N The statement or command requires functionality that is not
supported on a read-enabled HADR standby database. Reason code = "1".</pre>
</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
If some existing read-only applications are implemented in higher isolations than UR, and you don't want them to be broken due to this isolation level error, you can just coerce them running in the UR isolation level quietly by setting the DB2_STANDBY_ISO registry variable, as shown in Listing 20.</div>
<h5 id="listing20" style="background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 1.166em !important; margin: 5px 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 20. Error when reads in higher isolation than UR</h5>
<div class="codesection" style="background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 15.3600006103516px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">=> db2set DB2_STANDBY_ISO=UR
# We need to restart DB2 instance here so that this registry variable take effect
=> db2 connect to testdb
Database Connection Information
Database server = DB2/LINUXX8664 9.7.5
SQL authorization ID = XJCD
Local database alias = TESTDB
=> db2 "select * from t1 with RR"
C1
-----------
1
2
3
3 record(s) selected.</pre>
</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
For the read-only applications that need more than UR isolation level, you can only run them on the primary database.</div>
<div class="ibm-ind-link ibm-back-to-top" style="background-color: white; border: 0px; clear: both; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; height: 22px; line-height: 1.5em; outline: 0px; padding: 6px 0px; text-align: right; vertical-align: baseline;">
<br /></div>
<h2 id="N1017E" style="background-color: white; border: 0px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial; font-size: 1.6em !important; margin: 5px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Statistics on the standby database</h2>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; margin-top: 5px !important; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
Statistics of database objects are required by the SQL optimizer when generating access plans. If you don't have accurate statistics, the optimizer may choose an access plan that does not have the lowest cost, and query performance will be affected.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
The RUNSTATS utility is used to collect statistics in DB2. It will sample on the specified object (tables or indexes), and calculate the statistics, then write the results into the system catalog tables whose schema is SYSSTAT. Because write operations are not allowed on HADR standby database, the RUNSTATS utility is not available on standby either.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
In case you want to update the statistics on standby to improve query performance for the applications on standby database, you have the following alternatives.</div>
<ul class="ibm-bullet-list" style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 1.166em; line-height: 1.5em; list-style: none; margin: 0px; outline: 0px; padding: 0px 0px 8px; vertical-align: baseline;">
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 66px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">Execute RUNSTATS on the primary database. Yes, the most essential and easiest way is to run RUNSTATS on primary. Since RUNSTATS will write the results into the system catalog tables, corresponding log records will be </li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 66px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">generated, and they will be shipped to standby, and will be replayed. Therefore, the statistics on standby database will be updated.</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 66px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">Manually update the statistics catalog table directly. However, it is obvious </li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 66px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">that RUNSTATS in solution 1 will have some performance impact on primary database. Some fields in the statistics catalog tables can be updated, so you can update the statistics manually as you need. But, there will be some risk to</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 66px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;"> update the catalog tables, so take more care if this solution is adopted.</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 88px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">Use the optimizer profile to indicate a plan to the optimizer. At the same time, it is possible that some conditions on primary and standby are not identical, even though this is not recommended. For example, one tablespace on the primary database has a container with better performance than standby, the</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 88px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;"> statistics on the primary are not applicable on standby. In this circumstance you have to make a different access plan on primary than on standby for the same query.</li>
</ul>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
You can specify optimization guidelines for queries, either in-line guidelines or optimization profiles. Usually, you insert the optimization profiles (XML files) into SYSTOOLS.OPT_PROFILE table, and then enable the profiles before the queries. The DB2 optimizer will generate and choose an access plan according to the optimization profiles. For more details on using optimization profiles, refer to the "Influence query optimization with optimization profiles and statistical views in DB2 9" article that is in the <a href="http://www.ibm.com/developerworks/data/library/techarticle/dm-1205hadrstandby/#resources" style="border: 0px; color: #745285; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Resources</a> section for more information.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
Because write operations are blocked on the standby databases, you can not insert the optimization profiles into SYSTOOLS.OPT_PROFILE on standby. The work around would be insert into the profiles on primary, and then the corresponding log records will be shipped to standby. After the log records are replayed, the optimization profiles will be in standby database, and ready to use.</div>
<div class="ibm-ind-link ibm-back-to-top" style="background-color: white; border: 0px; clear: both; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; height: 22px; line-height: 1.5em; outline: 0px; padding: 6px 0px; text-align: right; vertical-align: baseline;">
<br /></div>
<h2 id="N10198" style="background-color: white; border: 0px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial; font-size: 1.6em !important; margin: 5px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Handling LOBs on standby servers</h2>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; margin-top: 5px !important; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
Before V9.7 Fix Pack 5, no large objects (LOBs) such as BLOB, CLOB, or DBCLOB were allowed on reads on standby database. All LOBs were stored in a separated tablespace from other non-LOBs columns before DB2 V9.7. When you are trying to read a LOB, you will get a return code of SQL1773N, reason code 1, as shown in Listing 21.</div>
<h5 id="listing21" style="background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 1.166em !important; margin: 5px 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 21. Non-inline LOBs are blocked on standby</h5>
<div class="codesection" style="background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 15.3600006103516px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">=> db2 "select C2 from T"
C2
-----------------------
SQL1773N The statement or command requires functionality that is not
supported on a read-enabled HADR standby database. Reason code = "1".</pre>
</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
In DB2 V9.7, inline LOBs were introduced. These LOBs are stored in the same tablespaces as non-LOB columns. In V9.7 Fix Pack 5 and later, inline LOBs are supported on standby. So, for small LOBs, you should make them inline if possible. To check if LOB column in a row is inline or not, ADMIN_IS_INLINED table function can be used, as shown in Listing 22.</div>
<h5 id="listing22" style="background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 1.166em !important; margin: 5px 0px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 22. Check if a LOB column is inline or not</h5>
<div class="codesection" style="background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 15.3600006103516px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">=> db2 "select ADMIN_IS_INLINED(c1) from t2"
1
------
1
1 record(s) selected.</pre>
</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
A query result of 1 means this column of this row is inline, and 0 means it is not inline.</div>
<div class="ibm-ind-link ibm-back-to-top" style="background-color: white; border: 0px; clear: both; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; height: 22px; line-height: 1.5em; outline: 0px; padding: 6px 0px; text-align: right; vertical-align: baseline;">
<br /></div>
<h2 id="N101B1" style="background-color: white; border: 0px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial; font-size: 1.6em !important; margin: 5px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Conclusion</h2>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; margin-top: 5px !important; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
Beginning with DB2 V9.7 Fix Pack 1, DB2 provides reads on standby capability with the HADR feature. You can put the read only applications on the standby database. This capability can help you to balance the workload on the primary server. Due to the log shipping and replay mechanisms, there will be some limitations on standby for read only applications. This article described these limitations and showed how to make applications on the standby database run effectively, including the following.</div>
<ul class="ibm-bullet-list" style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 1.166em; line-height: 1.5em; list-style: none; margin: 0px; outline: 0px; padding: 0px 0px 8px; vertical-align: baseline;">
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 22px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">Set DB2_HADR_ROS=on registry variable to enable the RoS feature.</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 44px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">Make transaction containing DDL statements as short as possible on the primary server to reduce the impact of the replay only window on the standby</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 44px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;"> server.</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_bullet_grey_on.png) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 22px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">Bind packages on the primary server, and run corresponding applications on</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_bullet_grey_on.png) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 22px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;"> the standby server.</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 22px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">Use Uncommitted Read (UR) isolation level for applications on the standby</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 22px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;"> server.</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 22px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">Make short LOBs inline if possible so that they can be accessed on the standby database.</li>
</ul>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-10519960474999159482014-12-19T05:57:00.004-08:002014-12-19T05:58:33.165-08:00Setting up db2 database reads on standby or Open Standby database read only mode<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 id="Setting up reads on standby" style="background-color: white; border: 0px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial; font-size: 1.6em !important; margin: 5px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</h2>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; margin-top: 5px !important; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
With the reads on standby feature, the standby database of an HADR pair can be used to support read only applications. The standby can be enabled in a read mode by setting the value of registry variable DB2_HADR_ROS. The registry variable is set to <strong style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">ON</strong> to enable reads on standby. The setting of the registry variable is not dynamic. In other words, the standby server must be stopped and restarted for the change to the registry variable to take effect. If, in the event that the standby becomes a primary due to a takeover operation, the registry variable will not have any effect on the new primary. The read capability is supported for the HADR sync modes: ASYNC, NEARSYNC, SYNC and SUPERASYNC. Read capability is not supported when the standby is in local catch-up state.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
Perform the following steps to set up DB2_HADR_ROS.</div>
<ol style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 1.166em; line-height: 1.5em; list-style-image: initial !important; list-style-position: initial !important; margin: 0px; outline: 0px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">After setting up the HADR pair, check to see if DB2_HADR_ROS is set.<br /><code style="border: 0px; color: rgb(0, 0, 0) !important; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 0.95em !important; line-height: 1.5em; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">db2 => !db2set</code></li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Connecting to the standby database should yield SQL1776 rc=1, as shown in Listing 1.<h5 id="listing1" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 1. Connect to standby database</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">db2 => connect to hadrdb
SQL1776N The command is not supported on an HADR standby database or on an
HADR standby database with the current configuration or state. Reason code =
"1".</pre>
</div>
</li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Set the DB2_HADR_ROS variable, as shown in Listing 2.<h5 id="listing2" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 2. Set variable</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">db2 => !db2set DB2_HADR_ROS=ON
db2 => !db2set
DB2_HADR_ROS=ON</pre>
</div>
</li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Bounce the server for the registry variable to take effect, as shown in Listing 3.<h5 id="listing3" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 3. Bounce the server</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;"> db2 => deactivate db hadrdb
DB20000I The DEACTIVATE DATABASE command completed successfully.
db2 => !db2stop
SQL1064N DB2STOP processing was successful.
db2 => !db2start
SQL1063N DB2START processing was successful.</pre>
</div>
</li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Activate and connect to the standby database, as shown in Listing 4.<h5 id="listing4" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 4. Activate and connect</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">db2 => activate db hadrdb
DB20000I The ACTIVATE DATABASE command completed successfully.
db2 => connect to hadrdb
Database Connection Information
Database server = DB2/LINUXX8664 9.7.5
SQL authorization ID = KATTI
Local database alias = HADRDB</pre>
</div>
</li>
</ol>
<h2 id="N100A8" style="background-color: white; border: 0px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial; font-size: 1.6em !important; margin: 5px 0px; outline: 0px; padding: 8px 0px 0px; vertical-align: baseline;">
Verify HADR setup using RoS</h2>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; margin-top: 5px !important; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
Users generally want to verify that the HADR setup is working as expected and that there has been no data loss after the HADR pair is configured. Before DB2 V9.7 FP1, you had to use TAKEOVER to make the standby server become the new primary server in order to verify an HADR setup. No connections were allowed on the standby server, since it is offline to users. Thus it was difficult to check data on standby. The only way to bring standby online was TAKEOVER.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
The following process was required to verify HADR before RoS was available.</div>
<ol style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 1.166em; line-height: 1.5em; list-style-image: initial !important; list-style-position: initial !important; margin: 0px; outline: 0px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">On primary side, make some changes, such as creating a table and inserting values, as shown in Listing 5.<h5 id="listing5" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 5. Changes to primary server</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">[1049] [xjcd@db2eng63] /home/xjcd
=> db2 connect to hadrdb
Database Connection Information
Database server = DB2/LINUXX8664 9.7.5
SQL authorization ID = XJCD
Local database alias = HADRDB
[1050] [xjcd@db2eng63] /home/xjcd
=> db2 "create table t1(c1 int)"
DB20000I The SQL command completed successfully.
[1051] [xjcd@db2eng63] /home/xjcd
=> db2 "insert into t1 values(123)"
DB20000I The SQL command completed successfully.
[1052] [xjcd@db2eng63] /home/xjcd
=> db2 connect reset
DB20000I The SQL command completed successfully.</pre>
</div>
</li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">On the standby side, run TAKEOVER HADR and check the changes made on the primary server, as shown in Listing 6.<h5 id="listing6" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 6. Checking the changes on the standby server</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">[898] [xjcd@db2eng64] /home/xjcd
=> db2 takeover hadr on db hadrdb
DB20000I The TAKEOVER HADR ON DATABASE command completed successfully.
[899] [xjcd@db2eng64] /home/xjcd
=> db2 connect to hadrdb
Database Connection Information
Database server = DB2/LINUXX8664 9.7.5
SQL authorization ID = XJCD
Local database alias = HADRDB
[900] [xjcd@db2eng64] /home/xjcd
=> db2 "select * from t1"
C1
-----------
123
1 record(s) selected.</pre>
</div>
</li>
</ol>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
With read on standby enabled after DB2 V97 FP1, verifying the HADR setup becomes much easier. Connections can be established directly to the standby, so no takeover is required.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
Perform the following steps to verify HADR using RoS.</div>
<ol style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 1.166em; line-height: 1.5em; list-style-image: initial !important; list-style-position: initial !important; margin: 0px; outline: 0px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">On the primary side, make some changes to the database, as shown in Listing 7.<h5 id="listing7" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 7. Making changes to the primary database</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">[1049] [xjcd@db2eng63] /home/xjcd
=> db2 connect to hadrdb
Database Connection Information
Database server = DB2/LINUXX8664 9.7.5
SQL authorization ID = XJCD
Local database alias = HADRDB
[1050] [xjcd@db2eng63] /home/xjcd
=> db2 "create table t1(c1 int)"
DB20000I The SQL command completed successfully.
[1051] [xjcd@db2eng63] /home/xjcd
=> db2 "insert into t1 values(123)"
DB20000I The SQL command completed successfully.
[1052] [xjcd@db2eng63] /home/xjcd
=> db2 connect reset
DB20000I The SQL command completed successfully.</pre>
</div>
</li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Connect to standby directly after RoS is enabled, and check for the changes made on the primary database, as shown in Listing 8.<h5 id="listing8" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 8. Checking for changes on the standby database</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">[910] [xjcd@db2eng64] /home/xjcd
=> db2 connect to hadrdb
Database Connection Information
Database server = DB2/LINUXX8664 9.7.5
SQL authorization ID = XJCD
Local database alias = HADRDB
[911] [xjcd@db2eng64] /home/xjcd
=> db2 "select * from t1"
C1
-----------
123
1 record(s) selected.</pre>
</div>
</li>
</ol>
<h2 id="N100DB" style="background-color: white; border: 0px; font-family: HelveticaNeue-Light, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial; font-size: 1.6em !important; margin: 5px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
Replay only window on the standby database</h2>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; margin-top: 5px !important; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
When an HADR active standby database is replaying DDL log records or maintenance operations, the standby enters the replay-only window. When the standby is in the replay-only window, existing connections to the standby are terminated and new connections to the standby are blocked (SQL1776N Reason Code 4). New connections are allowed on the standby after all of the transactions that issued DDL or maintenance operations have completed. Existing applications are forced off at the outset of the replay-only window, and an error is returned (SQL1224N). The replay only window status can be obtained by executing the <code style="border: 0px; color: rgb(0, 0, 0) !important; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 0.95em !important; line-height: 1.5em; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">db2pd -db db_name -hadr</code> command on the standby database.</div>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
Perform the following steps.</div>
<ol style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 1.166em; line-height: 1.5em; list-style-image: initial !important; list-style-position: initial !important; margin: 0px; outline: 0px; padding: 0px 0px 0px 20px; vertical-align: baseline;">
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">After setting up the HADR pair and establishing a connection to the standby database, issue the following command, shown in Listing 9, to obtain the current active applications on standby.<h5 id="listing9" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 9. Obtaining the status of applications on the standby database</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">db2 => list applications
Auth Id Application Appl. Application Id DB # of
Name Handle Name Agents
-------- -------------- ---------- -------------- -------- -----
KATTI db2bp 13 *LOCAL.katti.120305194800 HADRDB 1</pre>
</div>
</li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Check to see if the replay only window is active or inactive on the standby database, as shown in Listing 10.<h5 id="listing10" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 10. Checking replay only window</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">db2 => !db2pd -db hadrdb -hadr
Database Partition 0 -- Database HADRDB -- Active Standby -- Up 0 days 00:05:37 –
Date 03/05/2012 11:50:58
HADR Information:
Role State SyncMode HeartBeatsMissed LogGapRunAvg (bytes)
Standby Peer Sync 0 3298
ConnectStatus ConnectTime Timeout
Connected Mon Mar 5 11:45:26 2012 (1330976726) 120
<strong style="border: 0px; font-family: Arial, sans-serif; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">ReplayOnlyWindowStatus ReplayOnlyWindowStartTime MaintenanceTxCount
Inactive N/A 0</strong>
LocalHost LocalService
grebe DB2_katti
RemoteHost RemoteService RemoteInstance
petrel xkatti katti
PrimaryFile PrimaryPg PrimaryLSN
S0000001.LOG 13 0x000000000235DFB6
StandByFile StandByPg StandByLSN StandByRcvBufUsed
S0000001.LOG 13 0x000000000235DFB6 0%</pre>
</div>
</li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Issue an uncommitted transaction containing DDL on the primary database, as shown in Listing 11.<h5 id="listing11" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 11. Issuing an uncommitted transaction</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">db2 => update command options using c off
DB20000I The UPDATE COMMAND OPTIONS command completed successfully.
db2 => create table t1(c1 int, c2 int)
DB20000I The SQL command completed successfully.</pre>
</div>
</li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Check to see if the replay only window is active, as shown in Listing 12.<h5 id="listing12" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 12. Checking the replay only window</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">db2 => !db2pd -db hadrdb -hadr
Database Partition 0 -- Database HADRDB -- Active Standby -- Up 0 days 00:10:26
-- Date 03/05/2012 11:55:47
HADR Information:
Role State SyncMode HeartBeatsMissed LogGapRunAvg (bytes)
Standby Peer Sync 0 1441
ConnectStatus ConnectTime Timeout
Connected Mon Mar 5 11:45:26 2012 (1330976726) 120
<strong style="border: 0px; font-family: Arial, sans-serif; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">ReplayOnlyWindowStatus ReplayOnlyWindowStartTime MaintenanceTxCount
Active Mon Mar 5 11:54:09 2012 (1330977249) 1</strong>
LocalHost LocalService
grebe DB2_katti
RemoteHost RemoteService RemoteInstance
petrel xkatti katti
PrimaryFile PrimaryPg PrimaryLSN
S0000001.LOG 15 0x000000000235FCFC
StandByFile StandByPg StandByLSN StandByRcvBufUsed
S0000001.LOG 14 0x000000000235EE8A 0%</pre>
</div>
</li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">See if existing applications have been kicked off, as shown in Listing 13.<h5 id="listing13" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 13. Existing applications</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">db2 => list applications
SQL1611W No data was returned by Database System Monitor.</pre>
</div>
</li>
<li style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Check to see if new connections are blocked, as shown in Listing 14.<h5 id="listing14" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 14. New connections</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;"> db2 => connect to hadrdb
SQL1776N The command is not supported on an HADR standby database or on an
HADR standby database with the current configuration or state. Reason code =
"4".</pre>
</div>
</li>
</ol>
<div style="background-color: white; border: 0px; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; line-height: 1.5em; outline: 0px; padding: 6px 0px; vertical-align: baseline;">
So the replay windows obviously have an impact on user business on the standby database. If RoS is enabled on standby, ensure that you do the following.</div>
<ul class="ibm-bullet-list" style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 1.166em; line-height: 1.5em; list-style: none; margin: 0px; outline: 0px; padding: 0px 0px 8px; vertical-align: baseline;">
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 22px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">Plan to have all the operations that will generate replay only windows occur </li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 22px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">together in a short period of time on the primary server.</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 22px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">Enable automatic commit on the primary server so that </li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 22px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">the replay only window can be as short as possible.</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 101px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;">Turn off the automatic maintenance features on both the primary and standby servers, as shown in Listing 15.<h5 id="listing15" style="border: 0px; font-size: 1em !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; outline: 0px; padding: 0px; vertical-align: baseline;">
Listing 15. Turning off the automatic maintenance features on primary and standby databases</h5>
<div class="codesection" style="border: 0px; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
<pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">=> db2 UPDATE DATABASE CFG FOR hadrdb USING AUTO_MAINT OFF AUTO_RUNSTATS OFF
AUTO_REORG OFF
DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully.</pre>
</div>
</li>
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 101px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;"><pre class="displaycode" style="background: rgb(247, 247, 247) !important; border: 1px solid rgb(204, 204, 204); clear: right; color: black; font-family: 'Andale Mono', 'Lucida Console', Monaco, Liberation, fixed, monospace; font-size: 11px; line-height: 1.2 !important; margin-bottom: 6px !important; outline: 0px; overflow: auto; padding: 5px 10px 5px 3px !important; vertical-align: baseline; width: 780px;">
</pre>
</li>
</ul>
<div>
<span style="color: #222222; font-family: Arial, sans-serif;"><span style="font-size: 22px; line-height: 32.6293411254883px;"><br /></span></span></div>
<ul class="ibm-bullet-list" style="background-color: white; border: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 1.166em; line-height: 1.5em; list-style: none; margin: 0px; outline: 0px; padding: 0px 0px 8px; vertical-align: baseline;">
<li style="background: url(http://1.www.s81c.com/i/v17/bullets/ibm_lg_bullet_grey_on.gif) 0px 13px no-repeat; border: 0px; clear: left; font-size: inherit; height: 101px; margin: 0px; outline: 0px; padding: 5px 0px 5px 11px; vertical-align: baseline;"><div>
<span style="color: #222222; font-size: 1.166em; line-height: 1.5em;">For the full list of DDL statements and maintenance operations, please refer to DB2 Information Center link in the</span><span style="color: #222222; font-size: 1.166em; line-height: 1.5em;"> </span>Resources<span style="color: #222222; font-size: 1.166em; line-height: 1.5em;"> </span><span style="color: #222222; font-size: 1.166em; line-height: 1.5em;">section for more information on this article.</span></div>
</li>
</ul>
<div class="ibm-alternate-rule" style="background-color: #cccccc; border: 0px; clear: both; font-family: Arial, sans-serif; font-size: 13px; height: 1px; line-height: 15.3600006103516px; margin: 10px 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</div>
<div class="ibm-ind-link ibm-back-to-top" style="background-color: white; border: 0px; clear: both; color: #222222; font-family: Arial, sans-serif; font-size: 1.166em !important; height: 22px; line-height: 1.5em; outline: 0px; padding: 6px 0px; text-align: right; vertical-align: baseline;">
<br /></div>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com1tag:blogger.com,1999:blog-9150194622731502834.post-48610894673761102802014-12-19T04:16:00.002-08:002014-12-19T04:16:45.437-08:00extend a DB2 tablespace by a fixed amount<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="procedure" style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;">
<div class="title" style="clear: right; font-weight: bold;">
To monitor the free space available in a DB2 tablespace</div>
<ul style="margin-top: 24px;">
<li style="margin-bottom: 12px; margin-left: -22px; margin-top: 12px;"><a href="https://www.blogger.com/null" name="vsf01id121751"></a><div style="clear: right; margin-bottom: 12px; margin-top: 12px;">
<a href="https://www.blogger.com/null" name="vsf01id121755"></a>Use the following DB2 commands:</div>
<a href="https://www.blogger.com/null" name="vsf01id121762"></a><pre class="programlisting">$ db2 connect to <i class="replaceable">database</i>
$ db2 list tablespaces show detail
$ db2 terminate</pre>
</li>
</ul>
</div>
<div class="procedure" style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;">
<a href="https://www.blogger.com/null" name="v4455656"></a><div class="title" style="clear: right; font-weight: bold;">
To extend a Quick I/O file using qiomkfile</div>
<ul style="margin-top: 24px;">
<li style="margin-bottom: 12px; margin-left: -22px; margin-top: 12px;"><a href="https://www.blogger.com/null" name="vsf01id121789"></a><div style="clear: right; margin-bottom: 12px; margin-top: 12px;">
<a href="https://www.blogger.com/null" name="vsf01id121792"></a>Use the <b class="command">qiomkfile</b> command to extend the Quick I/O file (if the container is running low on free blocks):</div>
<a href="https://www.blogger.com/null" name="vsf01id121805"></a><pre class="programlisting">$ /opt/VRTS/bin/qiomkfile -e extend_amount filename</pre>
</li>
</ul>
</div>
<div class="procedure" style="background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;">
<a href="https://www.blogger.com/null" name="v4455662"></a><div class="title" style="clear: right; font-weight: bold;">
To extend a DB2 tablespace by a fixed amount</div>
<ul style="margin-top: 24px;">
<li style="margin-bottom: 12px; margin-left: -22px; margin-top: 12px;"><a href="https://www.blogger.com/null" name="vsf01id121828"></a><div style="clear: right; margin-bottom: 12px; margin-top: 12px;">
<a href="https://www.blogger.com/null" name="vsf01id121832"></a>Use the following DB2 commands:</div>
<a href="https://www.blogger.com/null" name="vsf01id121839"></a><pre class="programlisting">$ db2 connect to <i class="replaceable">database</i></pre>
<a href="https://www.blogger.com/null" name="vsf01id121847"></a><pre class="programlisting">$ db2 alter tablespace <i class="replaceable">tablespace-name</i> extend (ALL <i class="replaceable">amount</i>)</pre>
<a href="https://www.blogger.com/null" name="v4475633"></a><pre class="programlisting">$ db2 terminate</pre>
<div style="clear: right; margin-bottom: 12px; margin-top: 12px;">
<a href="https://www.blogger.com/null" name="vsf01id121870"></a>This example shows how to monitor the free space on the tablespaces in database <b class="command">PROD</b>:</div>
<a href="https://www.blogger.com/null" name="vsf01id121882"></a><pre class="programlisting">$ db2 connect to PROD</pre>
<a href="https://www.blogger.com/null" name="vsf01id121889"></a><pre class="programlisting">$ db2 list tablespaces show detail</pre>
<a href="https://www.blogger.com/null" name="vsf01id121894"></a><pre class="programlisting">$ db2 terminate</pre>
<div style="clear: right; margin-bottom: 12px; margin-top: 12px;">
<a href="https://www.blogger.com/null" name="vsf01id121899"></a>This example shows how to extend the three DB2 containers owned by tablespace <b class="command">EMP</b> by 500MB using the <b class="command">qiomkfile</b> command:</div>
<a href="https://www.blogger.com/null" name="vsf01id121915"></a><pre class="programlisting">$ /opt/VRTS/bin/qiomkfile -e 500M tbsEMP_cont001</pre>
<a href="https://www.blogger.com/null" name="vsf01id121920"></a><pre class="programlisting">$ /opt/VRTS/bin/qiomkfile -e 500M tbsEMP_cont002</pre>
<a href="https://www.blogger.com/null" name="vsf01id121925"></a><pre class="programlisting">$ /opt/VRTS/bin/qiomkfile -e 500M tbsEMP_cont003</pre>
<div style="clear: right; margin-bottom: 12px; margin-top: 12px;">
<a href="https://www.blogger.com/null" name="vsf01id121930"></a>This example shows how to notify DB2 that all containers in tablespace <b class="command">EMP</b> have grown by 500MB:</div>
<a href="https://www.blogger.com/null" name="vsf01id121941"></a><pre class="programlisting">$ db2 connect to PROD</pre>
<a href="https://www.blogger.com/null" name="vsf01id121949"></a><pre class="programlisting">$ db2 alter tablespace EMP extend (ALL 500M)</pre>
<a href="https://www.blogger.com/null" name="vsf01id121954"></a><pre class="programlisting">$ db2 terminate</pre>
<div style="clear: right; margin-bottom: 12px; margin-top: 12px;">
<a href="https://www.blogger.com/null" name="vsf01id121958"></a>This example shows how to verify the newly allocated space on the tablespace <b class="command">EMP</b> in database <b class="command">PROD</b>:</div>
<a href="https://www.blogger.com/null" name="vsf01id121974"></a><pre class="programlisting">$ db2 connect to PROD</pre>
<a href="https://www.blogger.com/null" name="vsf01id121981"></a><pre class="programlisting">$ db2 list tablespaces show detail</pre>
</li>
</ul>
</div>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-13009980618917320382013-07-27T00:59:00.000-07:002013-07-27T00:59:00.573-07:00to check queries that have bad performance<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt -0.25in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Procedures to do when you need to know what are the queries
that have bad <o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0.0001pt -0.25in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> performance<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">An easier way to find queries that
have bad performance:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">• On Db2 V8 run this query:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">db2 "select
TOTAL_EXEC_TIME, NUM_EXECUTIONS, substr (STMT_TEXT, 1,500) \<br />
as statement from table(SNAPSHOT_DYN_SQL('<database>', -1)) as \<br />
snap_dyn_sql order by 1 desc,2 desc"<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">• On Db2 V7 run the snapshot command
and then the query:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">db2 get snapshot for
dynamic sql on ICMNLSDB write to file<br />
db2 "select TOTAL_EXEC_TIME_S, NUM_EXECUTIONS, substr (STMT_TEXT, 1,500) \<br />
as statement from table(SYSFUN.SQLCACHE_SNAPSHOT()) as snap_dyn_sql \<br />
order by 1 desc,2 desc"<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">After finding out the queries that
are taking a long time or the ones that run very often, you can use db2advis to
check if you need new indexes using it a query each time:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">db2advis -d <i><db_name></i>
[{-s "<i>sql_statement</i>" | -i <i><input_file></i>}]<br />
[-l <i><disk-limit></i>] [-t <i><max_advise_time></i>] [-h] [-o <i><output_file></i>]<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Where:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">-d <db_name></span></b><span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> specifies the name of the database to which a connection is
to be established.<br />
<br />
<b>-s "sql_statement"</b> specifies the text of a single SQL
statement whose indexes are to be advised. The statement must be enclosed by
double quotation marks.<br />
<br />
<b>-i <input_file></b> specifies the name of an input file containing one
or more SQL statements. Statements must be delimited by semicolons. Comments
should have two hyphens at the start of each line. The frequency at which each
statement in the workload is to be executed can by changed by inserting the
following line into the input file: <b>--#SET FREQUENCY <value></b><br />
<br />
<b>-l <disk-limit></b> specifies the maximum number of megabytes
available for all indexes in the existing schema. The default value is 20% of
the total database size.<br />
<br />
<b>-t <max-advise-time></b> specifies the maximum allowable time, in
minutes, to complete the operation. If no value is specified for this option,
the operation will continue until it is completed.<br />
<br />
<b>-h</b> displays help information.<br />
<br />
<b>-o <output_file></b> saves the script to create the recommended
objects in output_file.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Or to investigate one or more slow
queries in a production environment:<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 10.0pt; mso-bidi-font-family: "Courier New"; mso-fareast-font-family: "Times New Roman";">db2advis -d <i><db_name</i>>
-i <i><input_file></i> -o <i><output_file><o:p></o:p></i></span></div>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-68980120498984246492013-05-27T08:37:00.003-07:002013-05-27T08:37:43.480-07:00Inplace/Online Reorg phases<div dir="ltr" style="text-align: left;" trbidi="on">
Online or inplace table reorganization allows the user to reorganize a table
while permitting full access to that table. While inplace REORG provides
uninterrupted user access to the data, the performance of inplace REORG is
slower than classic or offline REORG.<br />
<br />
During an inplace table reorganization, the entire table is not reorganized
at once. Instead, portions of the table are reorganized incrementally. Data is
not copied out to a temporary table space: rows are moved within the existing
table object to re-establish clustering, reclaim free spaces, and eliminate
overflow rows.<br />
<br />
There are four primary phases for inplace table REORG: <br />
<br />
<ol>
<li>SELECT N pages <br />During this phase, DB2 selects N pages, where N is the
extent size with a minimum of 32 sequential pages for REORG processing.
<li>Vacate the range <br />With the N pages selected, inplace table REORG moves
all rows within this range to free pages within the table. Each row that is
moved leaves behind an RP (REORG pointer) record that contains the RID of the
row’s new location. The row is inserted to free pages in the table as a RO
(REORG overflow) record that contains the data. <br />Once REORG finishes moving a
set of rows, it waits for all existing data accesses that are occurring in the
table (for example, by currently executing applications) to complete. These
existing accesses, called old scanners, use old the RIDs when accessing the
table data. Any accesses that start during this waiting period, called new
scanners, use the new RIDs to access the data. Once all of the old scanners have
completed, REORG cleans up the moved rows, deleting the RP records and
converting the RO records to normal records.
<li>Fill the range<br />After all rows have been vacated, the rows are written
back, in a reorganized format, sorted according to any indexes used, and obeying
any PCTFREE restrictions defined. When all the pages in the range are filled,
the next N sequential pages are selected in the table, and the process begins
again.
<li>Truncate the table <br />When all pages in the table have been reorganized,
the table will be truncated to reclaim space by default. If the NOTRUNCATE
option is specified, the reorganized table is not truncated. </li>
</li>
</li>
</li>
</ol>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-84885931105765908832013-05-27T08:36:00.000-07:002013-05-27T08:37:56.104-07:00Classic/Offline Reorg Phases<div dir="ltr" style="text-align: left;" trbidi="on">
Offline table reorganization uses a shadow copy approach, building a full
copy of the table that is being reorganized. <br />
<br />
The shadow copy image is built within the table space that the table being
reorganized resides in. Optionally, the copy can be built in a system temporary
table space if the USE option is specified when issuing the REORG TABLE
command.<br />
<br />
There are four possible phases in a classic or offline table
reorganization:<br />
<br />
<ol>
<li><dfn class="term">SORT</dfn><br />If an index is specified with the REORG TABLE
command, or if a clustering index is defined on the table, the rows of the table
are first sorted according to that index. If the INDEXSCAN option is specified,
an index scan is used to sort the table, otherwise, a table scan sort is used.
This phase only applies to a clustering REORG. Space reclaiming reorganizations
begin at the build phase.
<li><dfn class="term">BUILD</dfn><br />In this phase, a reorganized copy of the
entire table is build, either in the table space that the table being
reorganized resides, or in a temporary table space specified with the REORG
command.
<li><dfn class="term">REPLACE</dfn><br />In this phase, the original table object is
replaced by either copying back from the temporary table space, or by pointing
to the newly built object within the table space of the table being reorganized.
<li><dfn class="term">RECREATE ALL INDEXES</dfn><br />All indexes defined on the
table are recreated. </li>
</li>
</li>
</li>
</ol>
<br />
You can monitor the progress of the table reorganization and determine which
phase the process is currently in using the snapshot monitor or snapshot
administrative views. </div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-91198964900129717222013-05-27T08:32:00.000-07:002013-05-27T08:40:35.222-07:00Online Reorg and Offline Reorg in db2 UDB <div dir="ltr" style="text-align: left;" trbidi="on">
<strong></strong><br />
<strong>Offline reorg</strong> : <br />
1. Database will be unavailable during offline reorg. If the db is quiesced then only instance owner will be able perform any operation .. other application will not be able to connect.<br />
<br />
2. In offline reorg when we use "use tempspace_name" phrase then actually db2 creates a copy of that table in temp_tablespace by building structure of the table ,,, in second phase db2 starts to copy the data as well in proper way and removes dirty pages.. In last phase once this activity gets completed db2 removed the old table and places the newly organized table in its previous tablespace from temp_tablespace.<br />
If we do not use temp_tablespace then at least double space of the table data size + index size is required to continue the offline reorg.<br />
<br />
<strong>Online reorg</strong> : <br />
In online reorg all application can connect to database .but applications perpormance gets slow.. hence creates lock-waits as well. Here db2 do not need temp_tablespace as db2 part by part reorganizes the table data.. Tables data are moved from one place to another place and leaves a row identifier to mention where the data pages are moved.Clean up only option is useful to clear the dirty pages.<br />
<br />
But I personally feel online reorg is not useful for big tables. Most of the time it take s much more time compare to offline reorg timings.<br />
<br />
Online reorg is compatible with online database backup...<br />
<br />
Please correct me if my understanding is not correct ...</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com2tag:blogger.com,1999:blog-9150194622731502834.post-43248839658803241172013-05-03T11:33:00.001-07:002013-05-03T11:39:04.781-07:00DB2 Locking Basics<b>DB2 Locking basics </b><br />
<br />
In any relational database, in order to maintain consistency among the transaction locks need to be acquired on the resource on which the transaction will be executed. Resource can be a Relational Table, or Rows. Locking provide isolation of resource between transaction thereby providing concurrency between independent transaction. DB2 provides four isolation levels.<br />
<br />
<ul>
<li>Uncommitted Read</li>
<li>Cursor Stability</li>
<li>Read Stability</li>
<li>Repeatable Read</li>
<li>Currently committed (New in DB 9.7)</li>
</ul>
<div>
In order to utilize the isolation level in the transaction, they can be specified at</div>
<div>
<br /></div>
<div>
1) Statement level (SELECT, DELETE, UPDATE)<br />
eg:- SELECT FROM WITH {<b>UR, CS, RR, RS</b>}<br />
<br />
2) At session level<br />
eg:- SET CURRENT ISOLATION = {<b>UR, CS, RR, RS</b>}<br />
<br />
<br />
<b>Commonly referred LOCKING terms</b></div>
<div>
<br /></div>
<div>
<b>1) Locks</b><br />
In order to use any resource, DB2 lock the resource before the transaction can use it. <br />
<br />
<br />
<b>2) Lock-Wait</b><br />
If any transaction is requesting lock on a resource, and that resource is currently being held by other transaction, then the application requesting the lock goes into LOCK-WAIT mode until the lock on the resource is released by the primary transaction.<br />
<br />
<b>3) Deadlock</b><br />
If two transaction are waiting on each others resources the the both the transaction goes into deadlock state.<br />
<br />
<b> 4) Lock Escalation</b><br />
For each lock acquired on a resource, DB2 maintain that information in DB2 locklist memory component. If the locklistmemory started getting exhausted, DB2 escalate all row level lock to table level lock in order to release memory.<br />
<br />
<b>How DB2 locking can be monitored?</b><br />
<br />
1) Monitor switches<br />
2) GET SNAPSHOT command<br />
3) db2pd tool<br />
4) Snapshot monitor SQL administrative routines<br />
5) DB2_CAPTURE_LOCKTIMEOUT ( New in DB2 9.5 locking)</div>
<div>
<a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/topic/com.ibm.db2.luw.admin.perf.doc/doc/r0052974.html">Practical Use of DB2_CAPTURE_LOCKTIMEOUT</a><br />
6) db2cos scripts<br />
7) db2pdcfg with -<b>catch</b> option<br />
8) Locking event monitor as apposed to Deadlock event monitory (New in DB2 9.7 Locking) <br />
<br />
<b>Lock related DB CFG parameter</b> <br />
<br />
1) LOCKLIST <br />
2) MAXLOCK<br />
3) LOCKTIMEOUT<br />
4) DLCHKTIME<br />
<br />
<b>Lock related registry variable</b><br />
<br />
1) DB2LOCK_TO_RB<br />
2) DB2_KEEPTABLELOCK<br />
3) DB2_MAX_NON_TABLE_LOCKS<br />
4) DB2_EVALUNCOMMITED<br />
5) DB2_SKIPDELETED<br />
6) DB2_SKIPINSERTED<br />
<b><br /></b>
<b>Lock monitoring - to get more details <a href="http://www.ibm.com/developerworks/data/library/techarticle/dm-0707fechner/"><span style="color: blue;">click here</span></a></b></div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-61551029836236729672013-05-03T11:14:00.002-07:002013-05-03T11:19:42.661-07:00Types of Recovery in Db2Crash Recovery<br />
<div>
<br />
It is a type of recovery which bring the database back to the consistent state after unplanned failure<br />
It perform rollback operation of the transaction that were not committed and perform data page externalization for all the committed transactions</div>
<div>
<br />
If the tablespace is damaged in circular logging database and cannot be made online then in order to start the database it needs to be dropped to start the database else database will not start<br />
If the database is not started, try restarting it using RESTART command</div>
<div>
db2 "restart database sample"<br />
<br />
If there are corrupt tablespace the database restart will fail with SQL0290N error code<br />
Then check the DB2 administration notification file for list of all tablespace that are in DROP PENDING state db2 get dbm cfg | grep -i diag<br />
cd /home/db2inst1/sqllib/db2dump<br />
vi db2inst1.nfy<br />
<br />
Try restarting the database with DROP PEDNING clausedb2 "restart database sample drop pending tablespaces(userspace1,tbsp_taba)"<br />
<br />
<a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.ha.doc/doc/c0005962.html">Click here</a> to get more detail on DB2 Crash Recovery</div>
<div>
<br />
Crash recovery can be automated or can be done manually<br />
Enabling Automated crash recovery<br />
Set DB CFG parameter “autorestart” to “ON”db2 "update db cfg for sample using autorestart on immediate"<br />
<br />
Following the failure, DB2 will automatically restore the database to a consistent point by rolling forward and backup the changes from Active log files<br />
Manually performing the Crash recovery<br />
DB CFG parameter “autorestart” is set to “OFF”<br />
Following the failure, “RESTART DATABASE” is issued to perform the crash recoverydb2 "restart database sample"<br />
<br />
<br />
2)Version Recovery<br />
<br /><ul>
<li>It restores the database from the consistent full offline backup available.</li>
<li>Restore from only full offline backup operation is available.</li>
<li>Version recovery can be used with circular logging and archival logging database.</li>
<li>If the database is enabled for archival logging, then using only the FULL OFFLINE BACKUP of the database with the “WITHOUT ROLLING FORWARD” at the end of the “RESTORE” command can be used to perform version recovery.</li>
<li>All the transaction after the last full offline backup are lost in this type of recovery.</li>
<li><a href="http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.ha.doc%2Fdoc%2Fc0006063.html">click here</a> to get more details on DB2 Version Recovery</li>
</ul>
<br />
Version recovery example<br />
<table style="background-color: #fefdfa; border-collapse: collapse; border: none; color: black; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 10px;"><colgroup><col width="60"></col><col width="192"></col><col width="372"></col></colgroup><tbody>
<tr style="background-color: #eafdff; height: 0px;"><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<b><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; font-weight: normal; vertical-align: baseline;">Sr. No</span></b></div>
</td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">Description</span></div>
</td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt; text-align: center;">
<b><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; font-weight: normal; vertical-align: baseline;">Sample DB2 Command</span></b></div>
</td></tr>
<tr style="background-color: #eafdff; height: 0px;"><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">1</span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">Check if database is configured for Circular logging. </span><span style="background-color: transparent; color: red; font-family: 'Courier New'; font-size: 12px; font-style: italic; font-weight: bold; vertical-align: baseline;">If database is configured for Archival logging this step is not needed.</span><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; font-style: italic; font-weight: bold; vertical-align: baseline;"></span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; font-weight: bold; vertical-align: baseline;">db2 get db cfg for sample | grep -i log</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; font-weight: bold; vertical-align: baseline;"> </span><span style="background-color: transparent; color: red; font-family: 'Courier New'; font-size: 12px; font-weight: bold; vertical-align: baseline;">LOGARCHMETH1 = OFF</span><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span></td></tr>
<tr style="background-color: #eafdff; height: 0px;"><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">2</span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">Perform Offline backup of the database</span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">-- Deactivate the database</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">db2 deactivate db sample</span><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span><br />
<span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">-- Check if the database is deactivated. This command check for db2loggr process. If not listed then DB is deactivated</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">db2pd -edus | grep -i db2lo</span><br />
<span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">-- Perform offline backup of the database</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">db2 “backup database sample to /backup compress”</span><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span></td></tr>
<tr style="background-color: #eafdff; height: 0px;"><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">3</span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">Identify the set of offline backup and determine the recovery point</span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">db2 “list history backup all for database sample”</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">Op Obj Timestamp+Sequence Type Dev Earliest Log Current Log Backup ID</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">-- --- ------------------ ---- --- ------------ ------------ --------------</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> B D </span><span style="background-color: transparent; color: red; font-family: 'Courier New'; font-size: 12px; font-weight: bold; vertical-align: baseline;">20110520114322001</span><span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> F D S0000023.LOG S0000023.LOG</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">----------------------------------------------------------------------------</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> Contains 3 tablespace(s):</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> 00001 SYSCATSPACE</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> 00002 USERSPACE1</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> 00003 SYSTOOLSPACE</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">----------------------------------------------------------------------------</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> Comment: DB2 BACKUP SAMPLE OFFLINE</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">Start Time: 20110520114322</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> End Time: 20110520114345</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> Status: A</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">----------------------------------------------------------------------------</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> EID: 29 Location: /home/db2inst1/gilroy/bar</span><br />
<span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span></td></tr>
<tr style="background-color: #eafdff; height: 0px;"><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">4</span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">Determine which version of the database is needed using the timestamp displayed from the “LIST HISTORY” command</span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> Details captured from previous command</span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">1) Timestamp => </span><span style="background-color: transparent; color: red; font-family: 'Courier New'; font-size: 12px; font-weight: bold; vertical-align: baseline;">20110520114322001</span><span style="background-color: transparent; color: red; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> </span><span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span><br />
<span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">2) Backup image location =></span><span style="background-color: transparent; color: red; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">/home/db2inst1/gilroy/bar</span><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span></td></tr>
<tr style="background-color: #eafdff; height: 0px;"><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">5.a</span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">Version recovery on</span><span style="background-color: transparent; color: #38761d; font-family: 'Courier New'; font-size: 12px; font-weight: bold; vertical-align: baseline;">Circular Logging Database</span><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">db2 “restore db sample from</span><span style="background-color: transparent; color: #38761d; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">/home/db2inst1/gilroy/bar</span><span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> taken at</span><span style="background-color: transparent; color: #38761d; font-family: 'Courier New'; font-size: 12px; font-weight: bold; vertical-align: baseline;">20110520114322001</span><span style="background-color: transparent; color: #38761d; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> </span><span style="background-color: transparent; color: red; font-family: 'Courier New'; font-size: 12px; font-weight: bold; vertical-align: baseline;">into testdb</span><span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">”</span><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span></td></tr>
<tr style="background-color: #eafdff; height: 0px;"><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">5.b.</span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">Version recovery on</span><span style="background-color: transparent; color: #38761d; font-family: 'Courier New'; font-size: 12px; font-weight: bold; vertical-align: baseline;">Archival logging database</span><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span></td><td style="border: 1px dotted rgb(170, 170, 170); padding: 7px; vertical-align: top;"><span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">db2 “restore db sample from</span><span style="background-color: transparent; color: #38761d; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">/home/db2inst1/gilroy/bar</span><span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> taken at</span><span style="background-color: transparent; color: #38761d; font-family: 'Courier New'; font-size: 12px; font-weight: bold; vertical-align: baseline;">20110520114322001</span><span style="background-color: transparent; color: #38761d; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"> </span><span style="background-color: transparent; color: red; font-family: 'Courier New'; font-size: 12px; font-weight: bold; vertical-align: baseline;">into testdb without rolling forward</span><span style="background-color: transparent; color: blue; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;">”</span><span style="background-color: transparent; font-family: 'Courier New'; font-size: 12px; vertical-align: baseline;"></span></td></tr>
</tbody></table>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-78773820510105347042013-05-03T11:03:00.000-07:002013-05-07T06:00:59.439-07:00Redirect Restore1) Redirect restore of the database using version recovery<br />
a) DB is enable for archival logging.<br />
<br />
b) Perform offline backup of the database<br />
<br />
Offline backup is needed when the current database has to be redirected restore.(Requires, only the Offline backup image)<br />
Online backup can also be used, but transaction done during the online backup needs to be rollforward(Requires, Online Backup image + Archive/Active Log file)c) Performing recovery of database<br />
<br />
Version recovery if offline backup is used<br />
Roll-forward recovery if online backup is usedd) Activate the database<br />
<br />
<br />
<br />
2) Restore a failed Tablespace (Non-SYSCAT)<br />
<br />
A) Restore failed tablespace from the available backup imagea) Identify the tablespace that is failed<br />
<br />
ADMIN NOTIFICATION FILE<br />
db2pd -tablespace -db sample<br />
b) Restore the tablespace from the available backup image<br />
<br />
db2 restore db sample tablespace (userspace1) online<br />
c) Rollforward the tablespace to end of logs<br />
<br />
db2 "rollforward db sample to end of logs tablespace(userspace1) online"<br />
d) Optional. Take backup of database or backup of the restored tablespace<br />
<br />
B) Backup image is not available for the failed tablespace<br />
a) Identify the tablespace that is failed<br />
<br />
ADMIN NOTIFICATION FILE<br />
db2pd -tablespace -db sample<br />
b) Check the create time of the failed tablespace<br />
<br />
db2 "select varchar(TBSPACE,40),CREATE_TIME from syscat.tablespaces order by CREATE_TIME desc"<br />
c) Check the available backup image<br />
$==> db2 list history backup all for db <dbname><div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-48862888908774498922013-04-28T05:58:00.002-07:002013-04-28T06:09:41.706-07:00DB2 Scripts<div dir="ltr" style="text-align: left;" trbidi="on">
<br />Write the following scripts in a .out file, then execute it by issuing the db2 command with option -tvf.<br /><br /><ul style="text-align: left;">
<li> Reorg for all tables</li>
</ul>
<br />$db2 -x "select 'reorg table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),';'from syscat.tables where type = 'T' " > reorg.out<br /><br />$db2 -tvf reorg.out<br /><br /><ul style="text-align: left;">
<li>Reorgchk for all tables</li>
</ul>
db2 -x "select 'reorgchk update statistics on table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),';' from \<br /> syscat.tables where type = 'T' " > reorgchk.out<br /> <br />$db2 -tvf reorgchk.out<br /><br /><ul style="text-align: left;">
<li> Runstats for all tables</li>
</ul>
db2 -x "select 'runstats on table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),' and indexes all;'from \<br /> syscat.tables where type = 'T' " > runstats.out<br /> <br />$db2 -tvf runstats.out<br /><br /><br />Executing reorg, reorgcheck and runstats for all tables from one specific tablespace.<br /><ul style="text-align: left;">
<li>Reorg for all tables from one specifc tablespace</li>
</ul>
db2 -x "select 'reorg table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),';' \<br /> from syscat.tables where type = 'T' and tbspace='<tablespace_name>'" > reorg.out <br /> <br />$db2 -tvf reorg.out<br /><ul style="text-align: left;">
<li> Reorgchk for all tables from one specifc tablespace</li>
</ul>
db2 -x "select 'reorgchk update statistics on table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),';' from \<br /> syscat.tables where type = 'T' and tbspace='<tablespace_name>'" > reorgchk.out<br /> <br />$db2 -tvf reorgchk.ou<br /><ul style="text-align: left;">
<li>Runstats for all tables from one specifc tablespace</li>
</ul>
db2 -x "select 'runstats on table',substr(rtrim(tabschema)||'.'||rtrim(tabname),1,50),' and indexes all;'from \<br /> syscat.tables where type = 'T' " > runstas.out<br /> <br />$db2 -tvf runstats.out<br /><br /><br /><br /><br /></div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com1tag:blogger.com,1999:blog-9150194622731502834.post-72035724466717770962013-04-28T05:36:00.003-07:002013-04-29T01:15:39.135-07:00Fix Pack Installation—DB2 V9.5 FP<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<b>Pre-Installation Task:</b><br />
<br />
To obtain root id from ServerAdmin prior to start of Migration<br />
Check out the FileSystem space available<br />
The new version FP is Uploaded into Path: Fixpak location in the servers<br />
Pre install Steps<br />
<br />
1.Disable the crontab<br />
2.db2 get admin cfg >admincfg.out<br />
3 db2licm -l > db2licm_before.txt<br />
4 db2 get dbm cfg > dbmcfg_before.txt<br />
5 db2 get admin cfg > admincfg_before.txt<br />
6 db2 list db directory > dbdir_before.txt<br />
7 db2 list node directory > nodedir_before.txt<br />
8 db2 list dcs directory > dcsdir_before.txt<br />
9 db2 get db cfg for <dbname> > dbcfg_<dbname>_before.txt<br />
10 db2set -all > db2set_before.txt<br />
11 db2 list applications show detail > listapplications_before.txt<br />
12 db2 list tablespaces show detail > tablespaces_<DBname>_before.txt (after connecting to each database)<br />
13) db2look -d <db_name> -e -o <(dbname)_look_before.txt> -l -x -f (after connecting to each database)<br />
14) db2 LIST PACKAGES FOR ALL SHOW DETAIL > packages.before<br />
15) db2 "select * from syscat.bufferpools" > bufferpools.before<br />
16) db2 UPDATE DBM CFG USING diaglevel 4 (make sure that we are updating it back to 3 after the install)<br />
<br />
1.db2 force applications all<br />
2.Take the full offline database backups ***<br />
<br />
<b>Steps for Installation:</b><br />
<br />
1) Stop of DB2 Process:<br />
<ul style="text-align: left;">
<li>Make a connection as instance administrator for each instance and execute the following commands:</li>
</ul>
<br />
$db2 force applications all<br />
$db2 terminate<br />
$db2stop<br />
<div>
<div>
<span style="text-indent: 0.5in;"> $</span>db2licd -end (Must be launch on each node)<br />
<br />
<ul style="text-align: left;">
<li> Make a connection as DAS administrator (DAS or root) & Go to Execute the following command </li>
</ul>
$su - <das id> <br />
$db2admin stop<br />
<br />
Stop the Fault Monitor Coordinator and the Fault Monitor<br />
<ul style="text-align: left;">
<li>Login as root and go to /db2/sftw/<instance name> /sqllib/bin and execute the following commnad’s </li>
</ul>
$./db2fmcu -d <br />
$./db2fm -d<br />
login as instance owner, Verify that the IPC interconnection processes are clean with:<br />
cd /db2/sftw/<instance name> /sqllib/bin/<br />
<br />
$>ipclean <br />
$db2fmcu -d...if not running then the following<br />
<br />
from the main session...db2nkill -9...to kill all the db2 processes <br />
again in duplicate session /home/db2dbas/das/bin/db2fm -i db2dbas -D<br />
ps -ef | grep -i db2...to check any db2 process is running or not.<br />
<br />
2) Installation of Fix pack<br />
<br />
Verify that you have atleast 700MB available on /usr/opt <br />
$df -m /opt<br />
Connect as root<br />
Go in DB2 FP repository and launch the following command<br />
$> cd <fix location><br />
$> ./installFixPack -b /opt/IBM/db2/V9.5<br />
<br />
<b>Post Installation steps: </b><br />
<br />
Update and restart of Instances<br />
Update DB2 Instance as root<br />
$cd /opt/IBM/db2/V9.5/instance <br />
$./db2iupdt <instance name><br />
Update DB2 Admin Server db2as as root, <br />
$./dasmigr<br />
$./dasupdt <das id><br />
Stop and Start Admin Server <br />
$db2admin stop<br />
$db2admin start <br />
Update each database as instance owner,<br />
$db2updv95 –d <database Name> <br />
$db2updv95 –d <database Name> <br />
Verify db2level.<br />
<br />
DB21085I Instance "db2inst1" uses "64" bits and DB2 code release "SQL09055" with level identifier "06060107". <br />
Informational tokens are "DB2 v9.5.0.5", "s091123", "U829462", and Fix Pack "5". <br />
Product is installed at "/opt/IBM/db2/V9.5".<br />
<br />
Bind of DB2 UDB Databases:<br />
Connect as instance administrator and launch the following commands<br />
$db2 terminate<br />
$db2 connect to <db name><br />
$cd ~/sqllib/bnd<br />
$db2 BIND @db2ubind.lst BLOCKING ALL GRANT PUBLIC<br />
$db2 BIND @db2cli.lst BLOCKING ALL GRANT PUBLIC<br />
$db2 BIND db2schema.bnd BLOCKING ALL GRANT PUBLIC sqlerror continue<br />
$db2 connect reset<br />
$db2 terminate<br />
<br />
$db2 BIND @applyur.lst isolation ur BLOCKING ALL GRANT PUBLIC<br />
$db2 BIND @applycs.lst isolation cs BLOCKING ALL GRANT PUBLIC<br />
$db2 BIND @capture.lst isolation ur BLOCKING ALL GRANT PUBLIC<br />
<br />
<br />
Stop and Start the Instance<br />
$db2stop<br />
$db2start<br />
<br />
Checking of Table spaces state: <br />
$db2 list tablespaces on <database> | grep -i state<br />
Test some commands after connecting to the database :<br />
$db2 list tables for all<br />
$db2 "select count (*) from schema.table/view"<br />
<br />
$>>Enable the crontabs <br />
<br />
ask the client to test and verify the applications <br />
<br />
Back out plan: <br />
Downgrade DB2 Instance back to DB2 V9.5 fixpak3b as root,<br />
cd /opt/IBM/db2/V9/FP5/instance <br />
./db2iupdt -D <instance name> <br />
Downgrade DB2 Admin Server <br />
./dasupdt –D</div>
<div>
<br />
<br />
<br />
<br /></div>
</div>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-83583823531681397242013-04-25T07:27:00.002-07:002013-04-25T08:19:30.212-07:00Export<div dir="ltr" style="text-align: left;" trbidi="on">
The export utility extracts data from a table into a file.The command supports many different options.Let's start with a simple export command and discuss how to use the options to customize the command. The following example of the export command exports all the rows in the employee table to the file empdata.ixf in IXF format.<br />
<br />
<span style="color: blue;">export to empdata.ixf of ixf select * from employee</span><br />
All the keywords in this command are mandatory. that is, you have to provide theoutput file name , specify the file format, and the SELECT statement that will retrieve the rows to be exported. The exported file can be in a format of DEL, IXF, or WSF.<br />
<br />
Using the optional messages clause you can specify a file name where warning and error messages of the export operation are logged.<br />
<br />
The export command also supports SELECT statements with join. Thus, if you want to export data from two tables, they can be joined as shown example: <br />
<br />
<br />
<br />
export to deptmgr.del of del messages deptmgr.out select deptno, deptname, firstnme, lastname, salary from employee, department where empno = mgrno <br />
<br />
The above example joins the employee and department tables to obtain information for each department manager. If the command is successfully executed, the number of rows exported is returned :Number of rows exported: 8 <br />
<br />
<span style="color: #990000;">SQL3104N</span> The Export utility is beginning to export data to file "c:\deptmgr.del". <br />
<br />
<span style="color: #990000;">SQL3105N</span> The Export utility has finished exporting "8" rows. <br />
<br />
<span style="color: blue;">export to deptmgr.del of del <span style="color: yellow;">modified by coldel</span>; messages deptmgr.out select deptno, deptname, firstnme, lastname, salary from employee, department where empno = mgrno</span> <br />
<br />
<span style="color: blue;">export to deptmgr.del of del modified by coldel; chardel'' <span style="color: yellow;">messages deptmgr</span>.out select deptno, deptname, firstnme, lastname, salary from employee, department where empno = mgrno</span><br />
<br />
<span style="color: blue;">export to deptmgr.del of del <span style="color: yellow;">modified by coldel; chardel'' timestampformat="yyyy.mm.dd hh:mm"</span> messages deptmgr.out select deptno, deptname, firstnme, lastname, salary from employee, department where empno = mgrno</span><br />
<span style="color: blue;"></span><br />
<span style="color: blue;">export to mgrresume.del of del messages mgrresume.out lobs to c:\lobs <span style="color: yellow;">lobfile resume</span> modified by lobsinfine select deptno, deptname, firstnme, lastname, resume from employee a, emp_resume b where a.empno = b.empno</span><br />
<span style="color: blue;"></span><br />
<span style="color: blue;">SELECT empno, firstnme, lastname, salary * 1.3 FROM employee WHERE workdept='A00'</span><br />
<span style="color: blue;"></span><br />
<span style="color: blue;"> export to newsalary.ixf of ixf messages newsalary.out <span style="color: yellow;">method n ('EMPLOYEENO', 'FIRSTNAME', 'LASTNAME', 'NEWSALARY')</span> select empno, firstnme, lastname, salary * 1.3 from employee where workdept='A00' </span><br />
<span style="color: blue;"></span><br />
<br />
<br /></div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-47071055182246116652013-04-25T07:26:00.000-07:002013-04-25T07:41:22.170-07:00DB2 data movement utilities<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
DB2 data movement utilities. The utilities provide a way to move data from one database to another. The source and target databases can be the same instance, in different instances on the same server, on different servers on the same platform, or on different platforms entirely.<br />
<br />
<br />
<br />
<img border="0" src="http://flylib.com/books/2/99/1/html/2/images/0131859161/graphics/12fig01.gif;382543" /><br />
<br />
<br />
To extract data from a table in a database, you use the export utility. The import and load utilities insert data from the input files into a specified table. db2move is a batch version of the data movement utilities; it can export, import, or load multiple tables with just one command.<br />
<div>
</div>
<div>
Input/Output File Types:</div>
<div>
</div>
<ol style="text-align: left;">
<li> Delimited ASCII (DEL) </li>
<li> Non-delimited ASCII (ASC) </li>
<li> PC version of Integrated Exchange Format (PC/IXF) </li>
<li> Worksheet format (WSF) </li>
<li> Cursor</li>
</ol>
<br />
<div style="text-align: left;">
</div>
<strong>Delimited ASCII (DEL) Format</strong>: this file format contains a stream of ASCII characters that are separated by row and column delimiters. Comma (,) is the default column delimiter and the carriage return is the default row delimiter. For character strings, DB2 uses double quotes ( " " ) as the string delimiter.<div>
</div>
<strong>Non-delimited ASCII (ASC) : </strong>The ASC file format is also known as fixed length ASCII file format because each column length in the file has the same length as defined for the corresponding column definition in the table.<br />
<br />
<strong>PC version of Integrated Exchange Format (PC/IXF) : </strong>PC/IXF (or simply IXF) files cannot be edited with a normal text editor. It uses the IXF data interchange architecture, which is a generic relational database exchange format that lets you move data among DB2 databases. PC/IXF can only be used for moving data between DB2 databases because it is an IBM proprietary format. In addition to data, the file also contains the data types and structure of the table. Therefore it can be used to first create the table in the target database and then import data.<div>
<span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 16px/normal "Trebuchet MS"; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></span> </div>
<strong>Worksheet format (WSF) : </strong>WSF files are Lotus 1-2-3 and Symphony worksheets that the database manager supports. Any file names with these extensions are accepted: WKS, WK1, WRK, WR1, and WJ2. WSF files are mainly used for moving data between DB2 and these worksheets.<div>
</div>
<strong>Cursor :</strong> The cursor format lets you load data into a table using a cursor. The cursor must be declared against an SQL query first before it can be referenced in the load command. You can only use the cursorfile format with the load utility.<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-9478439792651753472013-04-22T05:37:00.000-07:002013-04-24T05:28:00.796-07:00Troubleshooting db2 error " SQL0551N "<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: arial, verdana, helvetica, sans-serif; font-size: 12pt; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; margin-bottom: 9pt; margin-top: 0pt; padding-bottom: 0pt; padding-top: 0pt; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
</h1>
<a href="https://www.blogger.com/null" name="980209" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></a><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></span><br />
<div class="firstparainsection" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: verdana, arial, helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 5pt; margin-top: 0pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span class="runintext" style="font-weight: bold;">Error Message : SQL0551N "user does not have the privilege to perform operation GRANT" </span><span class="Apple-converted-space"> </span><a href="https://www.blogger.com/null" name="980210"></a></div>
<div class="firstparainsection" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: verdana, arial, helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 5pt; margin-top: 0pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
If you receive this message from the DB2 client while connecting to DB2 , you may have to bind the DB2 utility programs to the database. You must apply the procedure to each database you are using with the application server. Here is the binding procedure:</div>
<ol style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: verdana, arial, helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="980217"></a>Log in as your DB2 instance user (such as db2inst1), change to the bnd subdirectory of the instance, and start the DB2 utility.</div>
<pre style="color: maroon; font-family: "lucida console", "letter gothic mt", "courier new", courier, monospace; line-height: 13px; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;"> db2inst1@mymachine> cd sqllib/bnd
db2inst1@mymachine> db2
</pre>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="980222"></a>Connect to your database as the DB2 administrator:</div>
<pre style="color: maroon; font-family: "lucida console", "letter gothic mt", "courier new", courier, monospace; line-height: 13px; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;"> db2 => connect to mydatabase user db2admin using db2admin
</pre>
<div style="font-family: verdana, arial, helvetica, sans-serif; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="980226"></a>You will see the following info:</div>
<pre style="color: maroon; font-family: "lucida console", "letter gothic mt", "courier new", courier, monospace; line-height: 13px; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;"> Database Connection Information
Database server = DB2/NT 6.1.0
SQL authorization ID = DB2ADMIN
Local database alias = MYDATABASE
</pre>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif;"><pre style="color: maroon; font-family: "lucida console", "letter gothic mt", "courier new", courier, monospace; line-height: 13px; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;"><ol style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; border: 0px currentColor; color: #333333; font-size-adjust: none; font-stretch: normal; font: 13px/15px Arial, sans-serif; letter-spacing: normal; list-style: decimal !important; margin: 0px; outline: 0px; padding: 0px 0px 0px 20px; text-indent: 0px; text-transform: none; vertical-align: baseline; white-space: normal; word-spacing: 0px;">
<li style="border: 0px currentColor; font-family: Arial, sans-serif; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Get the list of authorities for this authorization ID.<span class="Apple-converted-space"> </span>
For example:
SELECT * FROM<span class="Apple-converted-space"> </span>TABLE (SYSPROC.AUTH_LIST_AUTHORITIES_FOR_AUTHID ('BOB', 'U'))AS T<span class="Apple-converted-space"> </span>
ORDER BY AUTHORITY</li>
<li style="border: 0px currentColor; font-family: Arial, sans-serif; font-size: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">(Optional) Grant any missing authorities.<span class="Apple-converted-space"> </span>
For example:
GRANT DBADM ON DATABASE TO USER BOB</li>
</ol>
</pre>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="980233"></a>Run the first bind command:</div>
<pre style="color: maroon; font-family: "lucida console", "letter gothic mt", "courier new", courier, monospace; line-height: 13px; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;"> db2 => bind @db2ubind.lst blocking all grant public
</pre>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="980237"></a>Run the second bind command:</div>
<pre style="color: maroon; font-family: "lucida console", "letter gothic mt", "courier new", courier, monospace; line-height: 13px; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;"> db2 => bind @db2cli.lst blocking all grant public
</pre>
</li>
</ol>
<br /></div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-64195106021916711332013-04-22T05:32:00.001-07:002013-04-22T05:32:40.058-07:00configure the DB2 client connection / Catalog the DB2 Database<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-size: x-small;"><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: verdana, arial, helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class="firstparainsection" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-size-adjust: none; font-stretch: normal; font: 8pt/normal verdana, arial, helvetica, sans-serif; letter-spacing: normal; margin-bottom: 5pt; margin-top: 0pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span class="runintext" style="font-weight: bold;"> </span><span class="Apple-converted-space"> <strong>Windows NT</strong></span><a href="https://www.blogger.com/null" name="976420"></a> <span style="font-size: x-small;">The application server connects using DB2 client<span class="Apple-converted-space"> </span><span class="colorbold" style="color: slategrey; font-weight: bold;">aliases</span>. These aliases are configured using IBM's Client Configuration Assistant. login must have administrator authority and the ID must be no longer than eight characters. You need to be the DB2 administrator or have administrator privileges to complete these steps.</span></div>
<a href="https://www.blogger.com/null" name="963170" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></a><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></span><div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-size-adjust: none; font-stretch: normal; font: 8pt/normal verdana, arial, helvetica, sans-serif; letter-spacing: normal; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span class="Apple-converted-space"></span> </div>
<div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-size-adjust: none; font-stretch: normal; font: 8pt/normal verdana, arial, helvetica, sans-serif; letter-spacing: normal; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span class="Apple-converted-space"> </span><span class="proceduretext" style="font-weight: bold;">To create a new DB2 client alias:</span></div>
</span></span><span style="font-size: x-small;"><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: verdana, arial, helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></span></span><span style="font-size: x-small;"><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: verdana, arial, helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: bold 11px/normal verdana, arial, helvetica, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"> </span></span></span><br />
<span style="font-size: x-small;"><ol style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-size-adjust: none; font-stretch: normal; font: 8pt/normal verdana, arial, helvetica, sans-serif; letter-spacing: normal; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif; font-size: 8pt;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
Open the DB2 Client Configuration Assistant from the DB2 for Windows NT program folder.</div>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif; font-size: 8pt;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="963172"></a>Click the<span class="Apple-converted-space"> </span><span class="colorbold" style="color: slategrey; font-weight: bold;">Add</span><span class="Apple-converted-space"> </span>button at the top right of the Client Configuration Assistant screen. Select<span class="Apple-converted-space"> </span><span class="colorbold" style="color: slategrey; font-weight: bold;">Next</span><span class="Apple-converted-space"> </span>to continue.</div>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif; font-size: 8pt;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="963173"></a>Choose to manually configure a connection to a DB2 database. Select<span class="Apple-converted-space"> </span><span class="colorbold" style="color: slategrey; font-weight: bold;">Next</span><span class="Apple-converted-space"> </span>to continue.</div>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif; font-size: 8pt;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="963174"></a>Choose the appropriate protocol (default is TCP/IP). Select<span class="Apple-converted-space"> </span><span class="colorbold" style="color: slategrey; font-weight: bold;">Next</span><span class="colorbold" style="color: slategrey; font-weight: bold;"><span class="Apple-converted-space"> </span></span>to continue.</div>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif; font-size: 8pt;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="963175"></a>Choose the appropriate platform or LAN-based.</div>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif; font-size: 8pt;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="963176"></a>Configure the DB2 server host name, TCP port number, and service name (optional) that your DB2 server is operating on. Select<span class="Apple-converted-space"> </span><span class="colorbold" style="color: slategrey; font-weight: bold;">Next</span><span class="Apple-converted-space"> </span>to continue.</div>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif; font-size: 8pt;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="963177"></a>Enter the target database name. Select<span class="Apple-converted-space"> </span><span class="colorbold" style="color: slategrey; font-weight: bold;">Next</span><span class="Apple-converted-space"> </span>to continue.</div>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif; font-size: 8pt;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="963178"></a>Enter the alias name (you will use this name later to add the database to the application server). Select<span class="Apple-converted-space"> </span><span class="colorbold" style="color: slategrey; font-weight: bold;">Next</span><span class="colorbold" style="color: slategrey; font-weight: bold;"><span class="Apple-converted-space"> </span></span>to continue.</div>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif; font-size: 8pt;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="963179"></a>(Optional) Register these settings as an ODBC data source. This step is not required but is recommended.</div>
</li>
<li style="font-family: "arial black", verdana, arial, helvetica, sans-serif; font-size: 8pt;"><div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
<a href="https://www.blogger.com/null" name="965871"></a>Finally, test the connection from inside the Client Configuration Assistant.</div>
</li>
</ol>
<div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
</div>
<div class="listspacerpara" style="font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt;">
</div>
<div class="runinpara" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: verdana, arial, helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 5pt; margin-top: 9pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span class="runintext" style="font-weight: bold;">Solaris </span><span class="Apple-converted-space"> T</span>o establish a connection to your DB2 database, enter the DB2 command-line processor and enter the following two commands.</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: maroon; font-family: "lucida console", "letter gothic mt", "courier new", courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 13px; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; word-spacing: 0px;"> <span style="font-size: small;">catalog tcpip node <em><node name></em> remote <<span class="genericitalic" style="font-style: italic;">servername> </span>server<span class="genericitalic" style="font-style: italic;"> <portno</span>>
</span></pre>
<a href="https://www.blogger.com/null" name="976435" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></a><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></span><div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: verdana, arial, helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
where<span class="Apple-converted-space"> </span><span class="genericitalic" style="font-style: italic;">tcpipnodealias</span><span class="Apple-converted-space"> </span>is the local alias for your DB2 server (usually the same as the servername),<span class="Apple-converted-space"> </span><span class="genericitalic" style="font-style: italic;">servername</span><span class="Apple-converted-space"> </span>is the name of the DB2 server, and<span class="Apple-converted-space"> </span><span class="genericitalic" style="font-style: italic;">port#<span class="Apple-converted-space"> </span></span>is the port on the database server that is set to receive TCP/IP calls.</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: maroon; font-family: "lucida console", "letter gothic mt", "courier new", courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 13px; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; word-spacing: 0px;"> <span style="font-size: small;">catalog database <<span class="genericitalic" style="font-style: italic;">dbname></span> as <<span class="genericitalic" style="font-style: italic;">aliasname></span> at node <node name></span>
</pre>
<a href="https://www.blogger.com/null" name="976842" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></a><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></span><div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: verdana, arial, helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
where<span class="Apple-converted-space"> </span><span class="genericitalic" style="font-style: italic;">databasename</span><span class="Apple-converted-space"> </span>is the actual database name,<span class="Apple-converted-space"> </span><span class="genericitalic" style="font-style: italic;">aliasname</span><span class="Apple-converted-space"> </span>is the local name of the database (which may be the same as the actual name), and<span class="Apple-converted-space"> </span><span class="genericitalic" style="font-style: italic;">tcpipnodealias</span><span class="Apple-converted-space"> </span>is the name given in the first catalog statement.</div>
<a href="https://www.blogger.com/null" name="976445" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></a><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-family: "Times New Roman"; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></span><div style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: verdana, arial, helvetica, sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
To test the DB2 connection:</div>
<pre style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: maroon; font-family: "lucida console", "letter gothic mt", "courier new", courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 13px; margin-bottom: 5pt; margin-top: 5pt; padding-bottom: 0pt; padding-top: 0pt; text-indent: 0px; text-transform: none; word-spacing: 0px;"> <span style="font-size: small;">connect to <span class="genericitalic" style="font-style: italic;">aliasname</span> user <<span class="genericitalic" style="font-style: italic;">userid></span> using <<span class="genericitalic" style="font-style: italic;">password></span></span></pre>
<br />
<br /></span> </div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-86497778278988795882013-04-19T11:15:00.001-07:002013-04-22T04:13:29.022-07:00DB2 System Commands<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div align="center" class="MsoNormal" style="text-align: center;">
<b><i><u><span style="font-family: "Verdana","sans-serif"; font-size: 10pt;">db2Command Line
Utilities<o:p></o:p></span></u></i></b></div>
<div class="MsoNormal" style="margin-left: 14.15pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l28 level1 lfo1; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2admin</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- DB2 Administration Server<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 28.35pt; text-indent: 7.1pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> It is used to start and stop the
administration server.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 106.35pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Step1: su dasusr1<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 106.35pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Step2: cd
/home/dasusr1/das/bin<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 106.35pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Step3:./db2admin
start<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l28 level1 lfo1; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2cc</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
– Starts the Control Center.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 28.35pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l20 level1 lfo2; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2cmd</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Open DB2 Command Window<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex:
]$ db2cmd<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l27 level1 lfo3; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2fs</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- First Steps<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 47.25pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Launches the
First Steps GUI, which contains links to the functions users need to begin
learning about and using DB2.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex:
]$ db2fs<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l23 level1 lfo4; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2eva</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
-Event Analyzer<o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: .75in;">
Starts the event analyzer,
allowing the user to trace performance data produced by DB2 event monitors that
have their data directed to files. </div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex: ]$ db2eva<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l15 level1 lfo5; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2evmon
</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">- Event Monitor
Productivity Tool<o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 106.35pt; text-indent: .35pt;">
Formats
event monitor file and named pipe output, and writes it to standard output.</div>
<div class="MsoNormal" style="margin-left: 71.25pt; text-indent: -.5in;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Syntax:</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
db2evmon –db <database-alias> evm <event-monitor-name>
'path-event- <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 71.25pt; text-indent: -35.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> monitor-target'<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex: ]$ db2evmon -db sample -evm sample<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l31 level1 lfo6; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2set</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- DB2 Profile Registry Command. Displays, sets, or removes DB2 profile <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 53.45pt; text-indent: 17.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> variables. An External<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 80.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">environment
registry command that supports local and remote administration, via the DB2 Administration Server, of DB2's
environment variables stored in the DB2 profile registry.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex: ]$db2set DB2AUTOSTART=YES<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 14.15pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l26 level1 lfo7; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2ckmig</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Database Pre-migration Tool<o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 91.5pt;">
Verifies that a database can
be migrated. For detailed information about using this tool, see one of the
Quick Beginnings books.</div>
<div class="WW-BodyText2">
<br /></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> <b>Syntax:</b> db2ckmig sample -l /home/db2inst1/mig.txt<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex:</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
]$ db2ckmig sample
-l /home/itlokam/mig.txt<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> db2ckmig
was successful. Database(s) can be migrated.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l18 level1 lfo8; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2ckbkp</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Check Backup<o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 106.35pt; text-indent: 2.6pt;">
This
utility allows the user to test the integrity of a backup image and determine
whether or not it can be restored. </div>
<div class="MsoNormal" style="margin-left: 70.9pt; text-indent: -35.65pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Ex
: ]$ db2ckbkp -a
SAMPLE.0.itlokam.NODE0000.CATN0000.20060728215319.001<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> '<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> '<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Image Verification Complete
– successful.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l0 level1 lfo9; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2ckrst</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- It gives the restore command options
of the backup timestamp<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Syntax:</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
db2ckrst -d <database name> -t <timestamp><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex: </span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">]$ db2ckrst -d sample -t 20060728215319<o:p></o:p></span></div>
<div class="WW-BodyText2">
Suggested restore order of images using timestamp 20060728215319
for database sample.</div>
<div class="MsoNormal" style="margin-left: .75pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">=================================
========================<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Suggested restore
order of image using timestamp 20060728215319 for database sample.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">=================================
=========================<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l35 level1 lfo10; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2rfpen
</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">- Reset rollforward pending state Command <o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 102.2pt;">
Puts a database in
rollforward pending state. If you are using high availability disaster recovery
(HADR), the database is reset to a standard database. </div>
<div class="MsoNormal" style="margin-left: .75pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex: ]$ db2rfpen on sample <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l13 level1 lfo11; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2logsforrfwd</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- List Logs Required for Rollforward Recovery Command <o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 106.35pt; text-indent: .15pt;">
This
utility allows a user to find out which log files are required for a table
space rollforward operation. </div>
<div class="WW-BodyText2" style="margin-left: .75pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Ex: </span><span style="font-family: "Verdana","sans-serif"; font-size: 8pt;">bin]$ db2logsForRfwd
/home/itlokam/itlokam/NODE0000/SQL00001/DB2TSCHG.HIS<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">----------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Log file
number : S0000000.LOG<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Tablespace
ID :<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">----------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Log file
number : S0000001.LOG<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Tablespace
ID :<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">----------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Log file
number : S0000002.LOG<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Tablespace
ID : 2 3<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">----------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Log file
number : S0000003.LOG<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Tablespace
ID :<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">----------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Log file
number : S0000004.LOG<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Tablespace
ID : 2<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">----------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Log file
number : S0000005.LOG<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Tablespace
ID : 3<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">----------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Log file number : S0000006.LOG<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Tablespace
ID : 3<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">----------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Log file
number : S0000007.LOG<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Tablespace
ID : 3<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">----------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Log file
number : S0000008.LOG<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Tablespace
ID : 0 3<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">----------------------------------------------------------<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Log file
number : S0000009.LOG<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l21 level1 lfo12; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2batch</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Benchmark Tool<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 69pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">It Reads SQL
statements from either a flat file or standard input, dynamically prepares and
describes the statements, and returns an answer set. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Syntax: db2batch -d database name<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -f
filename<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -a username/password<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -r output file<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex: ]$ db2batch -d sample -f / home/itlokam/sam.txt -r
/home/itlokam/res.txt<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Bind is successful. Used bindfile:
/home/itlokam/sqllib/bnd/db2batch.bnd<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Running in Embedded Dynamic mode.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l32 level1 lfo13; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2bfd</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Bind File Description Tool<o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 57pt;">
Displays the contents of a
bind file. This utility, which can be used to Examine and to verify the SQL
statements within a bind file, as well as to display the precompile options
used to create the bind file, may be helpful in problem determination related
to an application's bind file.</div>
<div class="WW-BodyText2">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex:
]$db2bfd -b
/home/db2inst1/sqllib/bnd/db2am.bnd <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l36 level1 lfo14; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2level</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Show DB2 Service Level Command <o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 63pt;">
Shows the current Version and
Service Level of the installed DB2 product. Output from this command goes to
the console by default. </div>
<div class="WW-BodyText2">
<br /></div>
<div class="WW-BodyText2">
Ex: ]$ db2level</div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">DB21085I Instance "itlokam" uses
"32" bits and DB2 code release "SQL08020" with level identifier
"03010106".<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Informational
tokens are <b>"DB2 v8.1.0.64"</b>, "s040812",
"MI00086", and <b>FixPak "7"</b>.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Product is
installed at "/opt/IBM/db2/V8.1".<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l6 level1 lfo15; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2relocatedb</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
:It will rename the database<o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 35.45pt;">
Step1: Create a
file with name relocate.cfg and add the following contents</div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
DB_NAME=TESTDB,PRODDB<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
DB_PATH=/home/db2inst1<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
INSTANCE=db2inst1<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
NODENUM=0 <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">
Step2: db2relocatedb /home/db2inst1/relocate.cfg<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l4 level1 lfo16; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2cfExp</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Connectivity Configuration Export Tool<o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 69pt;">
Exports connectivity
configuration information to an Export profile, which can later be imported at
another DB2 Universal Database (UDB) workstation instance of similar instance type.</div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex: ]$ db2cfExp /home/db2inst1/profile.txt<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l17 level1 lfo17; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2cfimp
</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">- Connectivity Configuration Import Tool<o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 69pt;">
Imports connectivity
configuration information from a file known as a configuration profile. </div>
<div class="MsoNormal" style="margin-left: 69.0pt; text-indent: .75pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">This
utility can be used to duplicate the connectivity information from another
similar instance that was configured previously. It is especially useful on
workstations that do not have the DB2CCA GUI tool installed, and in situations
where multiple similar remote UDB clients are to be installed, configured, and
maintained.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Ex: ]$ db2cfimp /home/db2inst1/profile.txt<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l19 level1 lfo18; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2tbst</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Get Tablespace State. Accepts a hexadecimal table space state value, and <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">returns the
state. The state value is part of the output from LIST ABLESPACES. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step1: Issue LIST TABLESPACES.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step2: Copy the STATE value in that.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"> Step3:
db2tbst 0x0000<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l34 level1 lfo19; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2uiddl</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Prepare Unique Index Conversion to V5 Semantics. Used to create DDL for <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt; text-indent: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> all indexes into a flat file.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex:
</span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">]$ </span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2uiddl
-d s > /home/db2inst1/sam.txt<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l9 level1 lfo20; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2trc
</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">- Trace<o:p></o:p></span></div>
<div class="WW-BodyText2">
Controls the trace facility of a DB2
instance or the DB2 Administration Server.</div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">Ex: ]$ db2trc dmp db2trc.dmp <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l37 level1 lfo21; tab-stops: list .5in; text-indent: -.25in;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">>db2icrt
</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">– Used to create Instance<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step1: Create a user db2inst2 and
add it to db2grp<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step2: Switch to root<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step3: cd /opt/IBM/db2/V8.1/instance<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Step4: ./db2icrt -a server -u
db2fenc1 db2inst2<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l10 level1 lfo22; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">db2start</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">
- Start DB2.Starts the current database manager instance background <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 88.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">processes on a
single database partition<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">EX: ]$ db2start<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l22 level1 lfo23; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">db2stop</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">
- Stop DB2.Stops the current database manager instance.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> EX:
]$ db2stop<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l7 level1 lfo24; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2idrop</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Remove Instance<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step1: Switch to root<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step2: cd /opt/IBM/db2/V8.1/instance<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Step3: ./db2idrop db2inst2<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l3 level1 lfo25; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2ilist</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- List Instances<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 14.15pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step1: Switch to root<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step2: cd /opt/IBM/db2/V8.1/instance<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step3: ./db2ilist<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l11 level1 lfo26; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2imigr</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
– To Migrate Instance from lower version to higher version<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 14.15pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex: </span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">]$ </span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2imigr db2inst1
db2viper1<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l25 level1 lfo27; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2iupdt</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Update Instances<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step1: Switch to root<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Step2: cd /opt/IBM/db2/V8.1/instance<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Step3: ./db2iupdt db2inst1<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l24 level1 lfo28; tab-stops: list .5in; text-indent: -.25in;">
<span style="font-family: Wingdings; font-size: 9.0pt; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span>><b><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">db2iset – </span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">It is used to set the registry variables
for db2 <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">instance]# ./db2iset<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">DB2NTNOCACHE=ON<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">DB2COMM=TCPIP<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">DB2AUTOSTART=YES<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">[root@ITLSYS64 instance]# ./db2iset
DB2AUTOSTART=YES<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">[root@ITLSYS64 instance]# ./db2iset<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">DB2NTNOCACHE=ON<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">DB2COMM=TCPIP<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="color: maroon; font-family: "Verdana","sans-serif"; font-size: 9pt;">DB2AUTOSTART=YES<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l30 level1 lfo29; tab-stops: list .5in; text-indent: -.25in;">
<span style="font-family: Wingdings; font-size: 9.0pt; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span>><b><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">db2isetup - </span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">Creation of instance through GUI<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">Ex: instance]#
./db2isetup<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 14.15pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l16 level1 lfo30; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2advis
</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">- DB2 Index Advisor<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Advises users on what indexes to
create for one or more SQL statements.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> syntax:
db2advis -d
dataname<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 106.35pt; text-indent: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -w
workload name<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 106.35pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
-s statement<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 106.35pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
-i filename<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 106.35pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
-a userid<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 106.35pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
-l disk limit<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 106.35pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
-passwd password<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 106.35pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
-t maxadvisetime<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Ex: ]$ db2advis -d sample -i
/home/db2inst1/db2advis.in -t 5<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .75pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Using user id as default
schema name. Use -n option to specify schema<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Explain tables not set
up properly for schema ITLOKAM<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> The insert into the
ADVISE_INSTANCE table has failed.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> 0 solutions were
evaluated by the advisor<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> exiting with error code
[-219]<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2audit</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Audit Facility Administrator Tool<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Step1:
Configuring the audit facility.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> db2audit configure scope all status
both<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Step2: Starting
the audit facility.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> db2audit start<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Step3: Checking
the log file<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> cd /home/db2inst1/sqllib/security<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Open db2audit.log<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Check for the logs<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Step4: Stopping
the audit<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> db2audit stop<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l1 level1 lfo32; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2empfa
</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">- Enable Multi-page File Allocation<o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 70.9pt; text-indent: 1.85pt;">
Enables the
use of multi-page file allocation for a database. With multi-page file
allocation enabled for SMS table spaces, disk space is allocated one Extent
rather than one page at a time.</div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex:
</span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">]$ </span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2empfa
sample<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l8 level1 lfo33; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2ldcfg</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- Configure LDAP Environment. Configures the Lightweight Directory Access <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> </span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Protocol (LDAP)
user distinguished name (DN) and password for the <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> current logon user in an LDAP environment
using an IBM LDAP client.<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Syntax:
db2ldcfg -u <username> -w<password> -r<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex: <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l33 level1 lfo34; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2licm</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">
- License Management Tool<o:p></o:p></span></div>
<div class="WW-BodyText2" style="margin-left: 35.45pt; text-indent: 24.55pt;">
Performs
basic license functions in the absence of the Control Center. Adds, removes,
lists, and modifies licenses and policies installed on the local system.</div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">-a: Adds a
license for a product. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">-e: Updates the
enforcement policy on the system. Valid
values are: HARD and SOFT. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">-p: Updates the
license policy type to use on the system.
The keywords CONCURRENT, REGISTERED, or CONCURRENT REGISTERED can be
specified. Specify OFF to turn off all
policies.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">-r: Removes the
license for a product. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">-u: Updates the
number of user entitlements that have been purchased. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">-c: Updates the
number of connector entitlements that have been purchased. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">-n: Updates the
number of entitled processors. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">-l: Lists all the
products with available license information, including the product identifier.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">-v: Displays
version information.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -? Displays help information. <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex:
</span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">]$ </span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2licm
-a db2ese.lic<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> db2licm –v : o/p
8.2<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l14 level1 lfo36; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2sql92
</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">- SQL92 Compliant SQL Statement Processor. Reads SQL
statements from either a flat file or standard input, dynamically
describes and prepares the statements, and returns an answer set. Supports concurrent connections
to multiple databases.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Step1: Create a
file with name statements.sql<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Step2: Add the
SQL statements <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Select * from
employee;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">Step3: db2sql92
-d s -f /home/db2inst1/statements.sql -r /home/db2inst1/response.sql<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .25in;">
<br /></div>
<div class="MsoNormal" style="margin-left: .25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2mtrk
</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">- Memory Tracker Command. It will give the memory
details of db2 instance <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt; text-indent: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> and database<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Ex: ]$ db2mtrk -i -d -v -r 10<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Tracking Memory on:
2006/07/28 at 23:41:38<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">Memory for
instance<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Database Monitor Heap is of size 163840
bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Other Memory is of size 1163264 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Total: 1327104 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<br /></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">Memory for
database: SAMPLE<o:p></o:p></span></b></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Backup/Restore/Util Heap is of size 16384
bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Package Cache is of size 638976 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Catalog Cache Heap is of size 196608 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Buffer Pool Heap is of size 838631424 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Buffer Pool Heap is of size 655360 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Buffer Pool Heap is of size 393216 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Buffer Pool Heap is of size 262144 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Buffer Pool Heap is of size 196608 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Lock Manager Heap is of size 491520 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Database Heap is of size 3473408 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Other Memory is of size 0 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> Total: 844955648 bytes<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 141.8pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">Tracking Memory
on: 2006/07/28 at 23:41:48<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l2 level1 lfo37; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2look
</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">- DB2 Statistics and DDL Extraction Tool<o:p></o:p></span></div>
<div class="WW-BodyText2">
Extracts the required DDL (data definition
language) statements to reproduce the database objects of a production database on a
test database. db2look generates the DDL statements by object
type</div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -d: Database Name: This must be specified<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -e: Extract DDL file needed to duplicate
database<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -xs: Export XSR objects and generate a script
containing DDL statements<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -xdir: Path name: the directory in which XSR
objects will be placed<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -u: Creator ID: If -u and -a are both not
specified then $USER will be u sed<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -z: Schema name: If -z and -a are both
specified then -z will be ignored<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -t: Generate statistics for the specified
tables<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -tw: Generate DDLs for tables whose names
match the pattern criteria (wil dcard characters) of</span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> the table name<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -h: More detailed help message<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -o: Redirects the output to the given file
name<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -a: Generate statistics for all creators<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -m: Run the db2look utility in mimic mode<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -r: Do not generate RUNSTATS statements for
mimic<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -l: Generate Database Layout: Database partition
groups, Bufferpools and Tablespaces<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -x: Generate Authorization statements DDL
excluding the original definer of the
object<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -xd: Generate Authorization statements DDL
including the original definer of the
object<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -f: Extract configuration parameters and
environment variables<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -td: Specifies x to be statement delimiter
(default is semicolon(;))<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -i: User ID to log on to the server where the
database resides<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -w: Password to log on to the server where the
database resides<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -noview: Do not generate CREATE VIEW ddl
statements<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -wrapper: Generates DDLs for federated objects
that apply to this wrapper<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -server: Generates DDLs for federated objects
that apply to this server<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -nofed: Do not generate Federated DDL<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -fd: Generates db2fopt statements for opt_buffpage
and opt_sortheap along with other cfg
and </span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">env parameters.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -v: Generate DDL for view only, this option is
ignored when -t is specif ied<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -dp: Generate DROP statement before CREATE
statement<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> -ct: Generate DDL Statements by object creation
time<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-left: 35.45pt;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;"> Ex: </span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;"> ]$</span><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 10.0pt;">db2look
-d s -e -o /home/db2inst1/script.sql <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-left: .5in; mso-list: l29 level1 lfo38; tab-stops: list .5in; text-indent: -.25in;">
><b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">db2pd</span></b><span style="font-family: "Verdana","sans-serif"; font-size: 9.0pt; mso-bidi-font-size: 6.0pt;">:
As it’s a very important command line utility Refer to IBM site<o:p></o:p></span></div>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-34877167761934320012013-04-19T11:03:00.001-07:002013-04-19T11:08:24.596-07:00DB2 Replication<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<h2 style="text-align: left;">
Replication :</h2>
<div>
<br />
<div style="background-color: white; color: #31260a; font-family: Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 10px; margin-top: 10px;">
<a href="http://db2dbastuff.blogspot.in/2013/04/configuring-hadr-environment.html" target="_blank">Replication</a> is the copying of data from one place to another. Data can be extracted by programs, transported to some other location, and then loaded at the receiving location. A more efficient alternative is to extract only the changes since the last processing cycle and transport/apply those to the receiving location.</div>
<div style="background-color: white; color: #31260a; font-family: Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 10px; margin-top: 10px;">
Data may be filtered and transformed during replication. There may be other requirements for replication, such as time constraints. In most cases, replication must not interfere with existing applications and have minimal impact on production systems. The replication processes need to be managed and monitored.</div>
<div style="background-color: white; color: #31260a; font-family: Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 10px; margin-top: 10px;">
<br /></div>
<div style="background-color: white; color: #31260a; font-family: Helvetica, Arial, sans-serif; font-size: 13px; line-height: 18px; margin-bottom: 10px; margin-top: 10px;">
</div>
<h2 style="color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 1.3em; font-weight: normal; padding: 0px; vertical-align: bottom; width: 774px;">
Who uses IBM DB2 Replication and Why?</h2>
<div style="margin-bottom: 10px; margin-top: 10px;">
<b>A business organization that wants to build distributed system</b></div>
<div style="margin-bottom: 10px; margin-top: 10px;">
Data distribution is a tool that helps companies put necessary data in the hands of local decision-makers yet maintain firm central control over the data. With IBM DB2 replication, data can be shared and replicated between databases, allowing system designers to put the data where it's needed</div>
<div style="margin-bottom: 10px; margin-top: 10px;">
<b>A business organization that wants to have additional backup strategy</b></div>
<div style="margin-bottom: 10px; margin-top: 10px;">
In conjunction with backup, IBM DB2 replication strategies seek to complement traditional approaches by providing alternative levels of data protection and integrity, while minimizing user disruptions. Replication creates a point-in-time copy of the data to be used as the backup source</div>
<div style="margin-bottom: 10px; margin-top: 10px;">
<b>A business organization who wants to set up a High Availability failover system</b></div>
<div style="margin-bottom: 10px; margin-top: 10px;">
DB2 <a href="http://db2dbastuff.blogspot.in/2013/04/configuring-hadr-environment.html" target="_blank">High Availability Disaster Recovery</a> (HADR) is a database replication feature that provides a high availability solution for both partial and complete site failures. HADR protects against data loss by replicating data changes from a source database, called the primary, to a target database, called the standby. In case of a failure the takeover by the standby database only takes seconds since the standby database server is already up and running. HADR also lets you manage planned downtime such as routine maintenance and software upgrades between connected servers.</div>
<br />
</div>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-43635966875310601582013-04-18T05:19:00.003-07:002013-04-18T05:33:42.635-07:00Enabling AUTORESIZE for DMS tablespaces on DB2 V9<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal" style="line-height: 18pt; margin: 0in 0in 6pt;">
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">When
migrating DB2 V8 databases to DB2 V9 or when creating DMS (non automatic
storage tablespaces) on DB2 V9 might be a good practice to enable autoresize
for these tablespaces<o:p></o:p></span></div>
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;">example:</span><br />
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"></span><br />
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><span style="color: black; font-family: "Courier New"; font-size: 9pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"> db2
create db test automatic storage no on /home/dbpath</span></span><br />
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><span style="color: black; font-family: "Courier New"; font-size: 9pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><span style="font-family: Times New Roman;">
</span></span></span><br />
<div class="MsoNormal" style="line-height: 18pt; margin: 0in 0in 9pt;">
<span style="color: #76797c; font-family: "Verdana","sans-serif"; font-size: 7.5pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"> </span><span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";">db2
create tablespace <strong>ts1</strong> managed by database using (file 'c:\temp\data\cont1.dat'
1000)</span><br />
<br />
<span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";"><o:p>These are the ddl's which i am having the my test databse and ts1 tablespace .so my tablespace continuously getting error (un allocated new pages). So i want to enabled AUTORESIZE option to the DMS tablespaces.</o:p></span><br />
<span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";"><o:p>ex: <span style="color: black; font-family: "Courier New"; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><strong>db2
"alter tablespace ts1 AUTORESIZE yes"</strong></span></o:p></span><br />
<span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";"><o:p><span style="color: black; font-family: "Courier New"; font-size: 9pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"></span></o:p></span><br />
<span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";"><o:p><span style="color: black; font-family: "Courier New"; font-size: 9pt; line-height: 115%; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US;"><span style="font-family: Times New Roman; font-size: small;">
</span></span></o:p></span><br />
<span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";"><div class="MsoNormal" style="line-height: 18pt; margin: 0in 0in 9pt;">
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">After
enabling AUTORESIZE for DMS tablespaces, DBA no longer needs to extend the
tablespaces manually. DBA needs only to guarantee that there is enough space on
the file systems so that DB2 can increase the tablespaces automatically
when they get full. In this case, monitoring for tablespace full should be
disabled.<o:p></o:p></span></div>
<span style="font-family: Times New Roman; font-size: small;">
</span><br />
<div class="MsoNormal" style="line-height: 18pt; margin: 0in 0in 9pt;">
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">To have
control about how much the tablespaces are being increased, the parameter
INCREASESIZE can be set (its default is automatic). For example:</span></div>
<div class="MsoNormal" style="line-height: 18pt; margin: 0in 0in 9pt;">
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";"><span style="font-size: small;">db2 "alter tablespace ts1 INCREASESIZE 20 percent"<o:p></o:p></span></span><span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";"></span></span></div>
<span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Times New Roman; font-size: small;">
</span><div class="MsoNormal" style="line-height: 18pt; margin: 0in 0in 9pt;">
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">After
enabling AUTORESIZE yes on DMS tablespaces you can still manually extend the
existing containers or add new ones.<o:p></o:p></span></div>
<span style="font-family: Times New Roman; font-size: small;">
</span><span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";"><span style="font-size: small;">db2
"alter tablespace ts1 extend (all 100)"</span></span><span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";"><span style="font-size: small;"></span></span><br />
<span style="font-family: Times New Roman; font-size: small;">
</span><span style="font-family: Times New Roman; font-size: small;">
</span></span><span style="font-size: small;"><span style="font-family: Times New Roman;">
</span><span style="color: black; font-family: "Courier New"; font-size: 9pt; mso-fareast-font-family: "Times New Roman";">db2
alter tablespace ts1 add (file '\home\data\cont2.dat' 1100)<o:p></o:p></span></span><br />
<span style="font-family: Times New Roman; font-size: small;">
</span><span style="font-family: Times New Roman; font-size: small;">
</span></span></div>
<span style="color: black; font-family: Times New Roman; font-size: small;">
</span><br />
<div class="MsoNormal" style="line-height: 18pt; margin: 0in 0in 9pt;">
<span style="font-size: small;"><span style="color: black;"><span style="font-family: Times New Roman;">
<o:p></o:p></span></span></span></div>
<span style="font-family: Times New Roman; font-size: small;">
</span></div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-84774131574576114832013-04-18T05:11:00.000-07:002013-04-18T05:11:31.761-07:00How to Calculate the size of one Table or one Schema?<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<div class="documentdescription" style="margin: 0in 0in 0pt;">
Perform
the select below to know the size all tables in a specific schema:</div>
<br />
<div style="margin: 0in 0in 0pt;">
db2 "select
substr(a.tabname,1,30), (a.fpages*PAGESIZE/1024) as size_k, a.card from
syscat.tables a, syscat.tablespaces b where a.TBSPACEID=b.TBSPACEID and
a.tabschema='<schema_name>'" </div>
<br />
<div style="margin: 0in 0in 0pt;">
Perform the select below to know
the size one table:</div>
<br />
<div style="margin: 0in 0in 0pt;">
db2 "select
substr(a.tabname,1,30), (a.fpages*PAGESIZE/1024) as size_k,</div>
<pre><span style="font-family: "Times New Roman","serif"; font-size: 12pt;">a.card from syscat.tables a, syscat.tablespaces b where<o:p></o:p></span></pre>
<pre><span style="font-family: "Times New Roman","serif"; font-size: 12pt;">a.TBSPACEID=b.TBSPACEID and a.tabname='<tab_name>' and tabschema='<schema_name>' "<o:p></o:p></span></pre>
<pre><span style="font-family: "Times New Roman","serif"; font-size: 12pt;"></span> </pre>
<span style="font-family: "Times New Roman","serif"; font-size: 12pt;">Perform the select below to know the size of all schema:<o:p></o:p></span><br />
<pre><span style="font-family: "Times New Roman","serif"; font-size: 12pt;"></span> </pre>
<span style="font-family: "Times New Roman","serif"; font-size: 12pt;">db2 "select sum(a.fpages*PAGESIZE/1024) as size_k_of_schemaName from syscat.tables a, \ <o:p></o:p></span><br />
<pre><span style="font-family: "Times New Roman","serif"; font-size: 12pt;">syscat.tablespaces b where a.TBSPACEID=b.TBSPACEID and a.tabschema='<schema_name>' </span></pre>
<span style="font-family: "Times New Roman","serif"; font-size: 12pt;">group by a.tabschema"<o:p></o:p></span></div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com1tag:blogger.com,1999:blog-9150194622731502834.post-43073406955562855502013-04-17T11:43:00.003-07:002013-11-25T10:06:09.745-08:00Configuring an HADR Environment<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br />
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br />
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt; text-align: left;">
<span style="color: black; font-family: Georgia, "Times New Roman", serif; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">For the intent of all purposes, I installed a fresh copy of DB2
ESE version 9 and chooose NOT to create the default DB2 instance.
<br />
<br />
Step 1: Create 2 DB2 Instances<br />
Open up an instance of DB2 Command Window by typing "db2cmd" in Run
dialog.<br />
Create Instance 1 by typing "db2icrt DB2INST1"<br />
Create Instance 1 by typing "db2icrt DB2INST2"<br />
Step 2: Configure Instance 1 :: "db2inst1" Type the following commands:<br />
<br />
</span><span style="color: black; font-family: Georgia, "Times New Roman", serif; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">db2set DB2COMM=tcpip</span><br />
<span style="color: black; font-family: Georgia, "Times New Roman", serif; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"> db2set </span><span style="font-family: Arial, sans-serif; font-size: 13px; font-weight: bold; line-height: normal;">DB2_RESTORE_GRANT_ADMIN_AUTHORITIES = on</span><span style="color: black; font-family: Georgia, "Times New Roman", serif; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br />
db2 update dbm cfg using SVCENAME 61001<br />
db2start
</span></div>
<div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt; text-align: left;">
<span style="color: black; font-family: Georgia, "Times New Roman", serif; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">
Note: The TCPIP service port for this instance is 61001<br />
Step 3: Configure Instance 2 :: "db2inst2"
Type the following commands:<br />
<br />
db2set DB2COMM=tcpip<br />
db2 update dbm cfg using SVCENAME 62001<br />
db2start <br />
Note: The TCPIP service port for this instance is 62001<br />
<br />
Step 4: Create the Primary DB in Instance 1 : :
<br />
<br />
db2 create db BANKARS on /data/home/dbpath<br />
db2 update db cfg for BANKARS using LOGINDEXBUILD on<br />
db2 update db cfg for BANKARS using INDEXREC RESTART<br />
db2 update db cfg for BANKARS using LOGRETAIN on <br />
Note: This step will turn the DB into archival logging mode<br />
<br />
Step 5: Create a backup of Primary DB<br />
<br />
db2 BACKUP DB BANKARS TO /data/home/backups</span></div>
<div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt; text-align: left;">
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><span style="font-family: Georgia, "Times New Roman", serif;"><span style="color: black;"><span style="background-color: white;"><span style="font-family: "Calibri","sans-serif"; font-size: 11pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;"> Backup
successful. The timestamp for this backup image is : 20121010141139</span><br />
Note: This step will backup the BANKARS db into /data/home/backups<br />
<br />
Step 6: Restore the backup BANKARS as Standby database<br />
<br />
db2 RESTORE DB BANKARS FROM /data/home/backups taken at <span style="font-size: small;">20121010141139 redirect generated script bankars_script.sql</span><br />
db2 -tvf <span style="font-size: small;">bankars_script.sql</span><br /><br />
Note: This step will restore the database as BANKARS in the second DB2 instance
and place it into roll forward pending state.<br />
Note: If you roll forward the BANKARS now, you will not be able to initialize
it as the standby database.</span></span></span></span></div>
<div style="text-align: left;">
<span style="color: black; font-family: Georgia, "Times New Roman", serif; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"></span><br /></div>
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"></span><br />
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"></span><br />
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"></span><br />
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"></span><br />
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"></span><br />
<div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></span></div>
<span style="color: black; font-family: "Verdana","sans-serif"; font-size: 9pt; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;">Step 7: Configure the HADR settings for the Primary DB in DB2INST1</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update alternate server for database BANKARS using hostname localhost port
62001</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_local_host localhost</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_local_svc 21001</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_remote_host localhost</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_remote_svc 22001</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_remote_inst DB2INST2</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_syncmode SYNC</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_timeout 120</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> Note: Primary BANKARS HADR service port will be 21001.</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> Note: Standby BANKARS HADR service port will be 22001.</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;">Warning: You cannot use the Instance TCPIP port (SVCENAME) or next port number
(SVCENAME+1) as the HADR service port. This is by design.</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;">Step 7: Configure the HADR settings for the Primary DB in DB2INST1</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update alternate server for database BANKARS using hostname localhost port
61001</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_local_host localhost</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_local_svc 22001</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_remote_host localhost</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_remote_svc 21001</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_remote_inst DB2INST1</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for BANKARS using hadr_syncmode SYNC</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 update db cfg for vusing hadr_timeout 120</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> Note: Primary BANKARS HADR service port will be 41005.</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> Note: Standby BANKARS HADR service port will be 42005.</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> Warning: You cannot use the Instance TCPIP port (SVCENAME) or next port number
(SVCENAME+1) as the HADR service port. This is by design.</span></div>
<span style="background-color: white; color: black;">
<span style="font-family: Georgia, "Times New Roman", serif;">
</span><br />
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> Now, you are ready to test the configuration.
</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;">Step 8: Start HADR on Standby DB IN DB2INST2</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 START HADR ON DB BANKARS AS STANDBY</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;">Step 9: Start HADR on Primary DB IN DB2INST1</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 START HADR ON DB BANKARS AS PRIMARY</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;">Step 10: Take over the Primary Role to Standby Instance</span></div>
<span style="background-color: white; color: black;">
<span style="font-family: Georgia, "Times New Roman", serif;">
</span><br />
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 TAKEOVER HADR ON DB BANKARS</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;">Step 11: Take back the Primary Role from Standby Instance</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 TAKEOVER HADR ON DB BANKARS</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;">Step 12: Stop the HADR service on Primary DB</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 STOP HADR ON DB BANKARS</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;">Step 13: Stop the HADR service on Standby DB</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br /></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"> db2 deactivate db BANKARS</span></div>
<span style="background-color: white; color: black;">
</span><div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="font-family: Georgia, "Times New Roman", serif;"><span style="color: black;"><span style="background-color: white;"> db2 STOP HADR ON DN BANKARS<o:p></o:p></span></span></span></div>
<span style="color: black;"><span style="background-color: white;">
<span style="font-family: Georgia, "Times New Roman", serif;">
</span></span></span></span><span style="background-color: white; color: black;"></span><br />
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br />
<div class="MsoNormal" style="background: white; line-height: 18pt; margin: 0in 0in 9pt;">
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br />
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br />
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br />
<span style="background-color: white; color: black; font-family: Georgia, "Times New Roman", serif;"></span><br />
<a name='more'></a><br /></div>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-21011483217069141022013-04-17T07:57:00.002-07:002013-04-17T07:57:40.833-07:00Health monitor CLP commands<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 13px/normal Arial, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">We can get health status information for the database manager and its databases by issuing health monitor commands.</span><br />
<br />
<span class="importanttitle" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-size-adjust: none; font-stretch: normal; font: bold 13px/normal Arial, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Important:</span><span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 13px/normal Arial, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span class="Apple-converted-space"> </span>The health monitor, health indicators, and related components have been deprecated in Version 9.7</span><br />
<br />
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: currentColor; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-yfti-tbllook: 1184;">
<tbody>
<tr style="mso-yfti-firstrow: yes; mso-yfti-irow: 0;">
<td style="background-color: transparent; border: 1pt solid black; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; padding: 0in 5.4pt; width: 1.45in;" valign="top" width="139">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b><span style="color: black; font-family: "Arial","sans-serif"; font-size: 10pt;">Monitor level</span><o:p></o:p></b></div>
</td>
<td style="background-color: transparent; border-color: black black black rgb(0, 0, 0); border-style: solid solid solid none; border-width: 1pt 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt; width: 171pt;" valign="top" width="228">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b><span style="color: black; font-family: "Arial","sans-serif"; font-size: 10pt;">CLP command</span><o:p></o:p></b></div>
</td>
<td style="background-color: transparent; border-color: black black black rgb(0, 0, 0); border-style: solid solid solid none; border-width: 1pt 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-themecolor: text1; padding: 0in 5.4pt; width: 203.4pt;" valign="top" width="271">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<b><span style="color: black; font-family: "Arial","sans-serif"; font-size: 10pt;">Information returned</span><o:p></o:p></b></div>
</td>
</tr>
<tr style="mso-yfti-irow: 1;">
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black; border-style: none solid solid; border-width: 0px 1pt 1pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 1.45in;" valign="top" width="139">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Arial","sans-serif"; font-size: 9pt;">Database manager</span><b><span style="color: black; font-family: "Arial","sans-serif"; font-size: 10pt;"><o:p></o:p></span></b></div>
</td>
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 171pt;" valign="top" width="228">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Courier New"; font-size: 9pt;">get health snapshot for dbm</span><b><span style="color: black; font-family: "Arial","sans-serif"; font-size: 10pt;"><o:p></o:p></span></b></div>
</td>
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 203.4pt;" valign="top" width="271">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Arial","sans-serif"; font-size: 9pt;">Database manager level information.</span><o:p></o:p></div>
</td>
</tr>
<tr style="mso-yfti-irow: 2;">
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black; border-style: none solid solid; border-width: 0px 1pt 1pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 1.45in;" valign="top" width="139">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Arial","sans-serif"; font-size: 9pt;">Database</span><o:p></o:p></div>
</td>
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 171pt;" valign="top" width="228">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Courier New"; font-size: 9pt;">get health snapshot for all databases</span><o:p></o:p></div>
</td>
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 203.4pt;" valign="top" width="271">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Arial","sans-serif"; font-size: 9pt;">Database level information. Information is
returned only if the database is activated.</span><o:p></o:p></div>
</td>
</tr>
<tr style="mso-yfti-irow: 3;">
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black; border-style: none solid solid; border-width: 0px 1pt 1pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 1.45in;" valign="top" width="139">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Arial","sans-serif"; font-size: 9pt;">Database</span><o:p></o:p></div>
</td>
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 171pt;" valign="top" width="228">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Courier New"; font-size: 9pt;">get health snapshot for database on<span class="apple-converted-space"> </span><</span><var><span style="font-family: "Courier New";">dbname></span></var><o:p></o:p></div>
</td>
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 203.4pt;" valign="top" width="271">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Arial","sans-serif"; font-size: 9pt;">Database level information. Information is
returned only if the database is activated.</span><o:p></o:p></div>
</td>
</tr>
<tr style="mso-yfti-irow: 4;">
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black; border-style: none solid solid; border-width: 0px 1pt 1pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 1.45in;" valign="top" width="139">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Arial","sans-serif"; font-size: 9pt;">Database</span><o:p></o:p></div>
</td>
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 171pt;" valign="top" width="228">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Courier New"; font-size: 9pt;">get health snapshot for all on<span class="apple-converted-space"> </span></span><var style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-spacing: 0px;"><span style="font-family: "Courier New";"><dbname></span></var><o:p></o:p></div>
</td>
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 203.4pt;" valign="top" width="271">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Arial","sans-serif"; font-size: 9pt;">Database, table space, and table space
container information. Information is returned only if the database is
activated.</span><o:p></o:p></div>
</td>
</tr>
<tr style="mso-yfti-irow: 5; mso-yfti-lastrow: yes;">
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black; border-style: none solid solid; border-width: 0px 1pt 1pt; mso-border-alt: solid black .5pt; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 1.45in;" valign="top" width="139">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Arial","sans-serif"; font-size: 9pt;">Table space</span><o:p></o:p></div>
</td>
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 171pt;" valign="top" width="228">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Courier New"; font-size: 9pt;">get snapshot for tablespaces on<span class="apple-converted-space"> </span><dbname></span><o:p></o:p></div>
</td>
<td style="background-color: transparent; border-color: rgb(0, 0, 0) black black rgb(0, 0, 0); border-style: none solid solid none; border-width: 0px 1pt 1pt 0px; mso-border-alt: solid black .5pt; mso-border-bottom-themecolor: text1; mso-border-left-alt: solid black .5pt; mso-border-left-themecolor: text1; mso-border-right-themecolor: text1; mso-border-themecolor: text1; mso-border-top-alt: solid black .5pt; mso-border-top-themecolor: text1; padding: 0in 5.4pt; width: 203.4pt;" valign="top" width="271">
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0pt;">
<span style="background: white; color: black; font-family: "Arial","sans-serif"; font-size: 9pt;">Table space level information for each table
space that was accessed by an application connected to the database. Also
includes health information for each table space container within the table
space.</span><o:p></o:p></div>
</td>
</tr>
</tbody></table>
<br />
<br />
<span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 13px/normal Arial, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">output for database manager information:</span><br />
<span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 13px/normal Arial, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></span><br />
<span style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; display: inline !important; float: none; font-size-adjust: none; font-stretch: normal; font: 13px/normal Arial, sans-serif; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"></span><br />
<pre class="pre codeblock" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: white; color: black; font-size-adjust: none; font-stretch: normal; font: 13px/normal "Courier New", Courier, monospace; letter-spacing: normal; text-indent: 0px; text-transform: none; word-spacing: 0px;"><code>D:\>DB2 GET HEALTH SNAPSHOT FOR DBM
Database Manager Health Snapshot
Node name =
Node type = Enterprise Server Edition
with local and remote clients
Instance name = DB2
Snapshot timestamp = 02/17/2004 12:39:44.818949
Number of database partitions in DB2 instance = 1
Start Database Manager timestamp = 02/17/2004 12:17:21.000119
Instance highest severity alert state = Normal
Health Indicators:
Indicator Name = db2.db2_op_status
Value = 0
Evaluation timestamp = 02/17/2004 12:37:23.393000
Alert state = Normal
Indicator Name = db2.sort_privmem_util
Value = 0
Unit = %
Evaluation timestamp = 02/17/2004 12:37:23.393000
Alert state = Normal
Indicator Name = db2.mon_heap_util
Value = 6
Unit = %
Evaluation timestamp = 02/17/2004 12:37:23.393000
Alert state = Normal</code></pre>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-84747281078512690732013-04-17T06:41:00.000-07:002013-04-17T07:06:14.116-07:00DB2 Architecture <div dir="ltr" style="text-align: left;" trbidi="on">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm2csmZ6urvy1emWlzxt7LXi3G9y4b7q1U4cYgsmm_h2lj_nUQDZ3WvK2dkoRgId8Rx7DQfRKnsUg9YjBOuYqlzC_Vh9lz-WeifonyW_S46yajPoN8UGoiaKsahqHyIBbCBbjfUqXOcUk/s1600/00003525.gif" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm2csmZ6urvy1emWlzxt7LXi3G9y4b7q1U4cYgsmm_h2lj_nUQDZ3WvK2dkoRgId8Rx7DQfRKnsUg9YjBOuYqlzC_Vh9lz-WeifonyW_S46yajPoN8UGoiaKsahqHyIBbCBbjfUqXOcUk/s1600/00003525.gif" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">DB2 Architecture<br />
<div style="text-align: center;">
<br /></div>
<span style="text-align: left;"></span><br /></td></tr>
</tbody></table>
<br /><br />
<ul style="text-align: left;">
<li>On the client side, either local or remote applications, or both, are linked
with the DB2 Database</li>
<li>Local clients communicate using shared memory and semaphores. Remote clients use
a protocol such as Named Pipes, TCP/IP, Net BIOS, etc.</li>
</ul>
<br />
<br />
<h2 style="text-align: left;">
<span style="font-weight: normal;">Server Side :</span></h2>
<div>
<ul style="text-align: left;">
<li>server side, activity is controlled by engine dispatchable units (EDUs). </li>
<li>In the above figure EDUs are shown as circles or groups of circles.</li>
<li>DB2 agents are the most common type of EDUs. These agents perform most of the
SQL processing on behalf of applications. </li>
<li>Prefetchers and page cleaners are
other common EDUs. </li>
<li>A set of sub-agents might be assigned to process the client application requests. </li>
<li>Multiple sub-agents can be assigned if the machine where the server resides has
multiple processors or is part of a partitioned database.</li>
</ul>
<div>
<ol style="text-align: left;">
<li>Buffer pools are areas of database server memory where database pages of user
table data, index data, and catalog data are temporarily moved and can be
modified.</li>
<li>Buffer pools are a key determinant of database performance because data can be
accessed much faster from memory than from disk.</li>
</ol>
</div>
<div>
<ul>
<li><span class="bold">Prefetchers</span> retrieve data from disk and move it into the
buffer pool before applications need the data.</li>
<li><br /></li>
<li><span class="bold">Page cleaners</span> move data from the buffer pool back out to
disk. Page cleaners are background EDUs that are independent of the application
agents. They look for pages from the buffer pool that are no longer needed and
write the pages to disk.</li>
</ul>
<div>
These are the perameters to set the Prefetchers & Pagecleaners</div>
</div>
</div>
<div>
<br /></div>
<div>
NUM_IOSERVERS ===> DB CFG</div>
<a name='more'></a><div>
<blockquote class="tr_bq">
MINCOMMIT ==> DB CFG</blockquote>
</div>
<div>
NUM_IOCLEANERS ==> DB CFG</div>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-35522156819679405482013-04-16T06:26:00.002-07:002013-04-16T06:26:53.445-07:00How to get Database size in DB2<br />
<pre style="white-space: pre-wrap; word-wrap: break-word;">[db2inst@localhost ~]$ db2 "call get_dbsize_info(?,?,?,-1)"
Value of output parameters
--------------------------
Parameter Name : SNAPSHOTTIMESTAMP
Parameter Value : 2012-11-19-15.28.13.032834
Parameter Name : DATABASESIZE
Parameter Value : 93519872
Parameter Name : DATABASECAPACITY
Parameter Value : 204963840
Return Status = 0
</pre>
<div>
<br /></div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com0tag:blogger.com,1999:blog-9150194622731502834.post-69379887270422590492013-04-12T12:17:00.001-07:002013-04-24T01:31:34.171-07:00Backup And Recovery<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="background: silver; font-family: "Verdana","sans-serif"; font-size: 9pt;">Backup and Recovery:<o:p></o:p></span></b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/6PTC9Ray9fY?feature=player_embedded' frameborder='0'></iframe></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><o:p> </o:p></span><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">Maintaining a copy of all the files
necessary to reconstruct the database in the case of a physical or media
failure. A complete database backup will be able to reconstruct the<span style="mso-spacerun: yes;"> </span>system files, data files, log files, and
control files of a database.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
</div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="background: silver; font-family: "Verdana","sans-serif"; font-size: 9pt;">Logging:<o:p></o:p></span></b></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt 35.25pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">When you make a backup plan, you should
consider using the database logging mode. The database records every change of
rows in tables, and each database object. These logs or log files are used to
recover from applications from system errors.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><o:p> </o:p></span><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 1;"> </span>Types of loggings:<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt 70.9pt;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">1.<span style="mso-tab-count: 1;"> </span>Circular
logging<o:p></o:p></span></b></div>
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">2.<span style="mso-tab-count: 1;"> </span>Archive
logging<o:p></o:p></span></b><br />
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">3.<span style="mso-tab-count: 1;"> </span>Dual
logging<o:p></o:p></span></b><br />
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="background: silver; font-family: "Verdana","sans-serif"; font-size: 9pt;">Circular logging:<o:p></o:p></span></b></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 1;"> </span><span style="mso-spacerun: yes;"> </span>By default, the logs are written in a circular
fashion. The first log is overwritten once the cycle is completed. In this
manner, the data in the logs files are always overwritten.<span style="mso-spacerun: yes;"> </span>So there is data loss.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 1;"> </span>With circular logging, you can only
do offline database backup. Users cannot use the database while an offline back
up is taking place.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 1;"> </span>This backup is only used for the
version recovery, that is recovering a database to the last backup time. Log
files are not applicable for version recovery.<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><o:p><span style="font-family: Times New Roman; font-size: small;">
</span></o:p></span><br />
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"></span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><b><span style="background: silver; font-family: "Verdana","sans-serif"; font-size: 9pt;">Archive logging:<o:p></o:p></span></b></span></div>
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;">
<span style="font-family: Times New Roman; font-size: small;">
</span><br />
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 1;"> </span>Here the primary logs in the memory
(RAM) are written first. Once the transaction is committed, the data is written
to the disk. Once all the primary logs are filled, the data in the first log is
transferred to the secondary logs in the disk & it is cleared to hold the
coming transactions data. In this manner there is no data loss as the log files
are not overwritten anywhere.<o:p></o:p></span></span></div>
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;">
<span style="font-family: Times New Roman; font-size: small;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 1;"> </span>The archive mode supports online
backup and database recovery using log files called rollforward recovery.<o:p></o:p></span></div>
<span style="font-family: Times New Roman; font-size: small;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 1;"> </span>The logging mode can be changed from
circular to archive by setting parameters LOGRETAIN or USEREXIT to ON.<o:p></o:p></span></div>
<span style="font-family: Times New Roman; font-size: small;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">Set
either of these 2 parameters.<o:p></o:p></span></div>
<span style="font-family: Times New Roman; font-size: small;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">db2
UPDATE DB CFG FOR <dbname> USING LOGRETAIN RECOVERY/ON<o:p></o:p></span></b></div>
<span style="font-family: Times New Roman; font-size: small;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<b><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">db2<span style="mso-spacerun: yes;"> </span>UPDATE DB CFG FOR <dbname> USING
USEREXIT ON</span></b></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
</div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="font-family: Times New Roman; font-size: small;">
</span></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">You
can also do a Table space either offline or online.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Times New Roman; font-size: small;">
</span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><o:p> </o:p></span><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 1;"> </span>There are 2-types of logs:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Times New Roman; font-size: small;">
</span><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><strong>1.<span style="mso-spacerun: yes;">
</span>Active logs files.<o:p></o:p></strong></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: Times New Roman; font-size: small;">
</span><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><strong>2.<span style="mso-spacerun: yes;">
</span>Archive log files.<o:p></o:p></strong></span></div>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-size: small;"><span style="font-family: Times New Roman;">
<o:p></o:p></span></span></div>
<span style="font-family: Times New Roman; font-size: small;">
Backup Types:</span><br />
<span style="font-family: Times New Roman; font-size: small;"> </span><br />
<ul style="text-align: left;">
<li><span style="font-family: Times New Roman; font-size: small;">
</span><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">Full backup.<o:p></o:p></span></li>
<li><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">Incremental Backup and Recovery.<o:p></o:p></span></li>
<li><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">Delta backup and recovery.<o:p></o:p></span></li>
</ul>
<span style="font-family: Times New Roman; font-size: small;">
Backup Command:</span><br />
<span style="font-family: Times New Roman; font-size: small;"></span><br />
<span style="font-family: Times New Roman; font-size: small;">
</span><br />
<span style="font-family: Times New Roman; font-size: small;"><div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">Syntax: <a href="http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.admin.doc%2Fdoc%2Fc0005960.htm" target="_blank">BACKUPDATABASE</a> <db Name> [USER <User_Name> USING <pwd>]<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 1;"> </span>[TABLESPACE
( TableSpaceName) ]<span style="mso-spacerun: yes;"> </span>[ONLINE]
[INCREMENTAL / DELTA]<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 1;"> </span>TO
<Location><o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt 35.45pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 1;"> </span>[WITH
<Num_of_ Buffers> BUFFERS] [BUFFER <Buffer Size> K]<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">[PARALLELISM <Parallelism_Num> ]
[WITHOU<o:p></o:p></span></div>
<br />
<div class="MsoNormal" style="margin: 0in 0in 0pt 70.9pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">Create New TablespaceT PROMPTING]
[COMPRESS]<o:p></o:p></span></div>
</span></span></div>
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><span style="font-family: Times New Roman; font-size: small;"></span></span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><span style="font-family: Times New Roman; font-size: small;"><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="font-family: Times New Roman; font-size: small;">
</span><br />
<span style="font-family: Times New Roman; font-size: small;"></span></span></span></span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><span style="font-family: Times New Roman; font-size: small;"><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="font-family: Times New Roman; font-size: small;"><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;">Ex:
- </span><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 2;"> </span>]$ db2 backup database
cartdb online to /home/itlokam with 2 <span style="mso-tab-count: 4;"> </span><span style="mso-spacerun: yes;"> </span>buffers buffer 1024 parallelism 2 without
prompting<o:p></o:p></span></span></span></span></span></div>
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><span style="font-family: Times New Roman; font-size: small;"><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="font-family: Times New Roman; font-size: small;">
<br />
</span></span></span></span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><span style="font-family: Times New Roman; font-size: small;"><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="font-family: Times New Roman; font-size: small;"><span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><o:p> </o:p></span><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="mso-tab-count: 2;"> </span>Backup successful. The
timestamp for this backup image is: 20060728023249<o:p></o:p></span></span></span></span></span><br />
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><span style="font-family: Times New Roman; font-size: small;"><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="font-family: Times New Roman; font-size: small;"><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><br /></span>
</span></span></span></span><br />
<h3 style="text-align: left;">
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><span style="font-family: Times New Roman; font-size: small;"><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="font-family: Times New Roman; font-size: small;">
<span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><b>Duel Logging:</b></span></span></span></span></span></h3>
<div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman;"><span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman; font-size: x-small;"><span lang="EN-US" style="font-family: "Verdana","sans-serif";">T</span><span lang="EN-US" style="font-family: "Verdana","sans-serif";">o
prevent the log failures, which could be caused by administrators, who
accidentally delete corrupted active logs or log files at the hardware level.
Dual logging can be enable by setting the </span></span></span></span></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman;"><span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman;"><span lang="EN-US" style="font-family: "Verdana","sans-serif"; font-size: x-small;"> DB2 registry Variable : DB2_NEWLOGPATH2 to 1.<o:p></o:p></span></span></span></span></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman;"><span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman;"><span lang="EN-US" style="font-family: "Verdana","sans-serif"; font-size: x-small;"><br /></span></span></span></span></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman;"><span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman;"><span lang="EN-US" style="font-family: "Verdana","sans-serif"; font-size: x-small;"> If an error happens and a message
will be written to the db2diag.log.<o:p></o:p></span></span></span></span></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman;"><span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman;"><span lang="EN-US" style="font-family: "Verdana","sans-serif"; font-size: x-small;"><br /></span></span></span></span></span></div>
<div class="MsoNormal">
<span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman;"><span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman;"><span lang="EN-US" style="font-family: "Verdana","sans-serif";"><span style="font-size: x-small;"> $db2set DB2_NEWLOGPATH=1</span><o:p></o:p></span></span></span></span></span><br />
<span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman; font-size: small;"><span style="font-family: "Verdana","sans-serif";"><span style="font-family: Times New Roman; font-size: small;"><span lang="EN-US" style="font-family: "Verdana","sans-serif";"><br /></span></span></span></span></span>
configuration of the second log path is controlled by the database configuration parameter <i>mirrorlogpath</i>. When a value is present in <i>mirrorlogpath</i> dual logging is enabled.<br />
<br />
<span style="background-color: white; color: #333333; font-family: arial, helvetica, sans-serif; line-height: 18px;">db2 update db cfg for <dbname> using MIRRORLOGPATH <LOG_DIR2></span><br />
<span style="background-color: white; color: #333333; font-family: arial, helvetica, sans-serif; line-height: 18px;"><br /></span>
<span style="background-color: white; color: #333333; font-family: arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;">Afterwards you must have to restart the instance through db2stop force and db2start.</span><br />
<span style="background-color: white; color: #333333; font-family: arial, helvetica, sans-serif; font-size: 12px; line-height: 18px;"><br /></span></div>
</div>
</div>
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><span style="font-family: Times New Roman; font-size: small;"><span style="font-family: "Verdana","sans-serif"; font-size: 9pt;"><span style="font-family: Times New Roman; font-size: small;">
</span></span></span></span></div>
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;"><span style="font-family: Times New Roman; font-size: small;">
</span></span>
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
</div>
<span style="font-family: "Verdana","sans-serif"; font-size: 6pt;">
</span><br />
<div class="MsoNormal" style="margin: 0in 0in 0pt;">
</div>
</div>
<div class="blogger-post-footer">Join This Site</div>Harihttp://www.blogger.com/profile/02870543059158185320noreply@blogger.com3