复制整个数据库
Posted 大赵传奇
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了复制整个数据库相关的知识,希望对你有一定的参考价值。
--创建用户空间权限 create temporary tablespace bdcdj_xc_temp tempfile ‘x:\data\bdcdj_xc_TEMP01.DBF‘ size 500M autoextend on next 32M extent management local; create tablespace bdcdj_xc_data logging datafile ‘x:\data\bdcdj_xc_DATA01.DBF‘ size 2000M autoextend on next 500M extent management local; create user bdcdj_xc identified by "123" default tablespace bdcdj_xc_data temporary tablespace bdcdj_xc_temp; grant connect,dba,resource to bdcdj_xc; --database link create database link to_bdcxc connect to bdcdj_xc identified by "123" using ‘(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.x.xxx) (PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orcl) ))‘ --所有表名 select table_name from [email protected]_bdcxc where owner=‘BDCDJ_XC‘ --拿下面生成的语句去执行 select ‘create table ‘||table_name||‘ as select * from ‘||table_name||‘@to_bdcxc;‘ from [email protected]_bdcxc where owner=‘BDCDJ_XC‘ --结束 select table_name from [email protected]_bdcxc where TABLESPACE_NAME is not null and user=‘BDCDJ_XC‘ SELECT * FROM DBA_TABLES WHERE OWNER=‘BDCDJ_XC‘; create table bdc_zs as select * from [email protected]_bdcxc alter tablespace BDCDJ_GXSJ rename to BDCDJ_XC_DATA
以上是关于复制整个数据库的主要内容,如果未能解决你的问题,请参考以下文章