Herbig Ae/Be stars are intermediate-mass pre-main sequence stars surrounded by circumstellar dust disks. Some are observed to produce jets, whose appearance as a sequence of shock fronts (knots) suggests a past episodic outflow variability. This jet fossil record can be used to reconstruct the outflow history. We present the first optical to near-infrared (NIR) VLT/X-shooter spectra of the jet from the Herbig Ae star HD 163296. We determine physical conditions in the knots, as well as their kinematic launch epochs. Knots are formed simultaneously on either side of the disk, with a regular interval of ~16 yr. The velocity dispersion versus jet velocity and the energy input are comparable in both lobes. However, the mass loss rate, velocity, and shock conditions are asymmetric. We find Mjet/Macc ~ 0.01-0.1, consistent with magneto-centrifugal jet launching models. No evidence for dust is found in the high-velocity jet, suggesting it is launched within the sublimation radius (<0.5 au). The jet inclination measured from proper motions and radial velocities confirms it is perpendicular to the disk. A tentative relation is found between the structure of the jet and the photometric variability of the source. Episodes of NIR brightening were previously detected and attributed to a dusty disk wind. We report for the first time significant optical fadings lasting from a few days up to a year, coinciding with the NIR brightenings. These are likely caused by dust lifted high above the disk plane; this supports the disk wind scenario. The disk wind is launched at a larger radius than the high-velocity atomic jet, although their outflow variability may have a common origin. No significant relation between outflow and accretion variability could be established. Our findings confirm that this source undergoes periodic ejection events, which may be coupled with dust ejections above the disk plane.