Consider a general linear Hamiltonian system∂tu=JLu\partial _{t}u=JLuin a Hilbert spaceXX. We assume that L:X→X∗\ L:X\rightarrow X^{\ast }induces a bounded and symmetric bi-linear form⟨L⋅,⋅⟩\left \langle L\cdot ,\cdot \right \rangleonXX, which has only finitely many negative dimensionsn−(L)n^{-}(L). There is no restriction on the anti-self-dual operatorJ:X∗⊃D(J)→XJ:X^{\ast }\supset D(J)\rightarrow X. We first obtain a structural decomposition ofXXinto the direct sum of several closed subspaces so thatLLis blockwise diagonalized andJLJLis of upper triangular form, where the blocks are easier to handle. Based on this structure, we first prove the linear exponential trichotomy ofetJLe^{tJL}. In particular,etJLe^{tJL}has at most algebraic growth in the finite co-dimensional center subspace. Next we prove an instability index theorem to relaten−(L)n^{-}\left ( L\right )and the dimensions of generalized eigenspaces of eigenvalues of JL\ JL, some of which may be embedded in the continuous spectrum. This generalizes and refines previous results, where mostlyJJwas assumed to have a bounded inverse. More explicit information for the indexes with pure imaginary eigenvalues are obtained as well. Moreover, when Hamiltonian perturbations are considered, we give a sharp condition for the structural instability regarding the generation of unstable spectrum from the imaginary axis. Finally, we discuss Hamiltonian PDEs including dispersive long wave models (BBM, KDV and good Boussinesq equations), 2D Euler equation for ideal fluids, and 2D nonlinear Schrödinger equations with nonzero conditions at infinity, where our general theory applies to yield stability or instability of some coherent states.