Thursday, 10 September 2009

Route Add

Static Route Add in the server:

If you cannot ping or net use, then you may manually add the route in the server where you are targeting

route ADD 10.1.1.0 MASK 255.255.255.0 192.168.1.8

10.1.1.0 or 10.1.1.12 - Destination IP or Destination Subnet or Target Server IP
255.255.255.0 - Target or Destination Server subnet mask
192.168.1.8 - Gateway IP Address - Target Server Gateway

Adding a TCP/IP Route to the Windows Routing Table

Adding routes to your machine is a useful testing tool for some of these situations.

Or another explanation is:

Syntax:

route ADD “network” MASK “subnet mask” “gateway ip”

For example, if you were on the 192.168.1.0 network, and you had a gateway on 192.168.1.12 configured to access the 10.10.10.0/24 network, you would use a route add statement like this:

route ADD 10.10.10.0 MASK 255.255.255.0 192.168.1.12

Your routing table should now reflect that change, and all traffic to the 10.10.10.x range will now be sent over to the gateway machine.

The route add change will only stick across reboots if you add it with the -p flag, as in the following:

route -p ADD 10.10.10.0 MASK 255.255.255.0 192.168.1.12
route -p add 10.0.1.0 mask 255.255.255.0 10.0.0.2

Please see below link as well

http://www.mydigitallife.info/2008/12/25/how-to-add-route-to-tcpip-routing-table-with-windows-routing-and-remote-access-console-or-dos-prompt/

How to fix orphaned SQL Server users

--------------------------------------------------------------------------------

Brief:

When you restore a MS SQL Server database on a different machine, you cannot access the database until you fix the permissions.

--------------------------------------------------------------------------------

Detail

The problem is that the user in the database is an "orphan". This means that there is no login id or password associated with the user. This is true even if there is a login id that matches the user, since there is a GUID (called a SID in Microsoft-speak) that has to match as well.

All of these should be done as a database admin, with the restored database selected.

Firstly, make sure that this is the problem. This will lists the orphaned users:

EXEC sp_change_users_login 'Report'

If you already have a login id and password for this user, fix it by doing:

EXEC sp_change_users_login 'Auto_Fix', 'user'

If you want to create a new login id and password for this user, fix it by doing:

EXEC sp_change_users_login 'Auto_Fix', 'user', 'login', 'password'