I would like to make a database with multiple contigs to map my reads against this database. However, I don't know how to use bowtie2 and samtools to select reads that mapped uniquely to a specific ORFs and reads which charted in two ORFs. How do I do this filter in samtools?
Depending on your requirement, I would suggest you to use BWA than bowtie2. Bowtie2 has -k option that fetches the top k mapping positions. But these mapping positions may have different alignment scores. But BWA provides "X0:Number of best hits" tag in the SAM/BAM file that tells you how many positions a read can be aligned with the best alignment score. I think this is more suitable for your problem. For example, if you use -k2 option in Bowtie2, it may give you two positions but the first position may have better alignment score than the second. BWA will have X0:1 for such read as there is only one best alignment position. Also, -k2 will only fetch the first two possible alignments for that read. There can be more alignments possible. In that case, BWA 'XT' tag will give all number of suboptimal alignments.
In short, both these aligners can be used for your problem but the output from BWA will be easy to play with compared to Bowtie2.
What definition of "mapped uniquely" do you want to go by? If by that you mean, "mapped at least slightly better to one specific location than any other", then just use reads with MAPQ scores >= 2 (bowtie2 will asign a MAPQ of 1 or 0 if a read can align equally well to multiple places). If you want a bigger difference between a best and second best alignment to call something unique, then just up that threshold (you might want a higher threshold anyway, depending on what you intend to do with the results). To extract reads above a certain threshold (say, 2) from foo.bam and put them in foo.filtered.bam: