最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

Oracle导入另外user的table

来源:懂视网 责编:小采 时间:2020-11-09 11:46:20
文档

Oracle导入另外user的table

Oracle导入另外user的table:本实验是关于data 的exp 一个用户scott 下面imp到另外一个用户 中。 ---------在instance = sheng 的导出scott.emp [Oracle@aora 本实验是关于data 的exp 一个用户scott 下面imp到另外一个用户 中。 ---------在instance = s
推荐度:
导读Oracle导入另外user的table:本实验是关于data 的exp 一个用户scott 下面imp到另外一个用户 中。 ---------在instance = sheng 的导出scott.emp [Oracle@aora 本实验是关于data 的exp 一个用户scott 下面imp到另外一个用户 中。 ---------在instance = s

本实验是关于data 的exp 一个用户scott 下面imp到另外一个用户 中。 ---------在instance = sheng 的导出scott.emp [Oracle@aora

本实验是关于data 的exp 一个用户scott 下面imp到另外一个用户 中。

---------
在instance = sheng 的导出scott.emp

[Oracle@aoracle ~]$ exp scott/oracle tables=emp file='/u01/rman/file01.txt';

Export: Release 10.2.0.1.0 - Production on Fri Dec 16 09:56:22 2011

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


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
server uses ZHS16GBK character set (possible charset conversion)

About to export specified tables via Conventional Path ...
. . exporting table EMP 14 rows exported
EXP-00091: Exporting questionable statistics.
EXP-00091: Exporting questionable statistics.
Export terminated successfully with warnings.

下面imp到另外一个用户的table 中。

下面建立另外一个user:
SQL> select name from v$tablespace;

NAME
------------------------------
SYSTEM
UNDOTBS2
SYSAUX
USERS
TEMP

SQL> create tablespace TB_DBS datafile '/u02/sheng/tbsdbs01.dbf' size 20m;

Tablespace created.

SQL> select name from v$tablespace;

NAME
------------------------------
SYSTEM
UNDOTBS2
SYSAUX
USERS
TEMP
TB_DBS

6 rows selected.

SQL> create user dbs identified by dbs default tablespace tb_dbs;

User created.

SQL> select username,account_status from dba_users where username like 'DBS%';

USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
DBSNMP OPEN
DBS OPEN

下面连一下:
SQL> CONN DBS/DBS
ERROR:
ORA-01045: user DBS lacks CREATE SESSION privilege; logon denied


Warning: You are no longer connected to ORACLE.

SQL> grant create session ,resource to dbs;

Grant succeeded.

SQL> conn dbs/dbs
Connected.
SQL> select * from tab;

no rows selected

SQL>

好,,下面把scott 用户下的emp table imp 到dbs 用户下:

[oracle@aoracle ~]$ imp system/manager file='/u01/rman/file01.txt' fromuser=scott touser=dbs;

Import: Release 10.2.0.1.0 - Production on Fri Dec 16 10:54:29 2011

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


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

Export file created by EXPORT:V10.02.01 via conventional path

Warning: the objects were exported by SCOTT, not by you

import done in US7ASCII character set and AL16UTF16 NCHAR character set
import server uses ZHS16GBK character set (possible charset conversion)
. importing SCOTT's objects into DBS
. . importing table "EMP" 14 rows imported
IMP-00017: following statement failed with ORACLE error 942:
"ALTER TABLE "EMP" ADD CONSTRAINT "FK_DEPTNO" FOREIGN KEY ("DEPTNO") REFEREN"
"CES "DEPT" ("DEPTNO") ENABLE NOVALIDATE"
IMP-00003: ORACLE error 942 encountered
ORA-00942: table or view does not exist
About to enable constraints...
IMP-00017: following statement failed with ORACLE error 2430:
"ALTER TABLE "EMP" ENABLE CONSTRAINT "FK_DEPTNO""
Import terminated successfully with warnings.

SQL> select count(*) from emp;

COUNT(*)
----------
14

SQL> show user;
USER is "DBS"
SQL>

linux

文档

Oracle导入另外user的table

Oracle导入另外user的table:本实验是关于data 的exp 一个用户scott 下面imp到另外一个用户 中。 ---------在instance = sheng 的导出scott.emp [Oracle@aora 本实验是关于data 的exp 一个用户scott 下面imp到另外一个用户 中。 ---------在instance = s
推荐度:
标签: 导入 另一个 另外
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top