如何将数据导入到指定的表空间 [英] How to import data to a specified tablespace

查看:169
本文介绍了如何将数据导入到指定的表空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的oracle版本是11g.我已将oracle数据库导入到名为" export.sql "的SQL文件中.两天前,我用Windows重新安装了计算机,还重新安装了Oracle.现在,我创建了一个名为"book"的用户,其密码为"book",并使用此命令赋予了特权:

My version of oracle is 11g. I had imported my oracle database to a SQL file called "export.sql". Two days back I reinstalled my machine with windows and reinstalled Oracle also. Now I have created a user named "book" with password "book" and have given privileges using this command:

grant create session, create table to book;

然后,我尝试通过使用SQL Developer实用程序导入SQL文件,方法是在SQL编辑器中打开 export.sql 文件.然后它告诉我

Then I tried to import my SQL file using SQL Developer utility, by opening the export.sql file in the SQL editor. Then it showed me that

SQL Error: ORA-01950: no privileges on tablespace 'USERS'

然后,我认为最好创建一个不同的表空间,而不是使用USERS表空间.然后我使用以下方法创建表空间"kwa":

Then I thought it would be better to create a different tablespace rather than using the USERS table space. Then I created the tablespace "kwa" using this:

create tablespace kwa
logging
datafile 'G:\kwa\kwa.dbf' 
size 32m 
autoextend on 
next 32m maxsize 2048m
extent management local;

在此之后,我使用以下命令为该表空间上的用户赋予了特权:

After this I have given privileges to user on that tablespace using this command:

alter user book quota 32m on kwa;

我现在要做的是使用户"book"在SQL Developer中使用该表空间,以便导入我的" export.sql "? ,但是当我尝试导入数据时,它仍然显示旧的" ORA-01950 "错误.如何在 SQLDeveloper界面中更改用户"book" 的表空间?

What I want to do now is to make the user "book" use that tablespace in SQL Developer so that I can import my "export.sql" ? , but still when I try to import data it is showing the old "ORA-01950" error. How to change the tablespace for the user "book" in the SQLDeveloper interface ?

推荐答案

尝试

alter user book default tablespace kwa;

是否可行取决于 export.sql 是否显式引用 USERS 表空间-如果确实引用了该表空间,则需要更改 export .sql

Whether this works depends on whether the export.sql references the USERS tablespace explicitly or not - if it does reference it then you will need to change export.sql !

这篇关于如何将数据导入到指定的表空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆