Key Features of the Cache Manager (II)

Single, Centralized System Cache
Some operating systems rely on each individual file system to cache data, a practice that results either in duplicated caching and memory management code in the operating system or in limitations on the kinds of data that can be cached. In contrast, Windows offers a centralized caching facility that caches all externally stored data, whether on local hard disks, floppy disks, network file servers, or CD-ROMs. Any data can be cached, whether it’s user data streams (the contents of a file and the ongoing read and write activity to that file) or file system metadata (such as directory and file headers).

The Memory Manager
One unusual aspect of the cache manager is that it never knows how much cached data is actually in physical memory. This statement might sound strange because the purpose of a cache is to keep a subset of frequently accessed data in physical memory as a way to improve I/O performance. The reason the cache manager doesn’t know how much data is in physical memory is that it accesses data by mapping views of files into system virtual address spaces, using standard section objects (file mapping objects in Windows API terminology). As addresses in these mapped views are accessed, the memory manager pages in blocks that aren’t in physical memory. And when memory demands dictate, the memory manager pages data out of the cache and back to the files that are open in (mapped into) the cache. By caching on the basis of a virtual address space using mapped files, the cache manager avoids generating read or write I/O request packets (IRPs) to access the data for files it’s caching.

Instead, it simply copies data to or from the virtual addresses where the portion of the cached file is mapped and relies on the memory manager to fault in (or out) the data into (or out of) memory as needed. This process allows the memory manager to make global tradeoffs on how much memory to give to the system cache versus how much to give to user processes. Also, as you’ll learn in the next section, this design makes it possible for processes that open cached files to see the same data as do processes that are mapping the same files into their user address spaces.

Source of Information : Windows 7 Resource Kit 2009 Microsoft Press

Key Features of the Cache Manager

The cache manager has several key features:

• Supports all file system types (both local and network), thus removing the need for each file system to implement its own cache management code.

• Uses the memory manager to control which parts of which files are in physical memory (trading off demands for physical memory between user processes and the operating system)

• Caches data on a virtual block basis (offsets within a file)—in contrast to many caching systems, which cache on a logical block basis (offsets within a disk volume)—allowing for intelligent read-ahead and high-speed access to the cache without involving file system drivers.

• Supports “hints” passed by applications at file open time (such as random versus sequential access, temporary file creation, and so on)

• Supports recoverable file systems (for example, those that use transaction logging) to recover data after a system failure

Source of Information : Windows 7 Resource Kit 2009 Microsoft Press

The New Features in Access 2010

Access 2010 doesn’t represent as radical a change as Access 2007, which revamped the program’s main window and introduced the now-infamous ribbon. However, Access 2010 still has an impressive number of enhancements, most notably:

• Backstage view. Earlier in this Introduction, you got a glimpse of Access’s new control center for managing databases. Whether you need to open an existing database file, create a new one, print your work, or tune up Access options, backstage view gives you a bit more breathing room.

• Report refinements. Access fans have been creating reports (printable lists and summaries of their data) for years. Access 2010 gives reports a minor tune-up, with new support for Office themes (reusable font and color settings) and data bars (which represent numeric values with bars of different length).

• The WebBrowser control. This frill lets you put a web browser in one of your custom-designed database forms. For example, imagine equipping your database with your company’s website or an online product page.

• Navigation forms. As you design better and more complex databases, you’ll need a way to get around. For years, the only solution Access had for database navigation was the clumsy and irredeemably ugly switchboard manager. Access 2010 tosses that feature out and replaces it with slick navigation controls that make moving around your database as easy as browsing a website.

• Trusted databases. Access 2010 remembers the databases you trust on your computer. That means there’s no need to click Enable Content every time you open your database. It’s a small feature, but a nice one.

• Revamped macro designer. The old macro designer was a place no Access fan wanted to linger. Its dense grid of information was a depressing combination: boring and confusing. The new macro designer is dramatically different. It’s cleanly organized, with helpful pop-up tips, a collapsible display that lets you home in on the important stuff, and a drag-and-drop feature that lets you rearrange your actions with the mouse. All these changes reflect Microsoft’s new vision—that macros will become an increasingly useful part of the database developer’s toolkit, not just a poor substitute for Visual Basic code.

• Data macros. Data macros are macros that leap into action when someone inserts, edits, or deletes a record. This feature has a few quirks, but it still gives you a powerful way to track changes, synchronize data, and perform sophisticated error-checking.

• Web databases. Wouldn’t it be cool to view your Access database on the Web? And wouldn’t it be even better if you could print reports and use forms to edit that database, all without leaving the comfort of your browser? And wouldn’t it be just a little mind-blowing if a large crowd of people could use your web database all at once, even if they didn’t have Access installed on their computers? For the first time, Access 2010 makes these scenarios possible.

• Easier ribbon customization. In Access 2007, changing the ribbon was nearly impossible, unless you were willing to become a master programmer. In Access 2010, you just need a leisurely trip to the Customize Ribbon section of the Access Options dialog box, where you can add, remove, and reorder Access’s panoply of buttons to suit your preferences.

Source of Information : Oreilly Access 2010 The Missing Manual

Access vs SQL Server

Microsoft provides another database product—the industrial-strength SQL Server, which powers everything from Microsoft’s own search engine to the NASDAQ stock exchange. Clearly, SQL Server is big business, and many Access fans wonder how their favorite database software compares. One of the most important differences between Access and database products like SQL Server is that Access is a client-side database. In non-techie terms, that means that Access runs right on your personal computer. Database engines like SQL Server are server-based: They store the data on a high-powered server computer, which you access from a garden variety PC. (This interaction happens over a local network.)

Server-based databases are much more complex to set up and maintain, but they provide enhanced performance and rock-solid stability, even when thousands of people use them at once. However, the only people that require high-end databases like SQL Server are large organizations. wouldn’t last 5 minutes if it had to rely on an Access database. But Access works just fine for most small and mid-sized businesses. It’s also perfect for personal use.

Another important difference between Access and server-side database products is that Access is an all-in-one solution for storing and interacting with data. Serverside database engines like SQL Server focus exclusively on storing data (and sending that data to other computers when they request it). However, this single-minded design has a sizable price. An ordinary person can’t directly edit a database that’s stored by SQL Server. Instead, you need to use yet another program that can talk to SQL Server and ask for the information it needs. In most cases, this program needs to be hand-built by a savvy programmer. In other words, if you’re using SQL Server, you need to write a whole application before you can effectively use your database.

Sometimes, Access fans do turn into SQL Server gurus. You can start with a modest Access database and then step up to SQL Server when your needs exceed what Access provides. The process isn’t always seamless, but it’s possible. You can even keep using Access as a front end to manage your SQL Server database.

Source of Information : Oreilly Access 2010 The Missing Manual

Access vs. Excel

Access isn’t the only Office product that can deal with lists and tables of information. Microsoft Excel also includes features for creating and managing lists. So what’s the difference?

Although Excel’s perfectly good for small, simple amounts of information, it just can’t handle the same quantity and complexity of information as Access. Excel also falters if you need to maintain multiple lists with related information (for example, if you want to track a list of your business customers and a list of the orders they’ve made). Excel forces you to completely separate these lists, which makes it harder to analyze your data and introduces the possibility of inconsistent information. Access lets you set up strict links between tables, which prevents these problems.

Access also provides all sorts of features that don’t have any parallel in the spreadsheet world, such as the ability to create customized search routines, design fine tuned forms for data entry, and print a variety of snazzy reports.

Of course, all this isn’t to say that Access is better than Excel. In fact, in many cases you might want Excel to partner up with Access. Excel shines when crunching reams of numbers to create graphs, generate statistics, or predict trends. Many organizations use Access to store and manage information, and then export a portion of that information to an Excel spreadsheet whenever they need to analyze it.

Source of Information : Oreilly Access 2010 The Missing Manual

The Benefits of a Good Database

Many people use an address book to keep track of close friends, distant relatives, or annoying coworkers. For the most part, the low-tech address book works great. But consider what happens if you decide to store the same information in an Access database. Even though your contact list isn’t storing Google-sized volumes of information, it still offers a few features that you wouldn’t have without Access:

• Backup. If you’ve ever tried to decipher a phone number through a coffee stain, you know that sometimes it helps to have things in electronic form. Once you place all your contact information into a database, you’ll be able to preserve it in case of disaster, and print as many copies as you need (each with some or all of the information showing). You can even share your list with a friend who needs the same numbers.

• Space. Although most people can fit all the contacts they need into a small address book, a database ensures you’ll never fill up that “M” section. Not to mention that you can cross out and rewrite the address for your itinerant Uncle Sid only so many times before you run out of room.

• Searching. An address book organizes contacts in one way—by name. But what happens once you’ve entered everyone in alphabetical order by last name, and you need to look up a contact you vaguely remember as Joe? Access can effortlessly handle this search. It can also find a matching entry by phone number, which is great if your phone gives you a log of missed calls, and you want to figure out who’s been pestering you.

• Sharing. Only one person at a time can edit most ordinary files like Microsoft Word documents and spreadsheets. This limitation causes a problem if you need your entire office team to collaborate on a potluck menu. But Access lets multiple people review and change your data at the same time, on different computers.

• Integration with other applications. Access introduces you to a realm of timesaving possibilities like mail merge. You can feed a list of contacts into a form letter you create in Word, and automatically generate dozens of individually addressed letters.

All these examples demonstrate solid reasons to go electronic with almost any type of information.

Source of Information : Oreilly Access 2010 The Missing Manual

Using Memory Dump Files to Analyze Stop Errors

Memory dump files record detailed information about the state of your operating system when the Stop error occurred. You can analyze memory dump files manually by using debugging tools or by using automated processes provided by Microsoft. The information you obtain can help you understand more about the root cause of the problem.

You can use WER to upload your memory dump file information to Microsoft. You can also use the following debugging tools to analyze your memory dump files manually:

• Microsoft Kernel Debugger (Kd.exe)
• Microsoft WinDbg Debugger (WinDbg.exe)

You can view information about the Stop error in the System Log after a Stop error occurs. For example, the following information event (with a source of Bugcheck and an Event ID of 1001) indicates that a 0xFE Stop error occurred.

The computer has rebooted from a bugcheck. The bugcheck was: 0x000000fe (0x00000008, 0x00000006, 0x00000001, 0x87b1e000). A dump was saved in: C:\Windows\MEMORY.DMP.

Source of Information : Windows 7 Resource Kit 2009 Microsoft Press

How to Manually Initiate a Stop Error and Create a Dump File

To be absolutely certain that a dump file will be created when a Stop error occurs, you can manually initiate a Stop error by creating a registry value and pressing a special sequence of characters. After Windows restarts, you can verify that the dump file was correctly created.

To initiate a crash dump manually, follow these steps:

1. Click Start and type Regedit. On the Start menu, right-click Regedit and click Run As Administrator. Respond to the User Account Control (UAC) prompt that appears.

2. In the Registry Editor, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt\Parameters.

3. On the Edit menu, click New, DWORD (32-bit) Value, and then add the following registry value:
• Value Name: CrashOnCtrlScroll
• Value: 1

4. Close the Registry Editor and then restart the computer.

5. Log on to Windows. While holding down the right Ctrl key, press the Scroll Lock key twice to initiate a Stop error.

You cannot manually initiate a Stop error on a virtual machine that has virtual machine extensions installed.

Source of Information : Windows 7 Resource Kit 2009 Microsoft Press

Configuring Complete Memory Dump Files

A complete memory dump file, sometimes referred to as a full dump file, contains everything that was in physical memory when the Stop error occurred. This includes all the information included in a kernel memory dump file, plus user-mode memory. Therefore, you can examine complete memory dump files to find the contents of memory contained within applications, although this is rarely necessary or feasible when troubleshooting application problems.

If you choose to use complete memory dump files, you must have available space on the systemdrive partition large enough to hold the contents of the physical RAM. Additionally, you must have a paging file equal to the size of your physical RAM.

When a Stop error occurs, the operating system saves a complete memory dump file to a file named %SystemRoot%\Memory.dmp and creates a small memory dump file in the %SystemRoot%\Minidump folder. A Microsoft technical support engineer might ask you to change this setting to facilitate data uploads over slow connections. Depending on the speed of your Internet connection, uploading the data might not be practical, and you might be asked to provide the memory dump file on removable media.

By default, new complete memory dump files overwrite existing files. To change this, clear the Overwrite Any Existing File check box. You can also choose to archive or move a dump file prior to troubleshooting.

Source of Information : Windows 7 Resource Kit 2009 Microsoft Press

Configuring Kernel Memory Dump Files

By default, Windows systems create kernel memory dump files. The kernel memory dump file is an intermediate-size dump file that records only kernel memory and can occupy several megabytes of disk space. A kernel memory dump file takes longer to create than a small dump file and thus increases the downtime associated with a system failure. On most systems, the increase in downtime is minimal.

Kernel memory dumps contain additional information that might assist troubleshooting. When a Stop error occurs, Windows saves a kernel memory dump file to a file named %SystemRoot%\Memory.dmp and creates a small memory dump file in the %SystemRoot%\ Minidump folder.

A kernel memory dump file records only kernel memory information, which expedites the dump file creation process. The kernel memory dump file does not include unallocated memory or any memory allocated to user-mode programs. It includes only memory allocated to the Executive, kernel, Hardware Abstraction Layer (HAL), and file system cache, in addition to nonpaged pool memory allocated to kernel-mode drivers and other kernel-mode routines.

The size of the kernel memory dump file will vary, but it is always less than the size of the system memory. When Windows creates the dump file, it first writes the information to the paging file. Therefore, the paging file might grow to the size of the physical memory. Later, the dump file information is extracted from the paging file to the actual memory dump file. To ensure that you have sufficient free space, verify that the system drive would have free space greater than the size of physical memory if the paging file were extended to the size of physical memory. Although you cannot exactly predict the size of a kernel memory dump file, a good rule of thumb is that roughly 50 MB to 800 MB, or one-third the size of physical memory, must be available on the boot volume for the paging file.

For most purposes, a kernel memory dump file is sufficient for troubleshooting Stop errors. It contains more information than a small memory dump file and is smaller than a complete memory dump file. It omits those portions of memory that are unlikely to have been involved in the problem. However, some problems do require a complete memory dump file for troubleshooting.

By default, a new kernel memory dump file overwrites an existing one. To change the default setting, clear the Overwrite Any Existing File check box. You can also rename or move an existing dump file prior to troubleshooting.

Source of Information : Windows 7 Resource Kit 2009 Microsoft Press

Configuring Small Memory Dump Files

Small memory dump files contain the least amount of information, but they also consume the least amount of disk space. By default, Windows stores small memory dump files in the %SystemRoot%\Minidump folder.

Windows always creates a small memory dump file when a Stop error occurs, even when you choose the kernel dump file or complete memory dump file options. Small memory dump files can be used by both Windows Error Reporting (WER) and debuggers. These tools read the contents of a small memory dump file to help diagnose problems that cause Stop errors.

A small memory dump file records the smallest set of information that might identify the cause of the system stopping unexpectedly. For example, the small memory dump includes the following information:

• Stop error information Includes the error number and additional parameters that describe the Stop error.

• A list of drivers running on the system Identifies the modules in memory when the Stop error occurred. This device driver information includes the file name, date, version, size, and manufacturer.

• Processor context information for the process that stopped Includes the processor and hardware state, performance counters, multiprocessor packet information, deferred procedure call information, and interrupts.

• Kernel context information for the process that stopped Includes offset of the directory table and the page frame number database, which describes the state of every physical page in memory.

• Kernel context information for the thread that stopped Identifies registers and IRQLs and includes pointers to operating system data structures.

• Kernel-mode call stack information for the thread that stopped Consists of a series of memory locations and includes a pointer to the initial location. Developers might be able to use this information to track the source of the error. If this information is greater than 16 kilobytes (KB), only the topmost 16 KB is included.

A small memory dump file requires a paging file of at least 2 megabytes (MB) on the boot volume. The operating system saves each dump file with a unique file name every time a Stop error occurs. The file name includes the date the Stop error occurred. For example, Mini011007-02.dmp is the second small memory dump generated on January 10, 2007.

Small memory dump files are useful when space is limited or when you are using a slow connection to send information to technical support personnel. Because of the limited amount of information that can be included, these dump files do not include errors that were not directly caused by the thread that was running when the problem occurred.

Source of Information : Windows 7 Resource Kit 2009 Microsoft Press

Cloud storage is for blocks too, not just files

One of the misconceptions about cloud storage is that it is only useful for storing files. This assumption comes from the popularity of file...