@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
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。