0

Yesterday I installed Oracle 12c database on my PC and configured it like in this guide. Then I created two connections in SQL Developer: first one with a system user, then I created another user and made the second connection with that user. I managed to establish both connections. I even made some sample table using the second one. Well, everything worked great until I restarted my PC. After that I tried to establish a connection, but no luck with either of them. The following error message was displayed:

enter image description here

I simply don't get it. I restarted my PC normally, restarted Oracle services, also did a db shutdown and startup... nothing. Running select instance_name, status, database_status from v$instance; from SQL Plus says OPEN and ACTIVE.

enter image description here

Any suggestion? I'm simply running out of options...

6

The tutorial you linked uses the multitenant architecture with pluggable databases. I quickly read through the tutorial, and it does not cover this topic, but pluggable databases do not open automatically with the root container, unless specified otherwise. My guess is that you tried to connect the pdborcl pluggable database. Run the below:

select name, open_mode from v$pdbs;

If you see pdborcl, with open_mode = MOUNTED, issue the below:

alter pluggable database pdborcl open;

Now try connecting again. If your database version is 12.1.0.2, you can use the below after opening the pluggable database to make it start automatically the next time the whole database is restarted:

alter pluggable database pdborcl save state;

If your database version is 12.1.0.1, the above feature is not available, and you need to open the pluggable database each time manually, or create an after startup trigger in the database, for example:

CREATE OR REPLACE TRIGGER open_pdbs 
  AFTER STARTUP ON DATABASE 
BEGIN 
   EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN'; 
END open_pdbs;
/
|improve this answer|||||
  • You are absolutely correct. Thank you very much for your help! – peterremec Sep 21 '16 at 19:26
  • You made my day. I'm still new to Oracle and was exactly looking for this solution. Thanks – Vipul Dec 18 '17 at 1:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.