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

Retore into other instance

$
0
0
Hello,

I have informix 11.50 instance running with several databases, and i intending to restore this precise instance into an other server. For the simple reason of using it for tests and future development.

here is the problem, the main server as instance of ifx 11.50.UC3
with several chunks, and, i'm performing the backup using the command:

ontape -d -s -L 0

the second on as an instance of 11.50.UC9DE, has a different name server of the 1º and just one chunk.

What i intend is to restore database by database (avoiding dbexport). how can i processed?

Sorry but i'm a bit nobie in informix backup and restore system.

Appreciate the help.
Best regards.

SQL Server update help

$
0
0
I have a column in a table that stores the full pathname for files, ie. C:\folder1\folder2\folder3\myfile.htm
What I want to do is to update all these pathnames to just be the filename only, ie. myfile.htm
The pathnames could be different levels of subfolders before the filename. So what I really need is keep everything after the last "\" in the stored path. Is there a way to do this in an update query? Thanks.

Conditional Formatting within Tab Control

$
0
0
Hi,

I'm struggling to figure this one out.
I have an access 2010 form that has a tab control (3 of them)

I have created a text field named "TabCheck" that is placed outside the tab control.

I'm trying to create an expression or vba code to have that cell say "Check Other tabs" and possibly highlight it in yellow if "DateCreated" field from the other tabs are not null

The problem I run into is that when I do Me.fieldname, it only lets me pick fields from that same tab not fields on different tabs.

Thanks in advance

v 10.3 released

XML Queries on DPF environment

$
0
0
Hi,
I have a distributed table with XML column. I exposed this table via a view with all XML operations in select clause of the view.
I use this view in my join with other distributed table(distribution key is the same).
I am little confused with the resulting query plan. For the XML columns (xscans) the query tries to do broadcast joins. Why does this XML evaluation need a broadcast? Isn’t it local to each partition?

Any help is appreciated.

Database details: DB2 Ver 9.7 and it’s a DPF environment
Query/Table details:
Base Table: RPT_PRODUCT
CREATE TABLE TEST_TABLE1
(
DIST_KEY BIGINT
,DIST_KEY_VALUE VARCHAR(64)
,ID BIGINT
,COL1 VARCHAR(64)
,COL2 VARCHAR(64)
,COL3 VARCHAR(64)
,COL4 VARCHAR(64)
,COL5 VARCHAR(64)
,COL6 VARCHAR(64)
,APP_LEVEL_OVERRIDE XML
)
DISTRIBUTE BY HASH(DIST_KEY)
IN PDPG_PERMDATA
;
View : VW_RPT_PRODUCT

CREATE VIEW VW_TEST_TABLE1
(
DIST_KEY
,DIST_KEY_VALUE
,ID
,COL1
,COL2
,COL3
,COL4
,COL5
,COL6
) AS
(
SELECT
RP.DIST_KEY
,RP.DIST_KEY_VALUE
,RP.ID
,RP.COL1
,COALESCE(XMLCAST(XMLQUERY('$C/APP_LEVEL_OVERRIDE/COL2' PASSING RP.APP_LEVEL_OVERRIDE AS "C") AS VARCHAR(64)),RP.COL2)
,COALESCE(XMLCAST(XMLQUERY('$C/APP_LEVEL_OVERRIDE/COL3' PASSING RP.APP_LEVEL_OVERRIDE AS "C") AS VARCHAR(64)),RP.COL3)
,COALESCE(XMLCAST(XMLQUERY('$C/APP_LEVEL_OVERRIDE/COL4' PASSING RP.APP_LEVEL_OVERRIDE AS "C") AS VARCHAR(64)),RP.COL4)
,COALESCE(XMLCAST(XMLQUERY('$C/APP_LEVEL_OVERRIDE/COL5' PASSING RP.APP_LEVEL_OVERRIDE AS "C") AS VARCHAR(64)),RP.COL5)
,COALESCE(XMLCAST(XMLQUERY('$C/APP_LEVEL_OVERRIDE/COL6' PASSING RP.APP_LEVEL_OVERRIDE AS "C") AS VARCHAR(64)),RP.COL6)
FROM TEST_TABLE1 rp
);

Query
UPDATE TEST_TABLE_2 AP -- (distributed by DIST_KEY )
SET (
COL2
,COL3
,COL4
,COL5
,COL6
) =
( SELECT
COL2
,COL3
,COL4
,COL5
,COL6
FROM VW_TEST_TABLE1 P
WHERE AP.ID = P.ID
AND AP.DIST_KEY = P.DIST_KEY
)
WHERE EXISTS ( SELECT 1
FROM VW_TEST_TABLE1 P1
WHERE AP.ID = P1.ID
AND AP.DIST_KEY = P1.DIST_KEY
)
Query Plan Snippet:
Query Plan Snippet :
Section Code Page = 1208

Estimated Cost = 3213296.750000
Estimated Cardinality = 26435.000000

Coordinator Subsection - Main Processing:
Distribute Subsection #1
| Broadcast to Node List
| | Nodes = 1, 3, 4, 5, 6
Distribute Subsection #2
| Broadcast to Node List
| | Nodes = 1, 3, 4, 5, 6
Distribute Subsection #3
| Broadcast to Node List
| | Nodes = 1, 3, 4, 5, 6
Distribute Subsection #4
| Broadcast to Node List
| | Nodes = 1, 3, 4, 5, 6

Subsection #1:
Access Table Name = TEST_TABLE_2 ID = 22,209
| Index Scan: Name = UN1_TEST_TABLE_2 ID = 8
| | Regular Index (Not Clustered)
| | Index Columns:
| | | 1: ID (Ascending)
| | | 2: DIST_KEY (Ascending)
| #Columns = 8
| Compressed Table
| #Key Columns = 1
| | Start Key: Beginning of Index
| | Stop Key: Exclusive Value
| | | | 1: NULL
| Data Prefetch: Eligible 0
| Index Prefetch: None
| Lock Intents
| | Table: Intent Exclusive
| | Row : Exclusive
Merge Join
| Early Out: Single Match Per Outer Row
| Access Table Name = TEST_TABLE1 ID = 14,19
| | #Columns = 9
| | Avoid Locking Committed Data
| | May participate in Scan Sharing structures
| | Scan may start anywhere and wrap, for completion
| | Fast scan, for purposes of scan sharing management
| | Scan can be throttled in scan sharing management
| | Relation Scan
| | | Prefetch: Eligible
| | Lock Intents
| | | Table: Intent Share
| | | Row : Next Key Share
| | Sargable Predicate(s)
| | | #Predicates = 1
| Insert Into Sorted Temp Table ID = t1
| | #Columns = 9
| | #Sort Key Columns = 1
| | | Key 1: ID (Ascending)
| | Sortheap Allocation Parameters:
| | | #Rows = 26435.000000
| | | Row Width = 328
| | Piped
| Access Temp Table ID = t1
| | #Columns = 9
| | Relation Scan
| | | Prefetch: Eligible
| Residual Predicate(s)
| | #Predicates = 1
Nested Loop Join
| Piped Inner
| Insert Into Synchronous Table Queue ID (XTQB) = q1
| | Send to Specific Node
| Access Table Queue ID (XTQA_AGG) = q2 #Columns = 1
Nested Loop Join
| Piped Inner
| Insert Into Synchronous Table Queue ID (XTQB) = q3
| | Send to Specific Node
| Access Table Queue ID (XTQA_AGG) = q4 #Columns = 1
Nested Loop Join
| Piped Inner
| Insert Into Synchronous Table Queue ID (XTQB) = q5
| | Send to Specific Node
| Access Table Queue ID (XTQA_AGG) = q6 #Columns = 1
Update: Table Name = TEST_TABLE_2 ID = 22,209

Subsection #2:
Access Table Queue ID () = q1 #Columns = 1
XML Doc Navigation
| Navigator is
| | /$CONTEXT_NODE$()/child::element(APP_LEVEL_OVERRIDE)
| | /child::element(COL2)(: Output Data :)
Insert Into Asynchronous Table Queue ID () = q2
| Send to Specific Node
Jump Back to Start of Subsection

Subsection #3:
Access Table Queue ID () = q3 #Columns = 1
XML Doc Navigation
| Navigator is
| | /$CONTEXT_NODE$()/child::element(APP_LEVEL_OVERRIDE)
| | /child::element(COL3)(: Output Data :)
Insert Into Asynchronous Table Queue ID () = q4
| Send to Specific Node
Jump Back to Start of Subsection

Subsection #4:
Access Table Queue ID () = q5 #Columns = 1
XML Doc Navigation
| Navigator is
| | /$CONTEXT_NODE$()/child::element(APP_LEVEL_OVERRIDE)
| | /child::element(COL4)(: Output Data :)
Insert Into Asynchronous Table Queue ID () = q6
| Send to Specific Node
Jump Back to Start of Subsection

End of section

when NO_DATA_FOUND return zero

$
0
0
I'm using oracle 11g

I have two tables Orderitems:

"ORDER_ITEMS_CODE" VARCHAR2(20) NOT NULL ENABLE,
"ORDER_CODE" VARCHAR2(20) NOT NULL ENABLE,
"ITEM_CODE_ORDERS" VARCHAR2(20) NOT NULL ENABLE,
"ORDER_QUANTITY" NUMBER(4,0) NOT NULL ENABLE,
"ORDER_UNIT" VARCHAR2(5) NOT NULL ENABLE,
"UNIT_PRICE" NUMBER(38,5),
"ORDERED_IN" VARCHAR2(6),
"OR_QUANTITY_TON" NUMBER(38,5),
"Warehouse_CODE" VARCHAR2(20) NOT NULL ENABLE
the other table is Inventory:

"INVENTORY_CODE" VARCHAR2(20) NOT NULL ENABLE,
"ITEM_CODE" VARCHAR2(20) NOT NULL ENABLE,
"WAREHOUSE_CODE" VARCHAR2(20),
"IN_Q_TON" NUMBER(38,5),
"OR_Q_TON" NUMBER(38,5)
I created a trigger to calculate "OR_QUANTITY_TON" = Sum ("OR_QN_TON")

create or replace trigger sum_Or_IT
after insert or update or delete on orderitems
begin
update INVENTORY set OR_Q_TON = (
select sum(or_quantity_ton) from orderitems
where
orderitems.item_code_orders = INVENTORY.item_code
and
warehouse_code = '1');
end;
this is an inventory table and the column OR_Q_TON is the sum of the ordered quantity for every item,, but if an item doesn't exist in the orders ,, I want the order quantity to be zero. I want to make an exception if the "item_code_orders" doesn't exist in the table "Orderitems" then the OR_Q_TON = 0

I tried this but it didn't work I got (-) not (0)

EXCEPTION
WHEN NO_DATA_FOUND THEN
update INVENTORY set OR_Q_TON = 0 ;

2008 R2 SQL startup error resolution

$
0
0
Recently, we could not get our SQL Server 2008 R2 cluster to fail over to the passive node generating the following error:

Server,Unknown,The server was unable to initialize encryption because of a problem with a security library. The security library may be missing. Verify that security.dll exists on the system.
Server,Unknown,TDSSNIClient initialization failed with error 0x139f<c/> status code 0x80. Reason: Unable to initialize SSL support. The group or resource is not in the correct state to perform the requested operation.

We worked through the problem with the Microsoft engineer so I thought I would post the resolution here:


The most common cause for such an error – and its results- is actually in group policy with the SSL cipher suite order. So first, check to see if that is enabled or disabled on the node that SQL starts up fine on. I’d expect it to be disabled.

1. At a command prompt, enter gpedit.msc. The Group Policy Object Editor appears.
2. Expand Computer Configuration > Administrative Templates > Network, and then click SSL Configuration Settings.
3. Under SSL Configuration Settings, click the SSL Cipher Suite Order setting.
4. Right click on SSL Cipher Suite Order and select edit. Check to see if it is enabled or disabled.

If it is disabled on the node on which SQL starts up fine, disable it on the node where SQL won’t start. It does require a reboot to apply.
=======================
To disable the SSL Cipher Suite Order group policy setting please follow below steps
1. At a command prompt, enter gpedit.msc. The Group Policy Object Editor appears.
2. Expand Computer Configuration > Administrative Templates > Network, and then click SSL Configuration Settings.
3. Under SSL Configuration Settings, click the SSL Cipher Suite Order setting.
4. Right click on SSL Cipher Suite Order and select edit. Then click on Disabled and click ok
5. Reboot the server

=======================
If it is not disabled on the node on which SQL starts up fine, or if it is already disabled on the node on which SQL will not start, then we’ll have to start looking at more unusual causes.

This was not our problem and had to keep looking:

Verify that the following is the same on both nodes?

HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cry ptography\Configuration\SSL\00010002\

It should have in there some values like:

TLS_RSA_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_DHE_DSS_WITH_AES_128_CBC_SHA

Ours had inconsistent entries (extra comma) that had to be sychronized as follows:
1. At a command prompt, enter gpedit.msc. The Group Policy Object Editor appears.
2. Expand Computer Configuration > Administrative Templates > Network, and then click SSL Configuration Settings.
3. Under SSL Configuration Settings, click the SSL Cipher Suite Order setting.
4. Take out the extra comma
5. Click Apply
6. Click OK
7. Reboot the node
8. Go to the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cry ptography\Configuration\SSL\00010002\
9. Check that it now does not have the extra comma

Removing the extra comma resolved our problem.

Urgent Help needed

$
0
0
I Have 4 tables and I want to build a form in access in which I want to search for a particular string from all the 4 tables. So how should I build the search query in the form and link the data to be searched from the 4 tables. the 4 tables are by software, by user, component, standard. Also after displaying the particular searched string I want to delete it. Is there any query to directly delete it after it is displayed?? I am an Power electronics student and I am unaware of access.

Sybase wont start - exceeds max storage limit

$
0
0
Hello all,

I am using Sybase 15 on a linux platform (a VM). We have a system that we hadnt looked at in a few weeks that is running sybase. Attempting to start sybase on that system resulted in the following message:

Current disk usage exceeds the maximum storage limit of 5120 MB.

We have run sybase on this machine previously and have (had?) a valid license.

What would be the cause of that message?

thanks,
Bill

help me for design manufacturing design database

$
0
0
Hello,

I'm new, recent softdev grad and I'm working on a project with a weird bussiness process, like this

manufacturing order can be from sales order and from the owner request

is it can be like this?

MO_from_sales_detail = [ idMOSALES,date,id_sales_detail]
MO_from_owner = [idmoreq, idproduct, qty]

i have 2 request from different table..how to make the design for the manufacture process?

sql0176n

$
0
0
v9.7 FP7; AIX


UPDATE aaa.bbb
SET CONTACT_NAME = translate (CONTACT_NAME, 'AACEEEEIIOUU','àâçéèêëîïôùû'),
CONTACT_DEPT = translate (CONTACT_DEPT, 'AACEEEEIIOUU','àâçéèêëîïôùû')
WHERE BKR_NUM='x11'

returns sql0176n


Could this error be related to collating sequence?


DB where this statement works:

Code:

Database territory                                      = US
 Database code page                                      = 819
 Database code set                                      = ISO8859-1
 Database country/region code                            = 1
 Database collating sequence                            = IDENTITY
 Alternate collating sequence              (ALT_COLLATE) =


DB where this statement doesn't work:

Code:

Database territory                                      = US
 Database code page                                      = 1208
 Database code set                                      = UTF-8
 Database country/region code                            = 1
 Database collating sequence                            = SYSTEM_819
 Alternate collating sequence              (ALT_COLLATE) =


If this is related to collating sequence, how can it be fixed without rebuilding the db? Use REPLACE instead of TRANSLATE or something else?

Single Database for CMS?

$
0
0
I'm writing my own CMS platform (PHP & MySQL), and am planning to have it work as a centralized system, so new clients/websites can be easily added to the system via a form.

From my limited knowledge of MySQL I see it working on a single database, i.e. all client data will be on the same tables, differentiated with just a client_id.

The reason I am thinking of this route is that with a single shared database, I would easily be able to do updates or add new features/tables as and when, and they would be available to all clients.. so it would make my job much easier..

My concern is how scalable/ideal this is in the long run, both from a performance and managment point of view. Also would this create any security issues?

Can anyone here let me know what the advantages/disadvantages are of having everything on the same database? Would it make things like backups/restores more difficult? Also how much is too big? I have a few sites running on a simpler CMS and each database is larger than 500Kb, so example with 50 websites running on it could easily add up to 25Mb.. is this too big?

If not on a single database what are my alternatives?

Thanks in advance!

Help with Query

$
0
0
Hello,

I build a query back in the day, but I am trying to remember how I did it.

I have three tables. #TESTS contains all the tests required. #EXEC_ORDER order contains the prerequisites definition. #SUBGROUP is the transaction table.

Code:

CREATE TABLE #SUBGROUP (
        SYSID INT IDENTITY(1,1) NOT NULL,
        TESTID INT NOT NULL,
        COMPLETED BIT NOT NULL DEFAULT 'FALSE'
)

CREATE TABLE #TESTS (
        SYSID INT IDENTITY(1,1) NOT NULL,
        TESTID INT NOT NULL
)

CREATE TABLE #EXEC_ORDER (
        SYSID INT IDENTITY(1,1) NOT NULL,
        TESTID1 INT NOT NULL,
        TESTID2 INT NOT NULL
)


INSERT INTO #TESTS (TESTID) VALUES (1),(2),(3),(4),(5)
INSERT INTO #EXEC_ORDER (TESTID1,TESTID2) VALUES (2,3),(2,4),(5,4)

I am looking for Tests #1 and #2 would be returned. When Test #2 is completed, then Tests #1, #3 and #4 would be returned. When Test #4 is completed, then Tests #1, #3, and #5 would be returned.

Code:

SELECT t.TESTID,s.COMPLETED
FROM #TESTS t
LEFT JOIN #SUBGROUP s
  ON t.TESTID = s.TESTID
 AND s.COMPLETED = 'FALSE'
LEFT JOIN #EXEC_ORDER eo
  ON t.TESTID = eo.TESTID1

Thanks
jlimited

prod audit database

$
0
0
hi guys,
we have sybsecurity database of data 512M and 1G. we also have sybsecurtity archive for the audit information. later last week i've been encountering logsegment full on archive database. archive database composed of 2G of data and 1G of log. there's also a trigger procedure that would fire to archive database once reach its threshold point. somehow i can't understand its behavior how archive db syslogs full. no options defined for both audit database.

the error log says that sybsecurity archive logsegment is full..

anyone has inputs, or even share on how do you handle this situation.
TIA

Query Help

$
0
0
Hi All,

I have a query in MySQL and i am making a crystal report by using this.
Now inside the query i have a column called scan_mode and it is coming from gfi_transaction table.This scan_mode i am using in report to suppress some sections.But some times this value is coming null for some transaction id's.


So now i want to take this scan_mode as separate query so that it will work.
Can any one please help how i can modify the below query to take only scan_mode column.



SELECT
cc.cost_center_code AS cccde,
cc.name AS ccnme,gf.scan_mode,
cc.cost_center_id AS ccid,
site.name AS siteme,
crncy.currency_locale AS currency_locale,
cntry.language AS LANGUAGE,
cntry.country_name AS cntrynm,
crncy.decimal_digits AS rnd,
gf.transaction_no AS Serial_No,
brnd.name AS brand_name,
rsn.description AS reason,
gf.comment AS COMMENT,
ts.status_description AS STATUS,
DATE_FORMAT(gf.created_date,'%d/%m/%Y') AS created_date,
gf.created_by AS created_by,
IFNULL(gf.approval_no,'Not authorized') AS Trans_no,
gf.approved_date AS approval_dt,
gf.approved_by AS approved_by,gf.status AS status1,
IFNULL(loc.cost_center_code,cc.cost_center_code) AS cur_location,
gf.document_ref_no,gf.document_ref_type,
,DATE_FORMAT(document_ref_date1,'%d/%m/%Y')) AS invoice_no
FROM
gfi_transaction gf
INNER JOIN gfi_instruction gfn ON (gf.transaction_id=gfn.transaction_id)
INNER JOIN gfi_document_instruction doc ON (gf.ref_transaction_no = doc.document_instruction_id)
INNER JOIN reason rsn ON (gf.reason_id = rsn.reason_id)
INNER JOIN gfi_status ts ON (gf.status = ts.gfi_status_id)
INNER JOIN transaction_type tt ON (gf.transaction_type_id = tt.transaction_type_id)
INNER JOIN brand brnd ON(gf.brand_id=brnd.brand_id)
-- cc details
INNER JOIN cost_center cc ON (brnd.parent_brand = cc.brand_id OR gf.brand_id = cc.brand_id)
INNER JOIN site site ON(cc.site_id = site.site_id)
INNER JOIN country cntry ON (site.country_id = cntry.country_id)
INNER JOIN currency crncy ON (cntry.currency_id=crncy.currency_id)
LEFT OUTER JOIN alshaya_location_details loc ON
(gf.brand_id = loc.brand_id AND loc.cost_center_id = gf.cost_centre_id)
LEFT OUTER JOIN alshaya_location_details locto ON
(locto.cost_center_id = gf.from_cost_center_id)
WHERE
gf.transaction_id='{?TransID}'
AND rsn.transaction_type_id IN (10,11,14)

Please remove my account

$
0
0
Since I've pretty much never used this account, I think you should remove it.

Multi-tenant DB Design, a Salesforce scenario

$
0
0
I was doing some research into the optimal DB setup for a Salesforce like application (webapp with sensitive data for multiple 10.000's of customers, each customer can have multiple USER accounts).

My idea is, is that the split database setup (different DB for each customer) is the best since its the only way to make sure data is really isolated in terms of security, and because its not just multi customer, but each customer can have multiple users that login to work on the data. However...is having a DB instance with 10.000 'small' DB's really gonna work?

I dont really feel much for the shared schema setup since you will end up with 10's of thousands of tables, which doesn't seem very manageable.

The 1 big DB setup with just using a customerID column per table seems the easiest to implement, but not really secure...and joining tables will be quite a task as I presume.

What are your thoughts on this scenario? The seperate DB's-scenario seems best to me from a scalability and security perspective...but what do I know :D

Thanks!

please help

$
0
0
hey I am new to the programming world and really need to know just meaning of the following line

Set family_rs = cn.Execute("select distinct(family) from family_tab")
While family_rs.EOF = False

please help
:o

Dumps for the DB2 certification 000-610 Db2 10.1 fundamentals

$
0
0
Can anyone please help me in getting the study materials or dumps for the DB2 certification 000-610 Db2 10.1 fundamentals?

CLOB with data in xml format - parse idea's

$
0
0
Hello All,

Just looking for some advice here.

I have a clob field that contains a string of XML Text. It appears to be just a dump of data
I need to parse certains elements of the string and store them in another field of the same table.

I don't really know what is the best approach here.
I was looking at CTE's . I see it can also be done in Java but was hoping to stay within what db2 has available as I am not a great coder.

Sample data from the field is
Quote:

<tns:dMSStatusMsg xmlns:p="http://www.tmdd.org/3/messages" xmlns:tns="http://www.tmdd.org/3/dialogs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tmdd.org/3/dialogs ../Schema/eTMDD.xsd ">
<dms-status-item>
<DmsStatusHeader>
<DeviceId>1168</DeviceId>
<DeviceStatus>operational</DeviceStatus>
<DeviceUrl></DeviceUrl>
<LastCommTime>
<date>20130812</date>
<time>160317</time>
<offset>-0400</offset>
</LastCommTime>
</DmsStatusHeader>
<DmsDiagnosticMessage>local mode is False</DmsDiagnosticMessage>
<DmsCurrentMessage-Text>W1ROK.. Blank</DmsCurrentMessage-Text>
<DmsCurrentMessage-Name>W1ROK.. Blank</DmsCurrentMessage-Name>
<DmsCurrentMessage-ImageFormat>png</DmsCurrentMessage-ImageFormat>
<DmsMessageSourceMode>8</DmsMessageSourceMode>
</dms-status-item>
</tns:dMSStatusMsg>

I need information from <DmsDiagnosticMessage>
Viewing all 13329 articles
Browse latest View live