创建用户和表空间
declare
usrName varchar2(20) := 'root';
pwd varchar2(20) := 'root';
tspaceName varchar2(20) := 'GDZJ';
dfPath varchar2(300) := 'D:\app\wangshunxi\oradata\orcl\GDZJ.ora';
tmpStr varchar2(300);
begin
--tmpStr := 'drop user '||usrName||' cascade';
--execute immediate tmpStr;
--tmpStr := 'drop tablespace '||tspaceName||' including contents and datafiles';
--execute immediate tmpStr;
tmpStr := 'create tablespace '||tspaceName||' datafile '''||dfPath||''' size 6500m autoextend on next 100m maxsize unlimited';
tmpStr := 'create bigfile tablespace '||tspaceName||' datafile '''||dfPath||''' size 35G autoextend on next 100m maxsize unlimited';
execute immediate tmpStr;
tmpStr := 'create user '||usrName||' identified by '||pwd||' default tablespace '||tspaceName;
execute immediate tmpStr;
tmpStr := 'grant connect,resource,dba to '||usrName;
execute immediate tmpStr;
end;
oracle概念和术语
[url]http://www.chinaunix.net/old_jh/19/517843.html[/url]
declare
usrName varchar2(20) := 'root';
pwd varchar2(20) := 'root';
tspaceName varchar2(20) := 'GDZJ';
dfPath varchar2(300) := 'D:\app\wangshunxi\oradata\orcl\GDZJ.ora';
tmpStr varchar2(300);
begin
--tmpStr := 'drop user '||usrName||' cascade';
--execute immediate tmpStr;
--tmpStr := 'drop tablespace '||tspaceName||' including contents and datafiles';
--execute immediate tmpStr;
tmpStr := 'create tablespace '||tspaceName||' datafile '''||dfPath||''' size 6500m autoextend on next 100m maxsize unlimited';
tmpStr := 'create bigfile tablespace '||tspaceName||' datafile '''||dfPath||''' size 35G autoextend on next 100m maxsize unlimited';
execute immediate tmpStr;
tmpStr := 'create user '||usrName||' identified by '||pwd||' default tablespace '||tspaceName;
execute immediate tmpStr;
tmpStr := 'grant connect,resource,dba to '||usrName;
execute immediate tmpStr;
end;
oracle概念和术语
[url]http://www.chinaunix.net/old_jh/19/517843.html[/url]