windows下Oracle11G脚本建用户、表空间、表
短信预约 -IT技能 免费直播动态提醒
@echo off
set uname=%1%
set pword=%2%
echo %uname%
echo %pword%
echo @echo off>C:\createUser.sql
echo create temporary tablespace user_temp>>C:\createUser.sql
echo tempfile 'C:\app\Administrator\oradata\user_temp.dbf'>>C:\createUser.sql
echo size 50m>>C:\createUser.sql
echo autoextend on>>C:\createUser.sql
echo next 50m maxsize 20480m>>C:\createUser.sql
echo extent management local;>>C:\createUser.sql
echo create tablespace user_data>>C:\createUser.sql
echo logging>>C:\createUser.sql
echo datafile 'C:\app\Administrator\oradata\user_data.dbf'>>C:\createUser.sql
echo size 50m>>C:\createUser.sql
echo autoextend on>>C:\createUser.sql
echo next 50m maxsize 20480m>>C:\createUser.sql
echo extent management local;>>C:\createUser.sql
echo create user %uname% identified by %pword%>>C:\createUser.sql
echo default tablespace user_data>>C:\createUser.sql
echo temporary tablespace user_temp;>>C:\createUser.sql
echo grant connect,resource,dba to %uname%;>>C:\createUser.sql
echo exit;>>C:\createUser.sql
echo @echo off>C:\createTable.sql
echo CREATE TABLE DEPT>>C:\createTable.sql
echo (DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,>>C:\createTable.sql
echo DNAME VARCHAR2(14),>>C:\createTable.sql
echo LOC VARCHAR2(13));>>C:\createTable.sql
echo INSERT INTO DEPT VALUES(1,'IT','XIAN');>>C:\createTable.sql
echo INSERT INTO DEPT VALUES(2,'core','XIAN');>>C:\createTable.sql
echo INSERT INTO DEPT VALUES(3,'wireless','XIAN');>>C:\createTable.sql
echo COMMIT;>>C:\createTable.sql
echo exit;>>C:\createTable.sql
sqlplus / as sysdba @C:\createUser.sql
sqlplus %uname%/%pword%@orcl @C:\createTable.sql
exit 0
set uname=%1%
set pword=%2%
echo %uname%
echo %pword%
echo @echo off>C:\createUser.sql
echo create temporary tablespace user_temp>>C:\createUser.sql
echo tempfile 'C:\app\Administrator\oradata\user_temp.dbf'>>C:\createUser.sql
echo size 50m>>C:\createUser.sql
echo autoextend on>>C:\createUser.sql
echo next 50m maxsize 20480m>>C:\createUser.sql
echo extent management local;>>C:\createUser.sql
echo create tablespace user_data>>C:\createUser.sql
echo logging>>C:\createUser.sql
echo datafile 'C:\app\Administrator\oradata\user_data.dbf'>>C:\createUser.sql
echo size 50m>>C:\createUser.sql
echo autoextend on>>C:\createUser.sql
echo next 50m maxsize 20480m>>C:\createUser.sql
echo extent management local;>>C:\createUser.sql
echo create user %uname% identified by %pword%>>C:\createUser.sql
echo default tablespace user_data>>C:\createUser.sql
echo temporary tablespace user_temp;>>C:\createUser.sql
echo grant connect,resource,dba to %uname%;>>C:\createUser.sql
echo exit;>>C:\createUser.sql
echo @echo off>C:\createTable.sql
echo CREATE TABLE DEPT>>C:\createTable.sql
echo (DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,>>C:\createTable.sql
echo DNAME VARCHAR2(14),>>C:\createTable.sql
echo LOC VARCHAR2(13));>>C:\createTable.sql
echo INSERT INTO DEPT VALUES(1,'IT','XIAN');>>C:\createTable.sql
echo INSERT INTO DEPT VALUES(2,'core','XIAN');>>C:\createTable.sql
echo INSERT INTO DEPT VALUES(3,'wireless','XIAN');>>C:\createTable.sql
echo COMMIT;>>C:\createTable.sql
echo exit;>>C:\createTable.sql
sqlplus / as sysdba @C:\createUser.sql
sqlplus %uname%/%pword%@orcl @C:\createTable.sql
exit 0
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341