We have 2 pluggable databases in the same cdb. Lets call them pdb1 and pdb2. These are in out test environment and you can think of thwm as separate uat environments. Each pdb has the defaul service (pdb1/pdb2) as well as 1 service i created (pdb1_s1/pdb2_s2). Several java applications point at either of the pdbs (uat1 app servers point at pdb1 sercices, uat2 servers point at pdb2). Pbd1 and pdb2 have the same tables but with different data.
I would like to 'swap' the pdbs such that uat1 servers still use pdb_s1 service but that service really points at pdb2. Why? Lets say uat1 is the main env we test in but the data in that database (pdb1) is old/corrupted. We cant switch to uat2 for testing since that has other issues in the java servers.
I have 12c installed locally to test a solution. I am using dbms_services since srvctl doesnt seem to work on non clustered env (but in the end will need to get this solution using srvctl since uat is clustered).
I found the only way to accomplish swapping the services is to delete the services from both pdbs and then add them back in opposite pdb (create pdb1_s1 in pdb2 and create pdb2_s1 in pdb1). Then i rename the pdbs (pdb1-> pdb2 and pdb2->pdb1). It sort of works.
The issue is that the default service (pdb1) still points to pdb1. I tried deleting pdb1 service from pdb1 and creating pdb2 service in pdb1 but caused issues (and the service does not start when i restart the database).
Is it possible to delete default service and create a new default service with new name?
How do i make non default services start when the server starts? I tried save state but that doesn seem to work.