Register | Login

Published Articles » DB2

Is it possible to rename a column name?

Posted by jyothsnav 2217 days ago (Editorial)

Yes it is possible to rename a column name in DB2 V9.7 version online.


Exception: If the column to be renamed is a part of primary key, we should drop the primary key, rename the column and then recreate the primary key


Command:


ALTER TABLE <TABNAME> RENAME COLUMN <OLDNAME> TO <NEWNAME>


 


How to find the last used date of an index

Posted by jyothsnav 2217 days ago (Editorial)

In earlier versions of DB2, we donot have the facility to find the last used date of an index. But in V9.7, this feature is available which will help us in analysing the real usage of that index and whether it is required.


Command:


SELECT LASTUSED FROM SYSCAT.INDEXES WHERE INDNAME='?'


OR


SELECT INDNAME,LASTUSED FROM SYSCAT.INDEXES WHERE TABNAME='?'


 

Error:
SQL0965C The transaction log for the database is full

Remedy:

1. Increase primary and secondary logs i.e.
In V9 - logprimary + logsecond=256
In V8 - logprimary + logsecond=250

db2 update db cfg for sample using logprimary X
db2 update db cfg for sample using logsecond X

2. Look for the query that is running, try modifying it by using where condition
3. Issue frequent c
Audit facility performance and administration have been enhanced

The audit utility generates a trail of audit records for a series of predefined and monitored database events. Version 9.5 offers major enhancements to the audit facility.

The enhancements to the DB2 audit facility for Version 9.5 include fine grained configuration, new audit categories, separate instance and database logs, an

Before DB2 clients (applications) connect to a database, you must ensure that the server side communications are setup properly to accept the connection requests.To prepare a server for TCP/IP connections, please set up the listener as follows :


1. Set the DB2 profile registry, DB2COMM, to enable the instance to listen for connections from TCP/IP ie.


db2set DB2COMM=TCP/IP



Listing, migrating, and updating a DB2 instance

Posted by jyothsnav 2523 days ago (Editorial)

1. To list the instances that exist on a server, use the command


db2ilist


2. Instance migration is required if you decide to move up to a newer version of the DB2 software than is installed on your server, or if an instance is to be migrated from a 32-bit to a 64-bit instance.


On Windows, instance migration is done implicitly during the necessary migrat

DB2 Load Utility

Posted by jyothsnav 2461 days ago (Editorial)

Like the Import utility, the LAOD utility is designed to read data directly from an external file and store it in a specific table. However, unlike when the import utility is used, when the Load utility is used the table to which data is to be copied must already exist in the database before the load operation is initiated.


Syntax:


LOAD FROM [filename] OF [DEL|ASC|IXF]



Four Phases of Load Operation

Posted by jyothsnav 2462 days ago (Editorial)

Four Phases of Load operation:


LOAD Phase - four things happen during the load phase; data is read from the source file specified and loaded into the appropriate target table, index key values and table statistics are collected, point of consistency information is recorded and invalid data is placed into dump files.


(LOAD QUERY command is used to monitor the progress/status of

Difference between Import and Load utility

Posted by jyothsnav 2462 days ago (Editorial)

The import utility copies data using SQL insert or update operations, as a result each row processed must be checked for constraint compliance and all activities performed is recorded in the databases transaction log files.


Load utility, inserts data into a table by building data pages consisting of several individual rows of data and writing those pages directly to the table space con

DB2MOVE utility

Posted by jyothsnav 2462 days ago (Editorial)

Its easy to see how the export utility can be used together with the import utility or load utility to copy a table from one database to another, but what if we want to copy several tables or an entire database?


In this case, data can be copied table by table using export/import/load but a more efficient way to copy an entire DB2 database is by using the DB2MOVE utility.


DB2MOV

SQL1035N The database is currently in use

Posted by jyothsnav 2386 days ago (Editorial)

While doing backup or rollforward database, when the user try to connect to the database the following error will be displayed i.e.


SQL1035N The database is currently in use


Example:


db2 backup db sample compress (or)


db2 rollforward db sample to <timestamp> stop overflow log path ('file path')


(status could be seen using db2 list utilities show de

Sort News
Username:

Password:

Remember:
YourWiz.com, is a website that will allow everyone to share their knowledge, tip or information through community micro blogging.