Oracle 数据库复制问题 环境:WINDOWS 2003 ORACLE 9.2.0.1问题:用户User1拥有表空间tb1, in_tb1,其中tb1中为数据,in_tb1中为索引如何将它复制到另一个用户user2下其中表空间改为tb2,in_rb2,其中tb2中为数据,in_tb2中为索引 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 参考 1 将用户User1的数据卸出 $ exp user1/passwd1 Export:...... Export file:expdat.dmp> E(ntire database),(2)U(sers),or (3)T(ables):(2)U> Export grants(yes/no):yes> Export table data(yes/no):yes> Compress extents(yes/no):yes> Abort to export specified users.... Abort to export O7USER1's tables... Export terminated successfully without warnings 最后将user1用户的数据生成于默认的expdat.dmp 文件中。 2.将user1的数据全部复制到user2 中 $ imp user2/passwd2 Import:Release ...... Import file: > expdat.dmp Enter insert buffer size (minimum is 4096) 30720>307200 Export file created by EXPORT: List contents of import file only(yes/no):no> Ignore create error due to object existence(yes/no):no> Import grants(yes/no):yes> Import table data(yes/no):yes> Import entire export file(yes/no):no>y 开始复制user1之数据到user2中,出现如下提示: .importing O7USER1's objects into O7USER2 .. importing table "table1" 10 rows imported … Import terminated successfully without warnings. 最简单最快的办法是用sql语句实现。在用户user2下,create table tb2 as select * from user1.tb1;然后生成对应的索引就可以了。 用sql语句实现。触发器和索引不会转换过来,自己手处理就可以动。序列吗?是与表无关的东西。要跟原数据库的currentval一直的话,需要手工设置的(利用导入导出是不可以的)。 create table tb2 as select * from user1.tb1;需要查询创建索引。 tb1不是表空间?可以create table tb2 as select * from user1.tb1 tb1和tb2都是表空间,不是表 tb1和tb2 是表空间可以create table tb2 as select * from user1.tb1吗?我记得只有表才有这种用法吧? 装pl/sql developer了吗。用export table导出,import table导入,非常方便 imp/exprmanimpdp/expdp(10g) 求助!如何将dbf 导入oracle!! 请教大家一个ORACLE数据存数值的问题 Oracle安装出错,内有图片 我能删除库中的哪些用户? em 查表?急!! 多个字段建一个索引和分别建索引有什么区别 怎么知道orcale 连结池有多少个 请问在触发器中如何判断一次插入了多条数据 会日语又会oracle的请进 关于imp 如何建立一个小数据库? oracle not in 根子查询,如果自查询过大,会得到不正确的结果。。。。。。 oracle中UPDATE语句的问题
1 将用户User1的数据卸出
$ exp user1/passwd1
Export:...... Export file:expdat.dmp>
E(ntire database),(2)U(sers),or (3)T(ables):(2)U>
Export grants(yes/no):yes>
Export table data(yes/no):yes>
Compress extents(yes/no):yes>
Abort to export specified users....
Abort to export O7USER1's tables...
Export terminated successfully without warnings 最后将user1用户的数据生成于默认的expdat.dmp 文件中。
2.将user1的数据全部复制到user2 中
$ imp user2/passwd2
Import:Release ...... Import file: > expdat.dmp
Enter insert buffer size (minimum is 4096) 30720>307200
Export file created by EXPORT: List contents of import file only(yes/no):no>
Ignore create error due to object existence(yes/no):no>
Import grants(yes/no):yes>
Import table data(yes/no):yes>
Import entire export file(yes/no):no>y
开始复制user1之数据到user2中,出现如下提示:
.importing O7USER1's objects into O7USER2
.. importing table "table1" 10 rows imported …
Import terminated successfully without warnings.
在用户user2下,create table tb2 as select * from user1.tb1;
然后生成对应的索引就可以了。
触发器和索引不会转换过来,自己手处理就可以动。
序列吗?是与表无关的东西。要跟原数据库的currentval一直的话,需要手工设置的(利用导入导出是不可以的)。
需要查询创建索引。
可以create table tb2 as select * from user1.tb1
tb1和tb2都是表空间,不是表
可以create table tb2 as select * from user1.tb1吗?
我记得只有表才有这种用法吧?
rman
impdp/expdp(10g)