创建表空间
操作步骤如下:
1、登录linux,以oracle用户登录(如果是root用户登录的,登录后用 su - oracle命令切换成oracle用户)
[root@localhost ~]# su - oracle
2、以sysdba方式来打开sqlplus,命令如下:
[oracle@localhost ~]$ sqlplus "/as sysdba"
3、查看我们常规将用户表空间放置位置:执行如下sql:
SQL> select name from v$datafile;
4、创建用户表空间:
Create tablespace 【表空间名称】 datafile ‘【表空间文件在磁盘上的绝对路径】’
size 【初始大小】 autoextend on next 【增长大小】 maxsize unlimited;
SQL> CREATE TABLESPACE test DATAFILE '/home/oracle/app/oracle/oradata/orcl/test.dbf' size 100M autoextend on next 10M maxsize unlimited;
5、创建用户,指定密码和上边创建的用户表空间
Create user 【用户名称】 identified by 【密码】
Default tablespace liems
Temporary tablespace temp
Quota unlimited on 【表空间名称】;
SQL> Create user test identified by test
Default tablespace test
Temporary tablespace temp
Quota unlimited on test;
6、赋予权限
Grant create view to connect;
Grant connect,resource to 【用户名称】;
Grant create database link to 【用户名称】;
Grant debug connect session to 【用户名称】;
Grant create any procedure to 【用户名称】;
Grant create job to 【用户名称】;
SQL> Grant create view to connect;
Grant connect,resource to jinlingjiangongtest;
Grant create database link to jinlingjiangongtest;
Grant debug connect session to jinlingjiangongtest;
Grant create any procedure to jinlingjiangongtest;
Grant create job to jinlingjiangongtest;
Grant succeeded.
脚本说明
执行dmp 文件
1、在【D:\db\00dmp】目录下可以看到一个 dmp 文件,该文件是用出厂测试建立的库导出的,dmp 名
称就是导出用户名称:
2、执行如下命令导入 dmp 文件:
$imp 【system 用户名称】/【system 用户密码】@【全局数据库名】 file=【dmp 文件绝对路径】
log=【生成日志文件绝对路径】 fromuser=【导出用户】 touser=【导入用户】 ignore=y;
$imp system/system@orcl file=D:\db\00dmp\liems65.dmp log=D:\db\00dmp\liems65.log
fromuser=liems65 touser=liems65 ignore=y;
3、在 SQL Plus 中以新建用户登录,执行命令“@D:\db\00dmp\function.sql;”,修复导出 dmp 文件中
有问题的函数