将下面的脚本,另存成一个bat
@echo off
echo *********************************
echo 生成SQL脚本:创建表空间,用户名和密码
echo *********************************
set /p tsname=请输入表空间名:
set /p tsdir=请输入表空间文件所在的文件夹路径:
set /p username=请输入用户名:
set /p userpassword=请输入用户密码:
set /p sqlfile=请输入SQL脚本存放的位置:
echo --表空间>>%sqlfile%
echo CREATE TABLESPACE %tsname% >>%sqlfile%
echo DATAFILE '%tsdir%\%tsname%' size 800M >>%sqlfile%
echo EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; >>%sqlfile%
echo --索引表空间 >>%sqlfile%
echo CREATE TABLESPACE sdt_Index >>%sqlfile%
echo DATAFILE '%tsdir%\%tsname%' size 512M >>%sqlfile%
echo EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; >>%sqlfile%
echo --2.建用户 >>%sqlfile%
echo create user %username% identified by %userpassword% >>%sqlfile%
echo default tablespace %tsname%; >>%sqlfile%
echo --3.赋权 >>%sqlfile%
echo grant connect,resource to %tsname%; >>%sqlfile%
echo grant create any sequence to %tsname%; >>%sqlfile%
echo grant create any table to %tsname%; >>%sqlfile%
echo grant delete any table to %tsname%; >>%sqlfile%
echo grant insert any table to %tsname%; >>%sqlfile%
echo grant select any table to %tsname%; >>%sqlfile%
echo grant unlimited tablespace to %tsname%; >>%sqlfile%
echo grant execute any procedure to %tsname%; >>%sqlfile%
echo grant update any table to %tsname%; >>%sqlfile%
echo grant create any view to %tsname%; >>%sqlfile%
echo 脚本创建成功,请查看%sqlfile%
pause