Showing posts with label ideas. Show all posts
Showing posts with label ideas. Show all posts

Friday, March 9, 2012

Dynamic disk

Does clustering supports dynamic disk mirroring with SAN? As cluster
has single point of failure of disk, we want to mirror the databases.
Any ideas would be appreciated.
Thanks
Clustering does not support dynamic disks.
http://support.microsoft.com/default...b;EN-US;284134
http://support.microsoft.com/default...b;en-us;237853
Cheers,
Rod
MVP - Windows Server - Clustering
http://www.nw-america.com - Clustering
http://www.msmvps.com/clustering - Blog
"tram" <tram_e@.hotmail.com> wrote in message
news:1108518044.708003.277010@.z14g2000cwz.googlegr oups.com...
> Does clustering supports dynamic disk mirroring with SAN? As cluster
> has single point of failure of disk, we want to mirror the databases.
> Any ideas would be appreciated.
> Thanks
>
|||As Rodney pointed out, Clustering does not support Windows Dynamic Disks.
SAN vendors may provide some LUN mirroring capabilities, but that is outside
the scope of SQL server.
Geoff N. Hiten
Microsoft SQL Server MVP
Senior Database Administrator
Careerbuilder.com
I support the Professional Association for SQL Server
www.sqlpass.org
"tram" <tram_e@.hotmail.com> wrote in message
news:1108518044.708003.277010@.z14g2000cwz.googlegr oups.com...
> Does clustering supports dynamic disk mirroring with SAN? As cluster
> has single point of failure of disk, we want to mirror the databases.
> Any ideas would be appreciated.
> Thanks
>

Wednesday, February 15, 2012

Dynamic age of customer based on transactions being viewed

Hi

I am after some ideas on how to deal with customer ages and dynamically linking them to transactions. For example if I purchased something 2 years ago I would be obviously 2 years younger then now but if I have age as a standard dimension all of my purchases would be tied to my current age, assuming age is updated and overwritten. The ideas I have are a slow changing dimension which means that I would have a new entry per customer's birthdate or somehow tie the age calculation to the transaction date. The reason I want this is that the purchasing decisions of say a 20 year old are different than a 25 year old for us. Anyone dealt with this type of issue before.

Thanks in advance.

Derek

One approach, which would avoid a new entry per birthday, is to compute the age by joining the transaction fact table to the customer table in a SQL view (or named query in AS 2005). There could be an "Age" dimension table, starting at the day level, which is joined to the computed age in days (eg: DateDiff("D", TransDate, BirthDate)).

Obviously, if the BirthDate of the customer changes (assuming that's even permitted), then there will have to be a new entry in the Customer dimension table.

|||thanks for the idea Deepak, I'll have a look into that option. I suppose I'm basically adding the slow changing dimension to the fact table.|||It'll be interesting to see which solution works best in your scenario, because there must be others working on similar problems.

Dyamic view/function based on table data (?)

Hey,

First, sorry if this post appear twice, because, I can not find my post
recently send, trying to post it once again.
I'm out of ideas, so, I thought, will search help here again :(

I'm trying to prepare a view for ext. app. This is in normal cases very
easy, but what if the view structure should be dynamic?!

Here is my point (I will siplify the examples).

I have a table:

create table t_data (
id bigint identity (1,1) not null,
valvarchar(10) not null,
data varchar(100) not null
constraint [PK_t_data] primary key clustered
(
id
) with fillfactor = 90 on [PRIMARY] )

go

insert into t_data (val, data) values
('1111111111','1234567890abcdefghijklmnoprstuvwxyz 1234567890abcdefghijklmnoprstuvwxyz67890abcdefghij klmnoprstuvwxyz')
insert into t_data (val, data) values
('2222222222','1234567890abcdefghijklmnoprstuvwxyz 1234567890abcdefghijklmnoprstuvwxyz12345abcdefghij klmnoprstuvwxyz')
insert into t_data (val, data) values
('3333333333','12345abcdefghijklmnoprstuvwxyz12345 67890abcdefghijklmnoprstuvwxyz1234567890abcdefghij klmnoprstuvwxyz')
insert into t_data (val, data) values
('4444444444','67890abcdefghijklmnoprstuvwxyz12345 67890abcdefg12345hijklmnoprstuvwxyz67890abcdefghij klmnoprstuvwxyz')
insert into t_data (val, data) values
('5555555555','1230abcdefghijklmnoprst12345uvwxyz1 234567890abcdefghijklmnoprstuvwxyz67890abcdefghijk lmnoprstuvwxyz')
go

create table t_dataVal (
id bigint identity (1,1) not null,
valvarchar(10) not null,
fill varchar(4) not null
constraint [PK_t_dataVal] primary key clustered
(
id
) with fillfactor = 90 on [PRIMARY] )

go

insert into t_dataVal (val, fill) values ('1111111111','AAAA')
insert into t_dataVal (val, fill) values ('2222222222','KKKK')
insert into t_dataVal (val, fill) values ('3333333333','DDDD')
insert into t_dataVal (val, fill) values ('4444444444','ZZZZ')
insert into t_dataVal (val, fill) values ('5555555555','CCCC')
go

create table t_conf (
id bigint identity (1,1) not null,
start int not null,
length int not null,
description varchar(20) not null,
constraint [PK_t_conf] primary key clustered
(
id
) with fillfactor = 90 on [PRIMARY] )
go

insert into t_conf (start, length, description) values (1,10,'value_1')
insert into t_conf (start, length, description) values (11,3,'value_2')
insert into t_conf (start, length, description) values
(55,15,'value_3')
insert into t_conf (start, length, description) values (33,2,'value_4')
insert into t_conf (start, length, description) values (88,1,'value_5')
insert into t_conf (start, length, description) values (56,7,'value_6')
go

Now here is the issue:
table t_conf contain data, which can be modified by user. The user is
seting the appropriate values.
Now, there should be a view, which returns:
- as headers (collumn names) this what is defined in description column
of t_conf (for example: value_1, value_2 ... value_6)
- as values, substrings of all data from t_data, cutted with start and
length values for appropriate decription from t_conf.
- first two columns of view, should be column val and fill of t_dataVal
table

So the effect should be like this:
valfillvalue_1value_2value_3value_4value_5value6
1111111111AAAA1234567890abc...
2222222222KKKK1234567890abc...
3333333333DDDD12345abcdefgh...
4444444444ZZZZ67890abcdefgh...
5555555555CCCC1230abcdefghi...

of course, for all other value_x should be the appropriate substrings
shown.

Sounds simple, hm?
Well, I'm trying to do this, since yesterday evening, and can not :(

In real life, the call of view/function might happend a lot.
The table t_data might have around 4000 records, but the data string is
longer (around 3000 characters).

Application, might acess a udf, which returns table, and I was focusing
in that.
Was trying, to create local temp table in function, to insert values,
using cursor over t_conf.
Unfortunately, everything what I get, is just a vertical representation
of the data, and I need it horizontal :(
The other problem in function is, that I can not use exec() (wll known)
so I can not even create a table,
dynamicly, using as column names description value from table t_conf,
and as size of field length from this table.

Sorry, that the description is maybe not exactly for my problem, but
this is because I'm not even sure, which way to use :(

any help will be appreciated!

Thank You - MatikMatik (marzec@.sauron.xo.pl) writes:

Quote:

Originally Posted by

Now here is the issue:
table t_conf contain data, which can be modified by user. The user is
seting the appropriate values.
Now, there should be a view, which returns:
- as headers (collumn names) this what is defined in description column
of t_conf (for example: value_1, value_2 ... value_6)
- as values, substrings of all data from t_data, cutted with start and
length values for appropriate decription from t_conf.
- first two columns of view, should be column val and fill of t_dataVal
table


A view, just like a table, has a fixed number of columns, so it can't
be dynamic. Theoretically, you could have a trigger on the configuration
table that recreates the view each time some adds or removes a value.
I'm not really sure that I like this alternative a lot.

Overall, the entire design seems unsound to me. What would the point be
to store all data in a single column, and then use another table to
specify where the value boundaries are. I could guess that this is an
import table, but even in that case I would question if the field
definition should be apply before the data makes it to SQL Server.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx