Created
October 5, 2017 18:51
-
-
Save moiz-frost/afccda97d728147ed2e23e8fbcadad55 to your computer and use it in GitHub Desktop.
Try this as well
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unlock HR, Scott etc. users in Oracle Database 12c. | |
Step 1: | |
C:\> sqlplus / as sysdba | |
SQL> SHOW con_name | |
SQL> SELECT name, con_id FROM v$pdbs; | |
SQL> SELECT name FROM v$active_services WHERE con_id = 3; | |
Step 2: Update tnsname.ora file | |
PDBORCL = | |
(DESCRIPTION = | |
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) | |
(CONNECT_DATA = | |
(SERVER = DEDICATED) | |
(SERVICE_NAME = pdborcl) | |
) | |
) | |
Step3: Switch the container from CBD$ROOT to PDBORCL | |
C:\> sqlplus / as sysdba | |
SQL> ALTER SESSION SET CONTAINER = pdborcl; | |
SQL> SHOW con_name; | |
Step 4: Open the pluggable database PDBORCL | |
SQL> SELECT name, open_mode FROM v$pdbs; | |
SQL> ALTER PLUGGABLE DATABASE open; | |
Step 5: Unlock the HR user | |
SQL> ALTER USER hr IDENTIFIED BY hr ACCOUNT unlock; | |
Step 6: Log in to your database using HR user | |
SQL> conn hr/hr @pdborcl; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment