Wireless virtualization has emerged as one of the efficient ways to overcome numerous wireless networking challenges such as resource sharing by allowing multiple concurrent virtual wireless networks having run on shared physical wireless infrastructure. Spectrum sharing in wireless networks focuses on increasing the usage efficiency of radio frequency (RF) spectrum with its increasing demand. To reduce uncertainties that accompany the spectrum sharing process caused by RF sensing, database-based spectrum sharing allows opportunistic spectrum access through occupancy information query of a spectrum database. In this article, we propose a 2-level hierarchical spectrum allocation framework for multiple service-based virtual networks (VN) by leasing wireless resources from Wireless Infrastructure Providers (WIPs). The framework leverages the software defined network (SDN)-enabled virtualization where network parameters are configured based on the operating environment on the fly. This article focuses on the competition between multiple VNs to get best RF channels to serve their users while eliminating the need for one-to-one contracts between VNs and WIPs. We develop a mathematical model for the spectrum allocation scheme which allows heterogeneous network configurations with better economic benefit. Using network segments formed based on available sharable resources, the allocation scheme is localized which makes the scalability of this scheme possible. A trust-based security mechanism is also proposed for early detection and prevention of security attacks to maintain the availability attribute of the resource allocation process. Simulation results show that spectrum sharing is efficient, and assures service availability to perceived legitimate VN users.