The dual battery switch is the simplest and easiest to construct. It is appropriate for the boater that simply wants to "day-boat" but wants the safety of having a backup battery on board. The typical boater might be a trailer boater that wants to anchor out for the day with the stereo and other electronics running, and wants to ensure they have a spare battery to restart the engine in the event they drain their primary battery.
In this configuration, a dual battery switch is connected to the engine battery terminal, and a second battery added. This is about as simple as it gets, and is an effective setup. However, some battery management discipline must be excersized.
The typical battery management scenario consists of placing the dual battery switch in the 1 position, and running the boat for the day. The next day, switch the battery switch to the 2 position and run the boat. This alternating of the batteries daily will ensure both batterys get excersized and periodically charged.
If one battery dies when you are boating, simply move the battery switch to the other battery and continue on your way.
Note that only the battery that is in operation will be charged. The second battery will remain completely disconnected. Therefore the reasoning behind the daily alternating of the batteries is to ensure both batteries obtain a periodic charge, as well as detect if a battery is bad.
It is possible to charge both batteries by placing the selector switch into the both position. And, if in the both position, both batteries will start the engine. However, the both position should only be used in an emergency, since the risk is that once the engine is shut down, if the selector switch remains in the both position, the batteries remain connected in parallel. In this situation, both batteries will be discharged when you are at anchor and run the stereo - which defeats the idea of installing a backup battery. So if you use this approach, be sure to take the battery switch out of the both position when you shut the engine down. Otherwise you could end up with two discharged batteries.
Some discussion of switches are in order. Historically, the battery switch, known as a "1B2 Switch" had a position for Battery 1, Both Batteries, Battery 2, and OFF. This switch provided the ability to use Battery 1, Battery 2, both batteries in parallel, and completely disconnecting the batteries.
Recently, a newer type of battery switch has been invented; the Engine-House switch. This switch differs in that it's intended purpose is to have a separate battery for the engine and house circuits. "House" generally means the boat's DC power needs for lights, electronics, fresh water pump, and so on - basically everything not engine related. This swith also has a "combine" or emergency position where both batteries are paralleled. This provides the same advantage as the 1B2 switch in that a second battery can be used for engine started. However, the disadvantage is that potentially you could be using both batteries at the same time, without strictly having a fresh battery in reserve.
As shown below, using an Engine-House type switch requires a modification to the existing boat's wiring, as you have to separate the boat's house circuits from the engine circuits, as well as adding a main breaker for the house system. This adds complexity, and may be beyond the capability of many boat owners. Fortunately regardless of your choice, both 1B2 and E-H switch configurations will provide satisfactory results.
Other switch considerations: If a battery becomes disconnected from the alternator while the engine is running, this open circuit can damage the alternator/regulator. For this reason, if you desire the ability to switch from battery to battery, you must obtain a switch that has "make-before-break" contacts. While most switches do, not all of them are this way, so you need to ensure the switch is of this type. A make-before-break contact makes the connection to the next position before breaking the connection of the previous position. This ensures there is always a battery connected to the alternator. Even then, you must never turn the switch into the OFF position with the engine running, as this obvously disconnects the batteries as well, also damaging the alternator/regulator.
Some switches also have a field disconnect set of contacts. This alleviates the make-before-break problem by temporarily disconnecting the alternator field as the switch is rotated. However, this also requires an alternator having external field disconnect terminals, and properly wired to the switch. I do not believe this to be a common setup, and most of the time, ensuring a make-before-break switch is used (and never selecting the OFF position) is what is common.
Ignition proofing. Again, according to 33CFR183.410, all components within the engine compartment must be ignition proof. This term means the component is not capable of making a spark, or any spark that is generated is contained within the device. This prevents the likelyhood of an explosion in the engine compartment. Therefore, if you place the switch in the engine compartment, it must be ignition proof rated. Most, but not all battery switches are ignition proof rated.
When locating the second battery, we again refer to our friend 33CFR183.420, which specifys how a battery must be secured. Essentially, the battery must be secured so that it does not move more than one inch when a force of 90lbs is applied from any direction. It must be noted that this regulation is a bit lacking when it comes to the large Trojan golf-cart type batteries that are sometimes used for house circuits. These batteries were beyond the scope of the regulation when it was written. These batteries are so heavy that the 90lb force test may not be applicable, and may need further securing. Use common sense when installing the batteries, and remember that the USCG regulation is the minimum requirements. You can use a more secure mounting method if you wish.
33CFR183 also states that the battery must not be located directly above or below any fuel tank, fuel filter, or fuel line fitting. In addition, any metallic fuel line within 12 inches of the battery must be shielded with dielectric material (so you don't short it out on the battery terminals, I suppose).
When wiring two batteries, you must ground both batteries at a common ground at the engine. It is not satisfactory to run a single ground wire to one battery and tap to the other battery. While 33CFR183.415 is applicable for dual engines, it is common industry practice - even with a single engine - to ground batteries at a common ground at the engine.
While it is poor practice, if you insist on using a common ground for both batteries, as shown below, you must ensure that the ground wire to the engine block can handle the increased current from both batteries. This typically requires re-running a much more expensive cable, so why not run a second cable from the new battery in the first place?
Finally, the battery must be fitted with insulated terminal post covers or battery box to prevent contact with the positive terminal.