ORACLE12C new feature PDBORCL, how do I log in to a regular user Scott?

Source: Internet
Author: User
Tags sqlplus

1. Install oracle12c please refer to http://jingyan.baidu.com/article/fea4511a78fc22f7ba912576.html

However, do not set the password until the last step of setting the password. As shown in the following:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7E/77/wKioL1cBagagTa_XAAGOuVQhLBQ908.png "title=" Temporarily ignore password management, remember that URL is ok. png "alt=" Wkiol1cbagagta_xaagouvqhlbq908.png "/>

Temporarily ignore password management, remember that URL on the line https://localhost:5500/em

2. Backup the Ora configuration file

Like G:\app\shaw\product\12.1.0\dbhome_1\NETWORK\ADMIN\, there are 3 ora files in this path.

Back up these 3 files and then modify Tnsnames.ora

Copy the last piece of code to the end, modify the beginning and end of the ORCL to PDBORCL

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7E/7A/wKiom1cBaW3y7KmPAAAyQUxkgWU206.png "title=" 1. Tnsnames.ora.png "alt=" Wkiom1cbaw3y7kmpaaayquxkgwu206.png "/>

3. Log in with SYS and set the SYS and system password

Run cmd Enter input sqlplus return input Sys/as sysdba Enter and return

C:\users\administrator>sqlplus


Sql*plus:release 12.1.0.2.0 Production on Monday April 4 01:13:17 2016


Copyright (c) 1982, Oracle. All rights reserved.


Please enter user name: Sys/as sysdba

Enter Password: (direct return)


Connect to:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0-64bit Production

With the partitioning, OLAP, Advanced Analytics and Real application testing options


sql> alter user SYS identified by Hello123;

The user has changed.

sql> alter user system identified by Hello123;

The user has changed.

4. Switch session to PDBORCL, start PDB, unlock Scott user with SYS login PDB

Sql> alter session set CONTAINER=PDBORCL;

The session has changed.

Sql> Startup

Next, log in to PDBORCL with Sys

sql> Conn [email protected]/hello123 as SYSDBA;

Unlock Default User Scott

sql> alter user Scott account unlock identified by Tiger;

The user has changed.

5. Log in with Scott for a simple test

sql> Conn [Email Protected]/tiger

is connected.

Sql> Select Ename,job,sal from emp where rownum <= 10;


Ename JOB SAL

---------- --------- ----------

SMITH Clerk 800

ALLEN salesman 1600

WARD salesman 1250

JONES MANAGER 2975

MARTIN salesman 1250

BLAKE MANAGER 2850

CLARK MANAGER 2450

SCOTT ANALYST 3000

KING President 5000

TURNER salesman 1500


10 rows have been selected.


6. To automatically start the PDB by creating a trigger, you don't need to log in to CDB with SYS each time, and then start the PDB.

The trigger code is as follows:

sql> CREATE OR REPLACE TRIGGER Open_all_pdbs

2 after STARTUP

3 on DATABASE

4 BEGIN

5 EXECUTE IMMEDIATE ' alter pluggable database all open ';

6 END Open_all_pdbs;

7/

Trigger has been created

Sql> shutdown (because the previous step has already been started, this execution is closed to see the shutdown process and then open)

The database is closed.

The database has been uninstalled.

The ORACLE routine has been closed.

Sql> Startup

The ORACLE routine has been started.


Total System Global area 2550136832 bytes

Fixed Size 3048872 bytes

Variable Size 671091288 bytes

Database buffers 1862270976 bytes

Redo buffers 13725696 bytes

The database is loaded.

The database is already open.

sql> Conn [Email Protected]/tiger

is connected.

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7E/77/wKioL1cBbOfgQe6sAABnHE2j5e8959.png "title=" 2. Oracle 12c Pdborcl.png "alt=" Wkiol1cbbofgqe6saabnhe2j5e8959.png "/>

7. Two points to note:

① 2 Services must be turned on, others can be banned

Oracleoradb12home1tnslistener: Indicates the listening service.

ORACLESERVICEORCL: Represents the primary service for the database.


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7E/7A/wKiom1cBbA3hw8JEAAAhbyoILYM943.png "title=" 3. ORACLE12C Key Services (master and Listener services). png "alt=" Wkiom1cbba3hw8jeaaahbyoilym943.png "/>


② Login Https://localhost:5500/em

User name sys password Hello123 tick "SYSDBA identity"

User Name System Password Hello123 uncheck "Sysdba identity"


ORACLE12C new feature PDBORCL, how do I log in to a regular user Scott?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.