1

I tried to install Oracle database 12c on my machine following the documentation:

http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/12c/r1/Windows_DB_Install_OBE/Installing_Oracle_Db12c_Windows.html

I have successfully installed the database itself and can login to the database pdborcl using:

sqlplus sys/Oracle_1@pdborcl as sysdba

I unlocked the hr user following the instruction using:

alter user hr identified by hr account unlock;

However, when I tried to connect to the database using the newly unlocked user: hr, it gives an error message:

SQL> connect hr/hr@pdborcl
ERROR:
ORA-01035: ORACLE only available to users with RESTRICTED SESSION privilege.

Warning: You are no longer connected to ORACLE.

Can someone let me know how to solve this problem? Is this something with licensing?

UPDATE:

I actually tried:

alter system disable restricted session;

What I get is:

ERROR at line 1:
ORA-65144: ALTER SYSTEM DISABLE RESTRICTED SESSION is not permitted.

The query: select logins from v$instance returns:

LOGINS
---------
ALLOWED
3

5 Answers 5

6

If alter system disable restricted session doesn't work it means that there are patch violations

Check the status with below command:

select * from PDB_PLUG_IN_VIOLATIONS;

If post steps did not complete properly then it will keep PBD's in restricted mode. Run the below steps:

sqlplus / as sysdba

shutdown immediate
startup upgrade
alter pluggable database all open upgrade;
quit
cd $ORACLE_HOME/OPatch
./datapatch -verbose

check the log, should be no errors

sql> shutdown immediate
sql>startup 
sql> alter pluggable database all open;
2

Try below Steps. Hope its useful for you

Few days back it worked in this way for me

SQL> select logins from v$instance;

    LOGINS
    ----------
    RESTRICTED

SQL> alter system disable restricted session;

    System altered.

SQL> select logins from v$instance;

    LOGINS
    ----------
    ALLOWED

If won't work try this Post restart of the Database Server

1
  • you need to do it with sysdba user. Have you tried restarting DB server?
    – Vishal
    Commented Oct 8, 2015 at 6:47
2

Check if your PDB is in restricted mode by entering show pdbs. If under Restricted it says YES, then you have to just shut down the instance and start it up again. Here's how:

SQL> shutdown immediate

Pluggable Database closed.

SQL> startup

Pluggable Database opened.

SQL> show pdbs

CON_ID CON_NAME                       OPEN MODE  RESTRICTED
------ ------------------------------ ---------- ----------
     3 PDBORCL                        READ WRITE NO
0

Your database was opened with restricted session. As sysdba run the following command to dissable restrcited session option:

alter system disable restricted session;
1
-4
grant connect to user;

grant all privileges to user;
1
  • No, this won't solve this particular problem. Commented Mar 2, 2017 at 8:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.