Hi There,
You might find the having clause helpful.
eg select ref_id, ref_des name from tablea, tableb where
tablea.ref_id = tableb.ref_id
and name in (select name from tablea
group by name
having count(*) > 1);
I hope this is clear but basically you select all the info from your other...
Hi There
The answer to you question is all the sleep type functions are built on procedual language added to the database basic ansi SQL.
ie transac sql for sql server and plsql for oracles.
In DB2 if you want to do anything procedual eg loops if's you have to write it in a third party...
Hi There
Db2 has tools to import and export to flat file in several formats.
Db2 import from d:\temp.del of del insert into table1
The other format is ixf.
There is also a load function which is much faster than an import as it doesn't log so for big files use load but it might put you...
Do you need to do cold backups? Are you using userexit. If so do an online backup so you don't have to force all the connections off. The only other way maybe is to run the force command several times!! I have problems with this doing it manually. It usually takes a few goes. Also make...
SQL1337N The service "<service-name>" was not found.
Explanation: The system cannot resolve the port number associated with the service-name. Possible causes are:
An incorrect service-name value was specified when the TCP/IP node was cataloged.
The correct service-name was...
could you give a bit more information on what you are doing.
I don't know how different v7 is to v6 but once you had set up user exit with a directory for you current logs and a directory to archive them, the database knows about all the logs. Eg once the log file had no open transactions in...
Hi there
The port number is set in a file called services.
On NT is found \winnt\system32\drivers\etc
In there is a few other files you might find helpful.
The lines you want to change will look something like this :
db2cDB2 50000/tcp #connection port for the DB2 instance...
Hi There
There is no catalogue table that tells you how much space is allocated to a tablespace you can only find out how much is used by a query like
DB2 SELECT TABNAME, COLCOUNT, TABLEID, TBSPACEID, CARD,NPAGES,FPAGES,(((FPAGES*4096)/1024)/1024) as SizeUsed,TBSPACE,INDEX_TBSPACE FROM...
DO THE COMMAND ON A COMMAND WINDOW TRY SOME OF THE FOLLOWING:
DB2 ROLLFORWARD DATABASE DBNAME TO END OF LOGS AND STOP (THIS IS THE ONE I USE)
OTHER OPTIONS INCLUDE:
DB2 ROLLFORWARD DATABASE DBNAME COMPLETE
DB2 ROLLFORWARD DATABASE DBNAME TO END OF LOGS AND COMPLETE
HOPE THIS HELPS
Hi Bill
I know that there is a sample C Program for Tablespaces because i have used and adapted it make it do what i want it to do. I can post it if you are interested but the sample c program i used is called tabspace.sqc . But these programs are only a sample of the API's avaliable to you...
The CLI's that you can use are:
Get Instance
List Active Databases
List Database Directory
List Tablespaces ( show detail)
List Tablespace Containers
There are many more just type db2 ? on a command window.
Hope this helps alittle more
Here's a sql statement to find out how much space is actually used but not how much is allocated!!
DB2 SELECT TABNAME, COLCOUNT, TABLEID, TBSPACEID, CARD,NPAGES,FPAGES,(((FPAGES*4096)/1024)/1024) as SizeUsed,TBSPACE,INDEX_TBSPACE FROM SYSCAT.TABLES WHERE TBSPACEID IN (SELECT TBSPACEID FROM...
Hi There
I asked the same question about 3 months ago and found i could write a query to find out an eastimate of the space used but you could only use it so far because the system tables don't have that level of detail. In the end i adapted an API writen in C to find out the total spaced...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.