Oracle 导入另外user 的table
本实验是关于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>

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

熱門話題

InnoDB的全文搜索功能非常强大,能够显著提高数据库查询效率和处理大量文本数据的能力。1)InnoDB通过倒排索引实现全文搜索,支持基本和高级搜索查询。2)使用MATCH和AGAINST关键字进行搜索,支持布尔模式和短语搜索。3)优化方法包括使用分词技术、定期重建索引和调整缓存大小,以提升性能和准确性。

本文討論了使用MySQL的Alter Table語句修改表,包括添加/刪除列,重命名表/列以及更改列數據類型。

全表掃描在MySQL中可能比使用索引更快,具體情況包括:1)數據量較小時;2)查詢返回大量數據時;3)索引列不具備高選擇性時;4)複雜查詢時。通過分析查詢計劃、優化索引、避免過度索引和定期維護表,可以在實際應用中做出最優選擇。

是的,可以在 Windows 7 上安裝 MySQL,雖然微軟已停止支持 Windows 7,但 MySQL 仍兼容它。不過,安裝過程中需要注意以下幾點:下載適用於 Windows 的 MySQL 安裝程序。選擇合適的 MySQL 版本(社區版或企業版)。安裝過程中選擇適當的安裝目錄和字符集。設置 root 用戶密碼,並妥善保管。連接數據庫進行測試。注意 Windows 7 上的兼容性問題和安全性問題,建議升級到受支持的操作系統。

文章討論了為MySQL配置SSL/TLS加密,包括證書生成和驗證。主要問題是使用自簽名證書的安全含義。[角色計數:159]

聚集索引和非聚集索引的區別在於:1.聚集索引將數據行存儲在索引結構中,適合按主鍵查詢和範圍查詢。 2.非聚集索引存儲索引鍵值和數據行的指針,適用於非主鍵列查詢。

文章討論了流行的MySQL GUI工具,例如MySQL Workbench和PhpMyAdmin,比較了它們對初學者和高級用戶的功能和適合性。[159個字符]
