PLSQL 向Oracle导入sql文件

来源:互联网 发布:互联网产品品牌优化 编辑:程序博客网 时间:2024/05/08 21:43
1.打开PLSQL Developer,弹出登录窗口,用户名和密码以及Database为安装Oracle时设置的,默认Username为sys, 默认Database为ORCL,Connect as选择SYSDBA。
 

 
2.登陆成功后,选择左上方的New——>SQL Window
 

 
3.先创建一个临时的表空间,假设名为test_temp,代码如下:
 
Create temporary tablespace test_temp
Tempfile ‘E:\tablespace\test_test.dbf’
Size 100M
Autoextend on
Next 100M maxsize 200M
Extent management local;
 
然后将这些代码全部选中,点击左上的齿轮按钮以执行。
 
4.再创建一个正式的表空间,假设名为test_data,代码如下:
 
Create tablespace test_data
logging
datafile  'F:\app\Administrator\product\11.2.0\dbhome_2\test_data.dbf(这里一定注意标点,路径是oracle按安装路径)
Size 100M
Autoextend on
Next 100M maxsize 200M
Extent management local;
 
然后将这些代码全部选中,点击左上的齿轮按钮以执行。
 
5.新建能操作test表空间的用户,假设用户名为crytoll,密码为superoracle,代码如下:
 
Create user crytoll identified superoracle
Default tablespace test_data
Temporary tablespace test_temp;
 
然后将这些代码全部选中,点击左上的齿轮按钮以执行。
 
6.向crytoll赋予连接数据库等权限,代码如下:
 
Grant
Connect,resource,create session,create any table,create any view,alter any table,drop any table,
Drop any view,select any table,insert any table,update any table,delete any table
To crytoll;
 
然后将这些代码全部选中,点击左上的齿轮按钮以执行。
 
7. 点击左上方的钥匙按钮,以crytoll的身份登录。
 
8.点击File——>open——>SQL Script,将已有的sql文件导入,会以代码的形式显示在SQL窗口中,全部选中,点击左上的齿轮按钮以执行。
0 0
原创粉丝点击