su - oracle -lc "/home/oracle/app/product/11.2.0/dbhome_1/bin/lsnrctl start" #与安装目录相关
su - oracle -lc "/home/oracle/app/product/11.2.0/dbhome_1/bin/dbstart" #与安装目录相关
#修改DB启动配置文件(安装目录中的dbstart文件)
vi /home/oracle/app/product/11.2.0/dbhome_1/bin/dbstart
ORACLE_HOME_LISTNER=$1 #将$1改成 $ORACLE_HOME
#设置权限
chmod u+x /etc/rc.d/rc.local
复制代码
create temporary tablespace ERMSDB_TEMP
tempfile '/home/oracle/app/oradata/orcl/ERMSDB_TEMP.dbf'
size 100m reuse autoextend on next 20m maxsize unlimited;
create tablespace ERMSDB
datafile '/home/oracle/app/oradata/orcl/ERMSDB.dbf'
size 100M reuse autoextend on next 40M maxsize unlimited
default storage(initial 128k next 128k minextents 2 maxextents unlimited);
create user ERMS_V2 identified by ERMS_V2 default tablespace ERMSDB temporary tablespace ERMSDB_TEMP;
create user ERMS_UIM identified by ERMS_UIM default tablespace ERMSDB temporary tablespace ERMSDB_TEMP;
SELECT * FROM DBA_ROLE_PRIVS WHERE GRANTEE = 'ERMS_UIM';
grant dba ,connect, resource, unlimited tablespace to ERMS_V2;
grant dba ,connect, resource, unlimited tablespace to ERMS_UIM;
create or replace directory backdump as '/home/oracle/backup';
Grant read,write on directory backdump to erms_uim;
Grant read,write on directory backdump to erms_v2;