Each credential key is unique, so for example, let's say I want a wallet entry for two different users to the same database. I would do this:
mkstore -wrl c:\oracle\wallet -createCredential MYDB1 scott tiger
mkstore -wrl c:\oracle\wallet -createCredential MYDB2 hr hr
(if I get a "already exists" error with either, it means that MYDB1 or MYDB2 or already in the wallet, you can remove it with -deleteCredential)
Then my tnsnames.ora has an entry for each key,
MYDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = np12)
)
)
MYDB2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = np12)
)
)
And then its just a case of connecting with those aliases
C:\Users\comcdona>sqlplus /@mydb1
SQL*Plus: Release 12.1.0.2.0 Production on Thu Jun 23 10:10:05 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Sat Jun 04 2016 11:36:33 +08:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
SQL> sho user
USER is "SCOTT"
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
C:\Users\comcdona>sqlplus /@mydb2
SQL*Plus: Release 12.1.0.2.0 Production on Thu Jun 23 10:10:16 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Thu Jun 23 2016 10:08:22 +08:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
SQL> sho user
USER is "HR"