ORACLE
· 多行查询结果拼接 : wmsys.wm_concat()函数;
·导入dmp文件(dbhome为连接数据库名称):
imp username/password@dbhome full=y file="dmp_file_path" ignore=y
·查询表空间使用大小
SELECT a.tablespace_name "表空间名",
total / (1024 * 1024 * 1024) "表空间大小(G)",
free / (1024 * 1024 * 1024) "表空间剩余大小(G)",
(total - free) / (1024 * 1024 * 1024) "表空间使用大小(G)",
round((total - free) / total, 4) * 100 "使用率 %"
FROM (SELECT tablespace_name, SUM(bytes) free
FROM dba_free_space
GROUP BY tablespace_name) a,
(SELECT tablespace_name, SUM(bytes) total
FROM dba_data_files
GROUP BY tablespace_name) b
WHERE a.tablespace_name = b.tablespace_name
·查询有dba权限的用户
select * from dba_role_privs where granted_role='DBA'
·删除用户dba权限(注意 执行账户需要有dba权限)
revoke dba from user_Name
· 对表空间无权限(也有可能是因为空间配额引起的)
grant unlimited tablespace to XXX;