Wednesday, March 18, 2015

Symbolic Link in Windows

After JRE upgrade for web browser in order to run applet, I could no longer start my eclipse that is previously using JDK 7. With a checking on PATH setting, I notices the upgrade created a folder
and it was searched the first. In the folder, I found symbolic links for java.exe, javaw.exe and javaws.exe. Relinking them to JDK7 resovled eclipse launching problem. It also had no problem to run the applet from the browser. Neat solution!

This is my first time to create symbolic links in Windows. A chance to learn its syntax.

MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link.
        /J      Creates a Directory Junction.
        Link    specifies the new symbolic link name.
        Target  specifies the path (relative or absolute) that the new link
                refers to.

Wednesday, March 04, 2015

Partition View In SQL Server -- Federated Database Servers

Even after version 2000, SQL Server has meaningful ways to support real partition, it's still valuable to know the old technology because it might still fit simple situations, and a good way to federate SQL Servers. actually, federated database servers is a result of partitioned views.

Partition view will automatically move data in the underlying tables.

CREATE TABLE p1
  (id   INTEGER PRIMARY KEY
                CHECK (id BETWEEN 1 AND 100)
)
;
CREATE TABLE p2
  (id   INTEGER PRIMARY KEY
                CHECK (id BETWEEN 101 AND 200)
);
CREATE TABLE p3
  (id   INTEGER PRIMARY KEY
                CHECK (id BETWEEN 201 AND 300)
)
;
go


create view p as
select * from p1
union all
select * from p2
union all
select * from p3
;

select * from p;

insert into p(id)values(1),(105),(210);

select * from p1;
select * from p3;
select * from p2;

update p set id=211 where id=1;

When  the partition tables are on different database in different SQL Server instances, it builds up federated database servers.

For federated databases, backup and restore happen individually, but logically, it should consider to restore them to same point in time.

More and More Simmilar between Oracle and SQL Server

Between Oracle and SQL Server, they are having more and more similar features, some of them are language feature such as sub-query factory and analytic functions, some of them are technique trends such as in-memory and column store.

And some times, they learn from each other.

In SQL Server 2008, it introduced isolation level read-commited-snapshot, which is borrowing row versioning concept that is well known in Oracle. But it has bottleneck due to relaying on tempdb. In version 2014, its in-memory OLTP, the implementation is not only more similar to Oracle's, but also introduced some good and revolutionary.

When I eventually understand what is container and pluggable database in Oracle, which is hoorayed as revolutionary architecture change in Oracle 12c, I kind of think, well, it's only revolutionary to Oracle world, it's there in SQL Server or Sybase from when they were born.

For the people who want to have a glace of similarity, here are few of them, same list number is the equivalent features in each database.

Oracle 12c
1. root container
2. seed db
3. pluggable database
4. local user
5. common user
6. plug the pluggable database
7. unplug the pluggable database
8. isolated name space in each pluggable database
9. individual pdb backup and restore
...
SQL Server
1.master
2.model
3..user database
4 local database user
5. login user(kind of)
6. attach user database. even better here because it does not require extra meta data file
7. detach user database
8. same here
9. same and even better in SQL server because they share nothing