Archive

Archive for May, 2010

Windows 7 – NTFS reparse points

When I started deploying Windows 7 around the office, speed and specially extra memory where at the top of the pros list. Getting to use more than 3GB of RAM under a 64-bit OS was out there before but it was never wrapped in such a good package. Since my users started running Windows 7 I learned how good and stable it runs and that is why I was surprised when one of them came to me complaining about his slow, very slow computer.

We’re talking about an HP xw4600 workstation that run Windows 7 64-bit with 4GB RAM. You cannot ask for anything other than speedy start-up and great work experience. After less than 6 month something changed and as the user described, the start-up process took 3 minutes and anything you tried took forever while the processes under task manager show that nothing utilize the processor…

When the log files gave no clue I restarted and allowed the consistency check to run

One thing catches my eye in this output:

What is this reparse record? Though it is not a new Windows 7 feature, it is a good opportunity to check it out.

While reparse points feature is new to NTFS v5 (introduced with Windows 2000), the concept has been used in other operating systems long before (UNIX has a similar feature called symbolic link). The basic idea in simple words is to allow the operating system to seamlessly link folders and drives together. As NTFS file system objects, reparse points can contain user-configured data that gets stored in the system-administered reparse attribute.

If you never heard of reparse records or reparse points, you might have heard of junction points. One of the great uses of a junction point is bypassing the 26 letter drive name limit, mounting is the commonly used term.

Read about reparse point tags, reparse point operations and reparse points and file operations to dive deeper.

Back to my user, consistency check completed but the problem did not resolve. Since I have few complicated financial applications on this desktop I wanted to avoid reloading the OS. I tried running the System Recovery Options->System Restore but while this option is cool and easy to use, it did not resolve my problem (which at this point screamed “hardware, hardware”) and I had to re-install the OS. As any of the other Windows 7 installations I’ve done before, it was easy and speedy and so far it looks like the fresh OS is working as you’d expect.

Advertisements

Switchport mapping

May 24, 2010 1 comment

I had to map the ports on a 2960 switch. I had to fill in the missing name on each port with the PC that connect to it.

This is a simple task that only require one command on the switch:

SWITCH#show mac-address-table interface fastEthernet 0/20
Mac Address Table
——————————————-
Vlan    Mac Address       Type        Ports
—-    ———–       ——–    —–
201    000f.2034.4b2f DYNAMIC     Fa0/20
Total Mac Addresses for this criterion: 1

I now hold the MAC address of the PC that connect to port 20: 000f.2034.4b2f

The next step is finding the IP address that match this MAC address. To find this piece of information I used my L3 switch that connect the 2960 switch.
This is the arp command to run on the L3 switch:

L3SWITCH#show arp | include Vlan201
Internet  192.168.201.101        26   000b.cdf5.b4e4  ARPA   Vlan201
Internet  192.168.201.100         7   0018.4d76.a2be  ARPA   Vlan201
Internet  192.168.201.103         5   0018.fe6b.187f  ARPA   Vlan201
Internet  192.168.201.102         0   0026.553e.050a  ARPA   Vlan201
Internet  192.168.201.105        78   000f.fe2e.290e  ARPA   Vlan201
Internet  192.168.201.104        82   000f.2034.4b32  ARPA   Vlan201
Internet  192.168.201.107        83   0014.c20a.11c3  ARPA   Vlan201
Internet  192.168.201.106        89   000d.9d99.12f4  ARPA   Vlan201
Internet  192.168.201.109        89   000f.20fd.4973  ARPA   Vlan201
Internet  192.168.201.108 4   000f.2034.4b2f ARPA   Vlan201
Internet  192.168.201.111        89   000f.fe9d.976d  ARPA   Vlan201
Internet  192.168.201.110        86   000f.fe40.d64b  ARPA   Vlan201
Internet  192.168.201.113         0   000f.fec8.6605  ARPA   Vlan201
Internet  192.168.201.112        89   0014.c20c.89f5  ARPA   Vlan201

Using include Vlan201 I cut the list to the single VLAN that connect to my 2960 switch, it is a good way to shorten the long list of every device in the network.
You can see that MAC 000f.2034.4b2f match the IP 192.168.201.108 and all I have to do now is run nslookup and get the machine name.

OFF TOPIC – PAC-MAN is 30yr old!

Check this cool Google doodle. You can actually play on Google‘s home page doodle!

SQL – SELECT part II

I’m still working on SQL Course2, working on the more advanced parameters.

Running the practice query I made a mistake or maybe not? you’ll be the judge:

Based on item_oreder table that has the following columns – customerid, order_date, item, quantity, price I was asked to query the following:

How many orders did each customer make? Use the items_ordered table. Select the customerid, number of orders they made, and the sum of their orders if they purchased more than 1 item.

This is my code and the result:

SELECT customerid, count(customerid), sum(price)
FROM items_ordered
GROUP BY customerid
HAVING sum(quantity) > 1;

I was reading “purchased more than 1 item” as quantity and as I understand it (and this is more of an English than SQL understanding) if the customer ordered 2 items or more in one purchase it counts to this matter.

The author of the course think differently as the suggested code is a bit different:

SELECT customerid, count(customerid), sum(price)
FROM items_ordered
GROUP BY customerid
HAVING count(customerid) > 1;

Unlike my code (and understanding), this solution count the number of different orders and not the quantity of items per order. The difference between the suggested solution and my solution is 4 Lawnchairs and maybe an English grammar class 😉

This is a great example to the power of the SELECT command options and their flexibility but it is also a reminder to the thin layer between nailing or failing.

SQL – SELECT part I

I’ve been working on the second SQL Course which focus on SELECT statements.

Like a newly built network environment or Active Directory forest, SQL’s day-to-day work is more of a routine work and less of the creative side. SELECT for SQL is like the show command in a Cisco IOS – simple but powerful, flexible and by far the most used command.

Definition: SELECT statement retrieves rows from the database and enables the selection of one or many rows or columns from one or many tables.

The main syntax options for the SELECT statement are:

SELECT select_list [ INTO new_table ]

[ FROM table_source ] [ WHERE search_condition ]

[ GROUP BY group_by_expression ]

[ HAVING search_condition ]

[ ORDER BY order_expression [ ASC | DESC ] ]

FROM is the only mandatory option (you must point the statement to a table). Use the other options at your will to filter the retrieved data and sort it in a user-friendly way.

Basic SQL commands

May 18, 2010 2 comments

Counting down to my last day I’ve received good feedback from co-workers and friends. People don’t tell you how they appreciate your work until you leave but better later than never and it does feel good 🙂

I started working on my SQL skills using SQL Course, an online tutorial that go over the basic commands and allow creating real tables on their server. Using this tutorial you can practice, verify your results and make mistakes.

While I do not have tons of experience I did work with our Oracle database and used the basic commands so I had no problems here.
Here are some of the commands and results while following the tutorial’s instructions.
When creating a table it is very important to use the correct data types and size. Typical mistakes are names, titles or addresses that do not have enough characters. I’ve created an employee table named myemp_rn0112.:

create
table myemp_rn0112
(firstname varchar(15), lastname varchar(15),
title varchar(30), age number(3), salary number(7))

The next step is populating the table, using the insert command:

insert into myemp_rn0112
(firstname, lastname, title, age, salary)
values (‘Jonei’, ‘Weber’, ‘Secretary’, 28, 19500)

Following the tutorial’s instructions I’ve made few updates to the table, using the update command:

update myemp_rn0112
set salary = salary + 3500
where salary < 35000

The next step is data removal, using the delete command:

delete
from myemp_rn0112
where firstname = ‘Jonei’ and lastname = ‘Weber-Williams’

To final step is table removal – not one row or column but the entire table. Deletion of a table is easy but dangerous and you must be careful.  If you’re sure that there is no need of a table, use the drop command to delete it:

drop table myemp_rn0112

This was just a basic reminder but if you have to refresh your memory this is a good start. My next step is SQL Course2.

End of an era

May 15, 2010 4 comments

You can call it a coincidence, luck or destiny but the day after my CCNP completion I noticed a job post that two weeks later became a signed contract.

Back in June 2002, during the FIFA world cup held in Korea\Japan I started working for my current employer, a broker dealer.
In exactly 4 weeks, June 2010 – 8 years, 3 kids and 1 CCNP later the world cup is here again and I am about to start my new job. Coincidence?

In my new job I’ll join the company’s support team and after few month of intensive training I’ll start working on customer tickets. Since they work with enterprise level customers I’ll have to adjust my thinking and use my entire set of tools.

I’m very excited about this new opportunity and going to use the time I have before I start working to improve some of my skills, starting with SQL. Expect some SQL notes in the coming days.