ITPub博客

首页 > 数据库 > Oracle > How to copy a table from the remote database!

How to copy a table from the remote database!

原创 Oracle 作者:YoungEric 时间:2007-10-08 11:22:11 0 删除 编辑

The following is showing how to copy a table from a remote database:

[@more@]

First ,you should use an exsited user or create a new user,and grant create database link priveledge to the user:

CREATE USER JRZB
IDENTIFIED BY JRZB
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
QUOTA 50M ON USERS
ACCOUNT UNLOCK;
--
--GRANT SYSDBA TO Test_Eric;
--DESC DBA_TAB_PRIVS;
--SELECT PRIVILEGE FROM DBA_SYS_PRIVS
-- WHERE GRANTEE='JRZB';
GRANT ALTER SYSTEM TO JRZB;
GRANT ALTER DATABASE TO JRZB;
GRANT CREATE SESSION TO JRZB;
GRANT CREATE TABLE TO JRZB;
GRANT ALTER ANY TABLE TO JRZB;
GRANT CREATE DATABASE LINK TO JRZB;

Second ,CREATE the database link;

create database link JRZB_LINK
connect to JRZB identified by JRZB
using 'JRZB'; --此处为远程数据库的名字,也即是在TNS里面自己命名的;

Third ,copy the table.

SELECT * FROM WFA001@JRZB_LINK;

CREATE TABLE WFA001
AS ( SELECT * FROM WFA001@JRZB_LINK);

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/10484922/viewspace-975069/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: CREATE USER!
下一篇: How to use the
请登录后发表评论 登录
全部评论

注册时间:2007-12-18

  • 博文量
    79
  • 访问量
    223779