Ever done that for 1 database? That’s easy. Just change the fin.flf in your DB server subdirectory. You don’t even need to restart the service.
Ever done that for 100 databases? That’s easy too. See my previous point, you just need to do that 100 times.
What do you say? You don’t want to? Well, neither do I. So this is why I created this little trick (my project leader pointed me in the direction symbolic links so I investigated it how I could use it).
The way to do it is to use some ’shortcut’-mechanism. But not a windows-shortcut to a file, but rather on the NTFS-level. It is called a symbolic link or hardlink (there is a difference but I have to admit I only found 1 small difference). I’ll give some links so you can check it out: http://en.wikipedia.org/wiki/NTFS_symbolic_link, http://en.wikipedia.org/wiki/Symbolic_link , http://en.wikipedia.org/wiki/Hard_link . (It also works for subdirectories, but I am not using this possibility). I found that a symbolic link creates an entry in the subdirectory with 0 bytes for the file in it and a hardlink has the size of the original file.
The idea is that in 1 place you have the real file. And in other places you have a filename in your subdirectory that behaves like a real file but points to the real file.
When your license is expiring, you just need to change the real file. And you only need to do it once!
The command for creating a hardlink in Windows 2003 and XP is (c:\nav\fin.flf is the real file).
fsutil hardlink create "C:\…\fin.flf" c:\nav\fin.flf
The command for a hardlink in Vista, Windows 2008, Windows 7 is
Mklink /H "C:\…\fin.flf" c:\nav\fin.flf
But before you can run the command, you need to delete the original file.
How did I proceed?
-First point is that you have to find all places where a fin.flf is used because I have to update them all. There is the find of explorer, but it is not really useful to create the commands to create the hard links (you can always do that manually… remember 100 times…). But this commandline will do the trick (another trick of my project leader):
for /f "usebackq delims=" %%i in (`dir /s /b "%2\fin.flf"`) do @echo fsutil hardlink create "%%i" >c:\nav\create_hard_Links_to_fin_flf.cmd
This does a recursive dir to find the fin.flf files and writes them to a file.
I just need to control the file, remove the entries that are not needed and run the command-file. But first I need to delete the original files in the subdirs.
-The explorer find-function is handy to find all the fin.flf files I want to delete. IMPORTANT: before deleting the files, you NEED to create the command-file to create the hardlinks. After you deleted the files, you can’t create the commandfile anymore.
-Changing the security of the original file, also changes the security of the hardlinks. Changing the security of a hardlink should be avoided. I tried it and it made a mess of the security of the hardlink and also of the original file.
-Deleting the original file does NOT delete the hardlinks. Because , in reality, each file is a hardlink to itself. So only after deleting all hardlinks, the physical file is deleted.
How to update the license after all the hardlinks have been created?
Put the new license somewhere and give it the same name and the security you want. Then overwrite the original file with this file.
IMPORTANT: DO NOT change the name of the old file and then copy the new file to it. This will NOT update the hardlinks because remember that the original file is in reality a hardlink to itself.
BTW: just a reminder: it serves to nothing having the license in the client-subdirectory if you don’t open the DB directly without a server.