本文共 2078 字,大约阅读时间需要 6 分钟。
默认用户为 sys as sysdba,可直接登陆
1、select tablespace_name,file_id, file_name,round(bytes/(1024*1024),0) total_space from dba_data_files order by tablespace_name;
select tablespace_name,file_id, file_name,round(bytes/(1024*1024),0) total_space from dba_data_files order by tablespace_name;
2、创建临时表空间
create temporary tablespace db_temp
tempfile 'C:\app\xcy\oradata\orcl\db_temp.dbf' size 32m autoextend on next 32m maxsize unlimited extent management local;
create temporary tablespace db_temp tempfile 'C:\app\xcy\oradata\orcl\db_temp.dbf' size 32m autoextend on next 32m maxsize unlimited extent management local;
3、创建表空间
create tablespace DNC
logging datafile 'C:\app\xcy\oradata\orcl\dnc.dbf' size 32m autoextend on next 32m maxsize unlimited extent management local;
create tablespace DNC logging datafile 'C:\app\xcy\oradata\orcl\dnc.dbf' size 32m autoextend on next 32m maxsize unlimited extent management local;
4、创建用户
create user xxx identified by 123
account unlock default tablespace dnc temporary tablespace db_temp;
create user xxx identified by 123 account unlock default tablespace dnc temporary tablespace db_temp;
5、授予权限
grant connect,resource,dba to xxx;
grant connect,resource,dba to xxx;
路径可以自己设置,
最终用户名:xxx
密码:123
// //查询表空间大小; select tablespace_name,file_id,bytes,file_name from dba_data_files; //修改表空间大小 alter database datafile 'C:\app\xcy\oradata\orcl\USERS01.DBF' resize 800M; //查看用户所在表空间 select default_tablespace from dba_users where username ='XCY'; /// grant create session to testcreate; grant CREATE TABLE to xxx;grant unlimited tablespace to xxx;
/
步骤一: 删除user
drop user ×× cascade
说明: 删除了user,只是删除了该user下的schema objects,是不会删除相应的tablespace的。
步骤二: 删除tablespace
DROP TABLESPACE tablespace_name INCLUDING CONTENTS AND DATAFILES;
补充:
由于Oracle 11g安装完成后,默认的帐户有效期为180天,如果超过180天用户密码未做修改则该用户无法登录,提示“ORA-28001: thepassword has expired”。一般我们都是通过IE管理界面去修改为Unlimited(无限制),如果不登录IE,在pl/sql中用如下语句:
查看有效期
SQL>select* from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME';
修改有效期为无限制
SQL>alter profile default limit PASSWORD_LIFE_TIME unlimited;
转载地址:https://blog.csdn.net/xcymorningsun/article/details/52704641 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!