Tomography (CBCT) images provides crucial diagnostic value for diseases. However, existing methods have not effectively addressed the challenge of accurately segmenting teeth, root canals, and their boundaries from numerous non-tooth tissues. In this paper, we propose a Dualview Dual-boundary Dual U-Nets (D3UNet) for automatic segmentation of teeth, root canals, and their boundaries in oral CBCT images. D3UNet introduces a dual-view segmentation framework, including a global view and a local view. In the global view, preliminary segmentation is conducted to locate the regions of interest (ROIs) of teeth in the enhanced 2.5D CBCT images after slice fusion. In the local view, images are cut based on the position information of ROIs and then fed into the Multiscale Dual-Boundary Dense U-Net (MD2UNet) for fine segmentation, thereby eliminating the negative impact of non-tooth tissues and significantly reducing computational costs. We propose a dual-boundary loss function to enhance attention to the boundaries of teeth and root canals, improving the segmentation accuracy of small target regions. We applied D3UNet on a new CBCT image dataset with 300 patients collected from the hospital, which will be publicly released. Compared to other competing methods, D3UNet improves the Dice coefficients on teeth and root canals by 1.04% and 1.97%, respectively. All our code and CBCT dataset are publicly released at https://github.com/WANG-BIN-LAB/D3UNet.