Thursday, October 28, 2004

How to setup jb8 BES environment.

1 setup bes 5.21
2. setup jb8
3 set bes jb8 connection by enable bes, directory..
4. select enterprise setup, visibroker
5. microsoft sql 2000 jdbc just specify three jar.
6. jdk
7. idl setup visibroker
8. idl properyies, set package parallel...
9, run smartagent
10, run server
11, run gatekeeper

using vbj -VBJclasspath ... to run server

smartagent can perform load balancing in round robin machinism.
however, because the gatekeeper is regarded as a single client, so two
serer object does not perform load balancing.

But two can be failover. perform fault tolerante function.

Have to figure out how to perform load balancing by using gatekeepers.

Sunday, October 10, 2004

How to create updateable distributed partitioned view

NEED TO NOTICE:

  • SET XACT_ABORT ON : this enables a distributed transaction to auto rollback.
  • create check constraint before create primary key
  • Better not to use char type, and varchar type. It will cause problem in updateable distributed view, such as not specified the partitioned row. use nchar, or nvarchar instead.
  • It seems that the partition can use only "between and", I tried to use %, but does not work, and cause error.
  • In my practice, I use foreign key in enterprise manager, instead of t-sql to alter the table. becuase I use t-sql and cause error.
  • In JDBC, it seems hard to set the XACT_ABORT on, so instead I used sp_configure sp_configure 'user options', 16384GORECONFIGUREGO to set up the XACT_ABORT on for all users in SQL server.

Here are some examples how to create updatable partitioned view.

  • create a table in another computer

USE BookStoreGO
CREATE TABLE [dbo].[books2] ( [bookNo] [bigint] NOT NULL CHECK ([bookNo]BETWEEN 101 AND 200), [bookTitle] [nvarchar](100) NOT NULL, [bookEdition] [smallint] NULL , [bookAuthor] [nvarchar](20) NOT NULL , [bookPrice] [float] NOT NULL , [bookPublisher] [int] NOT NULL , [bookQuantity] [int] NOT NULL
)
ALTER TABLE [books2]ADD PRIMARY KEY ([bookNo])
GO

  • create a table in one computer

USE BookStoreGO
CREATE TABLE [dbo].[books1] ( [bookNo] [bigint] NOT NULL CHECK ([bookNo] BETWEEN 1 AND 100), [bookTitle] [nvarchar](100) NOT NULL, [bookEdition] [smallint] NULL , [bookAuthor] [nvarchar](20) NOT NULL , [bookPrice] [float] NOT NULL , [bookPublisher] [int] NOT NULL , [bookQuantity] [int] NOT NULL
)
ALTER TABLE [books1]ADD PRIMARY KEY ([bookNo])

  • create view for tables in different tables

CREATE VIEW [dbo].[books_view] ASSELECT * FROM [DESKTOP].[BookStore].[dbo].[books1] UNION ALLSELECT * FROM [DELL].[BookStore].[dbo].[books2]GO

  • Add new records to the view.

USE BookStoreGO
SET XACT_ABORT ON
INSERT INTO [books_view]VALUES (4, 'A',1,'B',200.00,1,1)
INSERT INTO [books_view]VALUES (1, 'A',1,'B',200.00,1,1)

  • Set the user option for XACT_ABORT on for all users

sp_configure 'user options', 16384GORECONFIGUREGO

Saturday, October 09, 2004

create distributed partition view in sql 2000

1. create table
2. create constraint
3. create link server
use security setting user: sa password:
4. create view in each server

notic: use sql 2000 sp3
use jdbc sp3

set network trust in notorn internet security.

start DTS and SQL , SQL Agent service