oracle 常用sql

来源:互联网 发布:淘宝大数据分析报告 编辑:程序博客网 时间:2024/05/14 06:18
1.修改密码过期问题:
create profile klform_profile limit password_life_time unlimited;
alter user klform profile klform_profile; 

select username,account_status,expiry_date,profile from dba_users where username='KLFORM';

select * from dba_profiles where profile='KLFORM_PROFILE';

2.查看linux版本号
lsb_release -a 
cat /etc/redhat-release 
rpm -q redhat-release

3.查看expdp,impdp中的directory目录情况:
SQL> select * from dba_directories;

4.查看oracle 数据库的运行时间
select to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') started_at,
TRUNC(sysdate - (startup_time))||'day(s),'||TRUNC(24*((sysdate-startup_time) -TRUNC(sysdate-startup_time)))
||'hour(s),'||MOD(TRUNC(1440*((SYSDATE-startup_time)-
TRUNC(sysdate-startup_time))),60)
||'minutes(s),'||MOD(TRUNC(86400*((SYSDATE-STARTUP_TIME)-
TRUNC(SYSDATE-startup_time))),60)
||'seconds' uptime
    from v$instance;

 select to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') FROM v$instance;

5.查询告警日志xml文件的目录

select value from v$diag_info where name='Diag Alert';

查询文本文件的目录
select value from v$diag_info where name='Diag Trace';

6.授予查询权限给某用户

grant select any table to klquery


0 0
原创粉丝点击