Season the beef shanks with salt and pepper. Heat the oil in a Dutch oven over medium-high heat. Brown the shanks, in batches if necessary, until golden brown on both sides, about 3 minutes per side. Transfer to a plate. Reduce the heat to medium, add the onion, celery and carrot to the pot and cook, stirring, until just starting to soften, about 3 minutes. Add the tomato paste and cook, stirring, 1 minute. Add the wine, bring to a boil and simmer until reduced by about half. Add the tomatoes, garlic, rosemary, and 1/2 teaspoon salt, then return the shanks to the pot. Nestle the shanks into the tomatoes, then add the stock (it should almost cover the shanks). Bring to a simmer. Cover the pot, transfer to the oven and braise until the meat is very tender, about 3 hours.
Transfer the cooked shanks and their bones to a cutting board. Use a ladle to remove as much of the fat from the surface of the cooking liquid as possible. Coarsely shred the meat from the shanks, discarding any large chunks of fat. Return the shredded meat to the sauce and simmer on the stove over medium-high heat until slightly reduced, about 10 minutes. Season with salt and pepper and serve. The bones can be served on the side if desired; the marrow is delicious spread on toast.