Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all 13329 articles
Browse latest View live

Free online Database Transactions Summit (& in Helsinki)

$
0
0
Free online Database Transactions Summit 2013 September 4th at 09:00-16:00 EET


Keynote speakers Monty Widenius and Antoni Wolski.

"Who needs transactions any more?" by Ph.D. Antoni Wolski

MariaDB by Monty Widenius, SkySQL



Hands-on lab in real database environment (Oracle, DB2, MySQL, PosgreSQL, Pyrrho) with the latest technology. Participants will get free self-study and training package.

For webinar address, instructions and materials register at Database Transactions Summit 2013 - Splash



The seminar is ogranized by DBTech VET Teachers project financed by the European Union's Lifelong Learning Program

Adapting Northwind Traders

$
0
0
I was wondering if it is possible to start out with the Northwind Traders template for my needs.

We have production here that involves a shop order to assemble parts. The shop order needs to include the sub-parts required to assemble(build) the final part in question. Kind of like having wheels, frame, seat, etc. to build a bicycle.

In the NW database there are single items for inventory and sale of those items.

How can I add another level to build or put together a parts list for the shop order? Does anyone have suggestions?

Thanks for the help.

I need help!! Error msg

$
0
0
Hello,

I need some help. Our office uses BD for all contacts and student records, yesterday, I had to reboot my computer by just hitting the power button because there was no other way. Now I am getting a 'runtime error 62 Input past end of file' I do have back ups of the database but how can i fix this? If I have to uninstall am I able to reinstall without buying the program again? I've only been here a few months and I am the only one who can figure this out. Please help!

Suggested steps to gracefully reboot a Windows server running DB2 9.5

$
0
0
We need to move a Windows 2003 Server running DB2 9.5 to another rack, so I'd like to shut down DB2 as gracefully as possible. This server is used by our website and receives data from Q Apply (running on another server), so it has a variety constant connections on it.

We've bounced this server before just by rebooting it, but I'm always afraid that this'll create corruption or cause other issues given DB2 wasn't gracefully stopped before the reboot. My fear though is that running just a 'db2stop' will hang given all the connections we have to the server.

So in this scenario would 'db2stop force' be sufficient or should I initiate 'db2 force applications all' and/or 'terminate' first? Also what are the differences between doing these or running 'DEACTIVATE DATABASE'? And would using 'QUIESCE DATABASE' help if it were ran in the beginning?

Thanks.

comparing 2 database environments

$
0
0
Guys how can i compare 2 database environments (Dev vs Prod) without using third party software (IF IT IS POSSIBLE).

Alter Table with Stored Procedure

$
0
0
I have the following procedure in which I attempt to query the system views to determine if a column exists within a table. If the column does not exist then it is added.

CREATE PROCEDURE PROD00016805_DDL ()
RESULT SETS 1
LANGUAGE SQL
P1: BEGIN
IF NOT EXISTS (SELECT * FROM SYSCOLUMNS WHERE TABLE_NAME = 'PFCOMAGTM' AND COLUMN_NAME = 'MAGTSTAT') THEN
ALTER TABLE PFCOMAGTM ADD MAGTSTAT CHAR(10);
END IF;
END P1
CALL PROD00016805_DDL;
DROP PROCEDURE PROD00016805_DDL;

The procedure executes fine the first time but if I attempt to deploy it a second time I get the following failure:

Deploy GI35ILC.PROD00016805_DDL
Running
GI35ILC.PROD00016805_DDL - Deploy started.
[SQL0612] MAGTSTAT is a duplicate column name.
GI35ILC.PROD00016805_DDL - Deploy failed.
GI35ILC.PROD00016805_DDL - Roll back completed successfully.

I realize that the column already exists but would have thought that the logic surrounding the alter table statement would prevent the error from being raised.

I am new to DB2 but I've done similar operations countless times in SQL Server and would have thought that taking a similar approach would work in DB2.

I really need a way that I can conditionally alter table structures as some clients may have already made the alteration while others may not have done so. This small unit of work would be part of a larger script that would be issued to all clients.

DB2 UDB for AS/400
07.01.0000 V7R1m0
AS/400 Toolbox for Java JDBC Driver
Driver Version: 8.11

I have attempted deployment using IBM Data Studio 4.1 and IBM System i Navigator v6r1.

Thank you very much for your help.
Ken

DB2 - OS upgrade

$
0
0
DB2 9.7 ESE FP8 / Win 2008 R2.


We are thinking to upgrade the OS from 2008 R2 to Win 2012.
As the application supports only DB2 V9.7, we are not in a possition to upgrade the DB2 right now.

So, What is the process of upgrading the OS while DB2 9.7 runs on the server. (we are not going to get a new server).


please share your views and experience.

Thanks.

Insert slow after large delete

$
0
0
Hi,

There have been regular large deletes over the past few months on a big table that is 84GB ( 888, 879,462 rows).. we are using db2 v8.2. I noticed that a program that was inserting records after reading data from a file has been doing so at a pretty slow pace now. As far as I can tell, the select speed isn't as badly affected. Am I correct in assuming that a REORG of the index on the table will fix the problem? If so, I tried to run the REORG command on our backup database just to try it out and got back an error that said transaction log is full.

Here is command that I gave --

db2 reorg indexes all for table <tablename> allow write access cleanup only

Here is what I have as a part of the config for the log files..

db2 get db config for dbname | grep -i logfilsiz
Log file size (4KB) (LOGFILSIZ) = 8000

db2 get db config for dbname | grep -i PRIMARY
Number of primary log files (LOGPRIMARY) = 10

db2 get db config for dbname | grep -i SECONDARY
Number of secondary log files (LOGSECOND) = 5


Can someone please help.. is there any other solution I can try out? We will eventually be splitting the huge table up based on certain ranges but until that is done I need to figure out a solution that will atleast put the insert speed back to what it was ( if not faster).

Thanks in advance..

Retrieving rows with updates

$
0
0
Hi All,

From a table I want to retrieve only the rows that have been updated but I am not able to. Here's the scenario:

Code:

select distinct price ,ofr, prd from prod where ofr = '412064'
gives the result
price ofr prd
------------------------ --------- ---------
3.76 412064 52884

likewise when I give
Code:

select distinct price ,ofr, prd from prod where ofr = '412061'
I get
price ofr prd
------------------------ --------- ---------
6.94 412061 51642
7.99 412061 51642

meaning 412064 has no modifications whereas 412061 has been updated twice.

I want my query to return only the rows which have multiple updates. Please can you help?

Thanks in advance

Segmentation fault on db2 express c on linux

$
0
0
Hi folks,

We are trying to execute the stored procedure (SQC) on db2 express c edition (v10.1) installed on Ubuntu 13.04.
But however we are facing segmentation fault (signal 11). We are quite sure about the working of stored procs as they were working fine on AIX operating system

But after compiling them on linux, using gcc compiler and making them shared library, calling them results into segfault.

Stack trace for the error is given below
Code:

0x00007FC3D5670D2A _Z25ossDumpStackTraceInternalmR11OSSTrapFileiP7siginfoPvmm + 0x020a
        (/home/db2inst2/sqllib/lib64/libdb2osse.so.1)
        0x00007FC3D5670ABB ossDumpStackTraceV98 + 0x002b
        (/home/db2inst2/sqllib/lib64/libdb2osse.so.1)
        0x00007FC3D566B9E3 _ZN11OSSTrapFile6dumpExEmiP7siginfoPvm + 0x0103
        (/home/db2inst2/sqllib/lib64/libdb2osse.so.1)
        0x00007FC3D699A7A7 sqlo_trce + 0x0407
        (/home/db2inst2/sqllib/lib64/libdb2.so.1)
        0x00007FC3D699B2CC sqlo_dari_trca + 0x00bc
        (/home/db2inst2/sqllib/lib64/libdb2.so.1)
        0x00007FC3D521ECB0 address: 0x00007FC3D521ECB0 ; dladdress: 0x00007FC3D520F000 ; offset in lib: 0x000000000000FCB0 ;
        (/lib/x86_64-linux-gnu/libpthread.so.0)


The stored procedure are compiled on AIX using the following command:

Code:

xlC_r7 -q64 -o <sqc-name> <sqc-name>.o -ldb2 -L<db2-dir>/lib64 -H512  -T512  –bE:<sqc-name>.exp  -e <sqc-name> -qinitauto=00
Does anyone know an equivalent compilation for the above command on linux and gcc.

(I am not sure if this question is relevant for this forum. But in case if anyone knows the answer please help me.)

Thanks,
~Mandar

NS lock blocking others

$
0
0
Hi there,

My database (V9.5) hit a locking problem that I cannot figure out how it happened.

From the snapshot, my database had a chain of locks like this:

Locks being waited on :
AppHandl [nod-index] TranHdl Lockname Type Mode Conv Sts CoorEDU
24150 [000-24150] 39 000300870000000505F4000352 Row .NS G 4414
24554 [000-24554] 99 000300870000000505F4000352 Row ..U ..X C 4289
25034 [000-25034] 97 000300870000000505F4000352 Row .NS W 7272
24677 [000-24677] 89 000300870000000505F4000352 Row .NS W 4689
25152 [000-25152] 82 000300870000000505F4000352 Row .NS W 7776
25225 [000-25225] 12 000300870000000505F4000352 Row .NS W 8795
24789 [000-24789] 78 000300870000000505F4000352 Row .NS W 4711
25264 [000-25264] 118 000300870000000505F4000352 Row .NS W 7269
25285 [000-25285] 41 000300870000000505F4000352 Row .NS W 4700
24500 [000-24500] 69 000300870000000505F4000352 Row .NS W 4550
25505 [000-25505] 59 000300870000000505F4000352 Row .NS W 7777
25479 [000-25479] 11 000300870000000505F4000352 Row .NS W 63
29467 [000-29467] 211 000300870000000505F4000352 Row .NS W 8914
29361 [000-29361] 178 000300870000000505F4000352 Row .NS W 4325
30202 [000-30202] 263 000300870000000505F4000352 Row .NS W 9044
30196 [000-30196] 255 000300870000000505F4000352 Row .NS W 9035
30088 [000-30088] 207 000300870000000505F4000352 Row .NS W 8879
30379 [000-30379] 243 000300870000000505F4000352 Row .NS W 9074
30373 [000-30373] 276 000300870000000505F4000352 Row .NS W 9057
29980 [000-29980] 249 000300870000000505F4000352 Row .NS W 8950
30457 [000-30457] 330 000300870000000505F4000352 Row .NS W 9118
30251 [000-30251] 430 000300870000000505F4000352 Row .NS W 9230
19422 [000-19422] 392 000300870000000505F4000352 Row .NS W 9181


One NS lock held for a long time and blocked an updated statement and that update statement blocked other select statements. The first granted NS lock did not release.

The isolation level is CS while the lock timeout is -1.

However, I have checked the application handle (24150), the UOW status is WAITING.
Cannot figure out what was happening on that NS lock.

What kind of concurrent situation(s) will end up such unreleased NS lock?


Thanks in advance.

DB2 HADR memory consumption & network traffic

$
0
0
Hello people,

I have two questions and I would be glad if you could provide more information (maybe some stats, graphs or a useful link) because my search lead nowhere.

First of all, is there somewhere information about the memory consumption of a standby instance? Is it safe to assume that it will consume the same memory as the primary in a high load ebvironment? Or maybe less because actually is a read only db with not so many active connections (only the connections for the replication)?

Second. How much network traffic does a HADR replication cause? Can we assume again that is double than having only one db2 instance? Or maybe there is a compression mechanism for the log shipping (or something else that I haven't thought of :) ) ?

Thank you in advance for your help. If you have any documents that have measurements or have information on the topic it would be great.

How to create a matrix of values from a single table

$
0
0
I'm a real novice user and I we use SQL Server. I have a table called TableLog that has the 4 columns. The first column is repeated x number of times for each value in the second column. I'd like to see this information put into a matrix where I could tell if there are any missing intersections. In addition, I need to insert a WHERE clause that says "BETWEEN 20090000 AND 20100000" for the first and second columns.

Example data in the table:
ID1 ID2 MRSSI
100 200 63
100 300 63
200 100 63
200 300 63
300 100 63

Desired matrix: P = Pass and F = Fail

100 200 300
100 n/a P P
200 P n/a P
300 P F P

From the example data, there's no intersection for 300 and 200 so a F is displayed.

Thx in advance!

Updates inserted to the wrong record

$
0
0
I can’t figure out why when I reopen a batch and make changes to it after I re save it all the updates go the last record. Thank you for your help. This is my save button save event :

Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSave.Click
chBox.Checked = False 'uncheck

lblMessage.Text = String.Empty 'reset
objData.ACHID = txtACHID.Text 'adding the ACH

Dim dtGLDetail As DataTable
dtGLDetail = CType(ViewState("tblGLAcctDetail"), DataTable)
If IsNothing(dtGLDetail) Then
' lblMessage.Text = "Invalid GL Account Selection"
csm.RegisterClientScriptBlock(Me.GetType(), "PopupScript", "<script>alert('Invalid GL Account Selection')</script>")
Exit Sub
End If

txtOutOfBalance.Text = Convert.ToDouble(txtOutOfBalance.Text)



'validate invoice with AP Histroy table....
If txtInvoiceNumber.Text.Trim() <> String.Empty Then 'if there is no invoice no. then no need to validate from db.

If hdnPayableID.Value = "No" Then 'dnt valiate during the update mode...
Dim dtInvoiceDetail As DataTable
dtInvoiceDetail = objMethods.isInvoiceExists(ddlVendor.SelectedValue , txtInvoiceNumber.Text.Trim())

If dtInvoiceDetail.Rows.Count <> 0 Then
csm.RegisterClientScriptBlock(Me.GetType(), "PopupScript", "<script>alert('Invoice No. already exists, Please refer the Batch No. '" + dtInvoiceDetail.Rows(0)(0).ToString() + ")</script>")
lblMessage.Text = "Invoice No. already exists, Please refer the Batch No." + dtInvoiceDetail.Rows(0)(0).ToString()
Exit Sub
End If
End If
End If
'''''''''''''''''''''''''''''''''''''''''''
If hdnPayableID.Value <> "No" Then objData.PayableID = hdnPayableID.Value 'for update purpose
' If hdnScheduleID.Value <> "No" Then objData.ScheduleID = hdnScheduleID.Value

'Multiple GL account Section

Dim objGLAcctDetail(dtGLDetail.Rows.Count) As GLMultipleAcctObject

For i = 0 To dtGLDetail.Rows.Count - 1
objGLAcctDetail(i) = New GLMultipleAcctObject

objGLAcctDetail(i).GLAccount = dtGLDetail.Rows(i)(0) 'GL Code

objGLAcctDetail(i).GLAccountDesc = dtGLDetail.Rows(i)(1) 'GL DESC

objGLAcctDetail(i).Trantype = dtGLDetail.Rows(i)(2).ToString().Substring(0, 1) 'DR / CR, either D or C
objGLAcctDetail(i).TranAmount = dtGLDetail.Rows(i)(3) 'Amount
objGLAcctDetail(i).GLAccountID = dtGLDetail.Rows(i)(4) 'Acct ID , ZERO -> insert or else update mode... SP level validation.

Next

'''''''''''''''
'' Debit account from label box....


objData.BatchID = ddlBatchDesc.SelectedValue
objData.Vendor = ddlVendor.SelectedValue
objData.ClaimNo = txtClaimNumber.Text
' objData.Desc = txtDescription.Text
objData.PayableLineID = objMethods.getPayableLineID() 'Auto generate A-Z then 0-9 again


objData.PayableGrp = "R" 'as per the document
objData.PayableSubGrp = ddlPaymenttype.SelectedValue
objData.Invoiceno = txtInvoiceNumber.Text
objData.InvoiceDate = txtInvoiceDate.Text
objData.InvoiceDesc = txtInvoiceDesc.Text
objData.InvoiceAmount = txtInvoiceAmount.Text
objData.UserID = Session("UserID")

Dim dtCounter As DataTable
' dtCounter = objMethods.getCounterNum()
dtCounter = objMethods.getCounterNum()
objData.NextCounter = Convert.ToInt32(dtCounter.Rows(0)("counter_num"))




'file upload section
Dim arrAnyFile() As String
arrAnyFile = Directory.GetFiles(Server.MapPath("~/") & "APTemp", "*.*")
Dim objFiles(arrAnyFile.Length) As PayableDataMaintenanceObjects 'Array objects to store multiple documents


btnClear.Enabled = True
Catch ex As Exception
lblMessage.Text = ex.Message
btnSave.Enabled = True
btnUploadFile.Enabled = True
cGeneral.WriteLog(ex)
End Try
End Sub

adDBDate

$
0
0
Hello,

I cannot for the life of me find out what provider/OLE DB version supports this field type... Can anyone help?

Thanks,
MK

Loading a Combobox via an Enumeration

$
0
0
Greetings all,

I am new with enumerations, so be gentle...

I have an enumeration that lists types of cards and numeric values (called "cardType"). Our sailing school may soon have to validate credit cards, and I found a validation function on the Internet.

I have an enumeration declaration (eg. VISA = 33; MASTERCARD = 13) in a module (called mod_card_ck). I can call items from the declaration.

I am trying to load the combox thus on formload():

me. cboCard.datasource = System.emun.getvalues(getType(cardType))

Doesn't work (ms access 10 does not seem to recognize "datasource", and the combobox remains empty)

Tried the same with "rowsource". Combobox still won't load, though it recognized "rowsource")

Can't seem to find anything after hours on the net.

Help!

John S
Aylmer, QC

Help: Create a Vacation leave Form

$
0
0
Hello All,

I am new to this group but I have been following this website.

I have an MS Access Database where I stored basically all of the data of my company.

First, I wanted to automate the Leave application form allowing only 10% of the population to go on leave on a day to day basis. But before they will be approved, they should not be able to submit a request unless they still have leave credits.

Their leave credits is computed as earned 0.027/day or 0.87/month for SL and VL both separately. Any Sick Leave, and or absences will deduct 0.027 a day and any half day absences will deduct half of 0.027.

I have their attendance of course and on the description Column, the following are present:
P: Present
UA: Unauthorized Absence
AA: Authorized Absence
VL: Vacation leave
SL: Sick Leave
HSL: Half Day Sick Leave
HVL: Half Day vacationLeave

I have an excel file where I have already made a formula and by refreshing daily, will provide me their most updated SL and VL.

What I want to do is to make sure they will received an email every 21st of the month telling them how much credits is left.

Also, I need a form where they can apply for leave

I need to transfer the formula from excel back to access, besides all my data in excel are actually from access.

I hope somebody from this knowledgeable group can help me.

Thanks a lot.

Append Query for date range

$
0
0
I am currently trying to make an Append query that will take the Start date from one table and the end date from the same table and append all dates between those 2 into another table.

Currently have

INSERT INTO [Service Contract] ( [Service Start Date], [Servvice ID] )
SELECT DoS.[DoS Start], DoS.[Service ID]
FROM DoS;

I can append the start date but how would I increment it to the end date

DoS.[DoS End] is the end date

Is there some kind of loop function I can execute?

Access SQL:: Help please :: Urgent

$
0
0
I Want to select one row from below table like

Col1 | Col2 | Col3

a | b | 3.4
b | a | 3.4
c | d | 2.5
d | c | 2.8

result

a | b | 3.4
c | d | 2.5

Transform SQL statement

$
0
0
Hi All,
I found following statement run pretty slow. I am not sure this statement
can transform it to better statement like analytic function, etc ?
for information, the referring tables records are more than 5mil.

Code:

select IP.IP_ID, AR_ID, IP.NM, AR_X_IP_TP_ID, AR_X_IP.SRC_STM_ID,
AR_X_IP.END_DT from DSSBDW.IP IP, DSSBDW.AR_X_IP AR_X_IP 
where IP.IP_ID = AR_X_IP.IP_ID  and AR_X_IP.SRC_STM_ID = 'SIB' and AR_X_IP.BK_CODE = '035'  GROUP
BY IP.IP_ID, AR_ID, IP.NM, AR_X_IP_TP_ID, AR_X_IP.SRC_STM_ID, AR_X_IP.END_DT

Appreciate if someone can share better optimized sql statement.

Thanks.
Viewing all 13329 articles
Browse latest View live