达梦dexpdp,dimpdp导出导入数据
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | 1.创建directory SQL> create directory direct as '/dm8/direct' ; executed successfully used time: 48.272(ms). Execute id is 503. 2.创建测试用户 SQL> create user tt identified by passwordfortt default tablespace tt; executed successfully used time: 27.299(ms). Execute id is 509. SQL> grant create session to tt; executed successfully used time: 2.199(ms). Execute id is 510. SQL> SQL> grant resource to tt; executed successfully used time: 2.183(ms). Execute id is 511. SQL> grant read,write on directory direct to tt; executed successfully used time: 2.403(ms). Execute id is 512. 3.创建测试表 [dmdba@node01 ~]$ disql tt/passwordfortt Server[LOCALHOST:5236]:mode is normal, state is open login used time : 1.460(ms) disql V8 SQL> SQL> create table test (id number(10),name varchar2(10)); executed successfully used time: 178.871(ms). Execute id is 600. SQL> SQL> SQL> insert into test values (1, 'jack' ); affect rows 1 used time: 0.773(ms). Execute id is 601. SQL> SQL> insert into test values (2, 'lucy' ); affect rows 1 used time: 0.322(ms). Execute id is 602. SQL> insert into test values (3, 'scott' ); affect rows 1 used time: 0.575(ms). Execute id is 603. SQL> SQL> commit; executed successfully used time: 0.809(ms). Execute id is 604. SQL> SQL> select * from test; LINEID ID NAME ---------- -- ----- 1 1 jack 2 2 lucy 3 3 scott used time: 0.817(ms). Execute id is 605. 4.导出test表数据 [dmdba@node01 ~]$ dexpdp tt/passwordfortt directory=DIRECT file=test.dmp log=test.log tables=tt.test dexpdp V8 ---- [2022-08-17 09:16:16]export table:TEST ----- the privilege of the object at the export mode... table :TEST export terminate, total export 3 rows all the export process spent total 0.078 s terminate export success without warning 5.把test表改名为test1 SQL> alter table test rename to test1; executed successfully used time: 48.299(ms). Execute id is 606. 6.导入数据 [dmdba@node01 ~]$ dimpdp tt/passwordfortt directory=DIRECT file=test.dmp log=impdp_test.log dimpdp V8 local code: PG_UTF8, dump file code: PG_UTF8 ----- [2022-08-17 09:18:47]import table:TEST ----- create table TEST import table TEST , has coped with 3 rows all the import process spent total 0.022 s terminate import success without warning 7.验证 [dmdba@node01 ~]$ disql disql V8 username:tt password: Server[LOCALHOST:5236]:mode is normal, state is open login used time : 1.466(ms) SQL> SQL> SQL> select table_name from user_tables; LINEID TABLE_NAME ---------- ---------- 1 TEST1 2 TEST used time: 13.752(ms). Execute id is 7200. SQL> select * from test; LINEID ID NAME ---------- -- ----- 1 1 jack 2 2 lucy 3 3 scott used time: 0.817(ms). Execute id is 7201. |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
2020-08-17 linux下postgresql安装
2020-08-17 postgresql 运行sql文件