ORACLE12C database Find the Scott account method

Source: Internet
Author: User

Because the concept of CDB and PDB is introduced in the ORACLE12C database (refer to the article http://www.cnblogs.com/kerrycode/p/3386917.html of Xiaoxiang Hermit for details), The Scott/tiger account we used to practice SQL statements is placed in the PDB, and when we link to a 12c database, the default is login CDB

This has led to a lot of practical oracle12c database Novice can not find the familiar Scott account ...

Here's how to find the Scott account in the ORACLE12C database

The first step "start" executes the "sqlplus" command, open the Oracle command line

Step two log in as SYSDBA login to SYS account

The third step is to execute the show con_name command to see the database container that is currently located

As you can see, the default after login is under the Cdb$root container

The fourth step executes the command alter session set CONTAINER=PDBORCL

(this name is the name of the PDB plug-in database you created when you installed Oracle) Switch Database Container

We can see that after the command executes, the database container becomes PDBORCL

Fifth Step execution Command select username from dba_users where username like ' SCOTT ';

(Note that Scott has to capitalize, otherwise it cannot be queried)

You can see that the query has a record stating that there is a Scott account in the PDBORCL

Step sixth connect to Scott account

The seventh step executes the command select * from EMP;

View the table data below Scott.

At first I couldn't find any of the tables under Scott, anyway.

Then I thought about it, maybe I didn't choose "Create a Database with sample scenario" When I was doing an Oracle installation

So there's no tables and no data under Scott's account.

The eighth step is found in the directory D:\app\oracleuser\product\12.1.0\dbhome_1\RDBMS\ADMIN Scott.sql

Open the file and execute the SQL on the command line sequentially so we create the table and the data under the Scott account

The Nineth step executes the query statement again

With the above, we can use Scott account (*^__^*) hehe ...

ORACLE12C database Find the Scott account method

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.