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 # #用户并且导入数据