辅导员绩效考核方案:oracle操作

来源:百度文库 编辑:九乡新闻网 时间:2024/04/29 18:13:20
1 查看undo表空间的undo段
   select segment_name,tablespace_name from dba_rollback_segs;

2  查看在线undo segment信息
       select * from v$rollname;

3 查看数据库上所有角色
       select * from dba_roles;

4 查看某个用户的角色
       select granted_role,admin_option from dba_role_privs where grantee='SCOTT';

5 查看某角色所拥有的权限
      select role,privielege,admin_option from role_sys_privs where role='角色名';

6 同义词
      其实就是数据库等的一个别名,如果很长的话可以用这个别名来代替,比如
        create public synonym book for xxx.xxxxx;

7 oracle建议表空间大小
         系统表:400M
        用户表:120M
        临时表:100M
        索引表:70

  工具表:12M
        回滚表:250M

8 查看当前数据库各个表空间使用情况:
       select df.tablespace_name "表空间名",totalspace "总空间M",freespace "剩余空间M",round((1-freespace/totalspace)*100,2) "使用率%"
from
(select tablespace_name,round(sum(bytes)/1024/1024) totalspace
from dba_data_files
group by tablespace_name) df,
(select tablespace_name,round(sum(bytes)/1024/1024) freespace
from dba_free_space
group by tablespace_name) fs
where df.tablespace_name=fs.tablespace_name;

 

  9   碎片空间
      合拼表空间的空闲空间: alter tablespace users coalesce;

        整理自由空间碎片

         SMON进程会不断扫描,合拼相邻的自由空间,但要设置pctincrease非0,一般设置为1
     alter tablespace temp default storage(pctincrease 1);