标签:xxx def style 数据 ide 创建用户 display extend --
--创建用户空间权限 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 dba_tables@to_bdcxc where owner=‘BDCDJ_XC‘ --拿下面生成的语句去执行 select ‘create table ‘||table_name||‘ as select * from ‘||table_name||‘@to_bdcxc;‘ from dba_tables@to_bdcxc where owner=‘BDCDJ_XC‘ --结束 select table_name from user_tables@to_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 bdc_zs@to_bdcxc alter tablespace BDCDJ_GXSJ rename to BDCDJ_XC_DATA
标签:xxx def style 数据 ide 创建用户 display extend --
原文地址:https://www.cnblogs.com/yansc/p/10255639.html