對象權限
select owner,
table_name,
grantor,
privilege,
grantable,
hierarchy,
'TABLE' /*o.*/ object_type
from dba_tab_privs p
where p.grantee = 'HR'
order by p.owner, p.table_name;
角色
select granted_role, admin_option, default_role
from dba_role_privs
where grantee = 'HR'
order by granted_role;
系統權限
select privilege, admin_option
from dba_sys_privs
where grantee = 'HR'
order by privilege;
表空間限額
select * from dba_ts_quotas where username = 'SYSMAN' order by tablespace_name;
用戶或系統角色對應的權限
select * from role_sys_privs where role = 'RESOURCE'
數據庫所有的系統權限名稱
select DISTINCT NAME from system_privilege_map t WHERE T.NAME LIKE '%SELECT%'
df -h 磁盤空間使用率
show parameter log_archive_format
查看用戶的概要文件
select username, profile from dba_users where username='SCOTT';
查看相應概要文件的各項設置
select resource_name, limit from dba_profiles where profile = 'DEFAULT';
修改相應的概要文件選項
ALTER PROFILE "DEFAULT" LIMIT CONNECT_TIME 30; 最大連接時間30分鐘
ALTER PROFILE "DEFAULT" LIMIT FAILED_LOGIN_ATTEMPTS 3; 最大登錄嘗試次數 3次
rman 啟動自動備份控制文件功能
show all;
CONFIGURE CONTROLFILE AUTOBACKUP clear; #清除設置 恢復為默認值
configure controlfile autobackup on; #設置為自動備份控制文件
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 30 DAYS; #修改保留策略為保留30天
backup archivelog all; 備份歸檔日志
backup tablespace users; 備份users表空間
backup datafile 3; 備份數據文件
backup incremental level 0 database; 零級備份
backup incremental level 1 database; 一級差異增量
backup incremental level 1 cumulative database format '/oradata/bak/dblevel1.bak'; 一級累計增量
backup as compressed backupset datafile 4; 以壓縮方式備份數據文件 4
歸檔空間滿時的處理辦法
rm *.arc 先用操作系統命令手工刪除部分歸檔文件
rman target /
change archivelog all validate;
delete noprompt expired archivelog all;
RUN { EXECUTE SCRIPT b_whole_10; } 執行rman的腳本