标签:提示 oca ddr net 数据库 splay dba data oracle
由于要导入dmp文件,所以想建立和oracle11一样的用户,折腾了半天,记录一下过程:
1、进入sqlplus,建立用户和分配权限
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 (这里如果直接建立用户的话,会提示数据库未打开)
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、根据上面的服务名,修改tnsnames.ora文件,然后导入数据
在oracle_home\product\12.1.0\dbhome_1\NETWORK\ADMIN目录下找到tnsnames.ora,添加SERVICE_NAME=pdborcl的网络服务名:
PDBORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PDBORCL)
)
)
保存并重启oracle监听服务,然后用imp导入数据(貌似imp里的@服务名是区分大小写的,必须和tnsnames.ora里的网络服务名大小写一致)
cmd>imp test/test@PDBORCL file=F:\data\data.dmp ignore=y full=y
标签:提示 oca ddr net 数据库 splay dba data oracle
原文地址:http://www.cnblogs.com/goding/p/7682859.html