Oracle12 Creating a non-C # #用户并且导入数据

Source: Internet
Author: User
Tags sqlplus

Because to import DMP file, so want to build and oracle11 the same user, toss for half a day, record the process:

1, enter the Sqlplus, set up users and assign permissions

Cmd>sqlplus/nolog
Sql>conn Sys/sys as Sysdba

Sql>show Con_name;

Con_name

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

Cdb$root

Sql>select Con_id,dbid,name,open_mode from V$pdbs;

con_id DBID NAME open_mode------------------------------------------------------------
2 4066409480 pdb$seed READ only
3 2270995695 PDBORCL Mounted

Sql>alter session Set CONTAINER=PDBORCL;

Sql>startup (the database is not opened if the user is created directly here)

Sql>create user test identified by test;
Sql>grant connect,resource,dba to test;
Sql>grant Create sequence,select any sequence to test;

Sql>select name,pdb from V$services;
NAME PDB
------------------------------ ------------------------------
PDBORCL Pdborcl
Orclxdb Cdb$root
ORCL Cdb$root
Sys$background Cdb$root
Sys$users Cdb$root

2, according to the above service name, modify the Tnsnames.ora file, and then import the data

Locate Tnsnames.ora in the Oracle_home\product\12.1.0\dbhome_1\network\admin directory and add the network service name for service_name=PDBORCL :

PDBORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521))
(Connect_data =
(SERVER = dedicated)
(service_name = PDBORCL)
)
)

Save and restart the Oracle Listener service, and then import the data with IMP (it appears that the @ service name in the IMP is case-sensitive and must match the network service name in the Tnsnames.ora)

Cmd>imp Test/[email protected] file=f:\data\data.dmp ignore=y full=y

Oracle12 Creating a non-C # #用户并且导入数据

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.