copy命令的使用
COPY FROM test/123456 TO test/123456
CREATE test005 USING SELECT * FROM test004;
请问大家我在执行上面语句的时候,报错:ORA-00901: invalid CREATE command
请问为什么?
COPY, 命令, FROM, USING, SELECT
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
SQL> conn sys/liang as sysdba
Connected.
SQL> create user b identified by b;
User created.
SQL> grant create session to b;
Grant succeeded.
SQL> conn b/b
Connected.
SQL> create table t
2 as select * from all_tables;
as select * from all_tables
*
ERROR at line 2:
ORA-01031: insufficient privileges
SQL> conn sys/liang as sysdba
Connected.
SQL> grant create table to b;
Grant succeeded.
SQL> conn b/b
Connected.
SQL> create table t
2 as select * from all_tables;
as select * from all_tables
*
ERROR at line 2:
ORA-01950: no privileges on tablespace 'USERS'
SQL> conn sys/liang as sysdba
Connected.
SQL> alter user b quota unlimited on users;
User altered.
SQL> conn b/b
Connected.
SQL> create table t
2 as select * from all_tables;
Table created.
SQL>
SQL> select * from session_privs;
PRIVILEGE
----------------------------------------
CREATE SESSION
CREATE TABLE
SQL> copy from b/b@orcl to b/b@orcl create t9 using select * from t;
Array fetch/bind size is 15. (arraysize is 15)
Will commit when done. (copycommit is 0)
Maximum long size is 80. (long is 80)
Table T9 created.
22 rows selected from b@orcl.
22 rows inserted into T9.
22 rows committed into T9 at b@orcl.
SQL> select * from session_privs;
PRIVILEGE
----------------------------------------
CREATE SESSION
CREATE TABLE
CREATE CLUSTER
CREATE SEQUENCE
CREATE PROCEDURE
CREATE TRIGGER
CREATE TYPE
CREATE OPERATOR
CREATE INDEXTYPE
SQL> copy from lcm/lcm@orcl to lcm/lcm@orcl create t9 using select * from t1;
Array fetch/bind size is 15. (arraysize is 15)
Will commit when done. (copycommit is 0)
Maximum long size is 80. (long is 80)
Table T9 created.
42394 rows selected from lcm@orcl.
42394 rows inserted into T9.
42394 rows committed into T9 at lcm@orcl.
请问执行这个命令跟用户的权限有没有关系?我的用户只有以下权限:
create procedure
create sequence
create session
create snapshot
create synonym
create table
create trigger
create type
create view
相同模式下copy:
SQL> copy from lcm/lcm@orcl to lcm/lcm@orcl create t9 using select * from t1;
Array fetch/bind size is 15. (arraysize is 15)
Will commit when done. (copycommit is 0)
Maximum long size is 80. (long is 80)
Table T9 created.
42394 rows selected from lcm@orcl.
42394 rows inserted into T9.
42394 rows committed into T9 at lcm@orcl.
SQL> copy from lcm/lcm@orcl to aa/aa@orcl create t9 using select * from t1;
Array fetch/bind size is 15. (arraysize is 15)
Will commit when done. (copycommit is 0)
Maximum long size is 80. (long is 80)
Table T9 created.
42394 rows selected from lcm@orcl.
42394 rows inserted into T9.
42394 rows committed into T9 at aa@orcl.
应该可以的吧
我换了用户也不行啊?
test/123456 TO test/123456 ,同一个用户怎么复制???