求一个Linux环境的oracle数据库利用imp语句导数的shell脚本
1个回答
展开全部
这是一个先删除用户,再重建用户,然后赋权的脚本,可以放到crontab中定时执行
source /opt/.bash_profile
DATE=$(date +%Y%m%d)
sqlplus /nolog <connect / as sysdba;
DROP USER WAPUSER CASCADE;
DROP USER JLTGAME CASCADE;
CREATE USER "WAPUSER" PROFILE "DEFAULT"
IDENTIFIED BY "123456" DEFAULT TABLESPACE "JLTGAME"
TEMPORARY TABLESPACE "TEMP"
ACCOUNT UNLOCK;
CREATE USER "JLTGAME" PROFILE "DEFAULT"
IDENTIFIED BY "JLTGAME123" DEFAULT TABLESPACE "JLTGAME"
TEMPORARY TABLESPACE "TEMP"
ACCOUNT UNLOCK;
GRANT CREATE VIEW TO JLTGAME;
GRANT CREATE TABLE TO JLTGAME;
GRANT ALTER ANY TYPE TO JLTGAME;
GRANT CREATE SESSION TO JLTGAME;
GRANT CREATE SYNONYM TO JLTGAME;
GRANT CREATE TRIGGER TO JLTGAME;
GRANT ALTER ANY INDEX TO JLTGAME;
GRANT ALTER ANY TABLE TO JLTGAME;
GRANT CREATE ANY TYPE TO JLTGAME;
GRANT CREATE ANY VIEW TO JLTGAME;
GRANT CREATE SEQUENCE TO JLTGAME;
GRANT CREATE SNAPSHOT TO JLTGAME;
GRANT ALTER TABLESPACE TO JLTGAME;
GRANT CREATE ANY INDEX TO JLTGAME;
GRANT CREATE ANY TABLE TO JLTGAME;
GRANT CREATE PROCEDURE TO JLTGAME;
GRANT ALTER ANY TRIGGERTO JLTGAME;
GRANT CREATE ANY TRIGGER TO JLTGAME;
GRANT ALTER ANY INDEXTYPE TO JLTGAME;
GRANT CREATE ANY INDEXTYPE TO JLTGAME;
GRANT UNLIMITED TABLESPACE TO JLTGAME;
exit
EOF
imp userid=jltgame/JLTGAME123 file=/backup/52backup/jltgame$DATE.dmp full=y log=/opt/logjltgame$DATE.dmp
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询