ORA-28002,ORA-01502

今天遇到的错误,都整理一下

ORA-28002

ORA-28002: the password will expire within 6 days

处理过程:
1、查看用户的proifle是那个,一般是default:
sql>SELECT username,PROFILE FROM dba_users;
2、查看指定概要文件(如default)的密码有效期设置:
sql>SELECT * FROM dba_profiles s WHERE s.profile='DEFAULT' AND resource_name='PASSWORD_LIFE_TIME';
3、将密码有效期由默认的180天修改成“无限制”:
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
4、修改后,还没有被提示ORA-28002警告的用户不会再碰到同样的提示;
已经被提示的用户必须再改一次密码,举例如下:
$sqlplus / as sysdba
sql> alter user wapgw identified by<原来的密码>

SELECT username,profile FROM dba_users where username like 'ZFTANG';

SELECT * FROM dba_profiles s WHERE s.profile='ONE1_SESSION'
ALTER PROFILE ONE1_SESSION LIMIT PASSWORD_LIFE_TIME 5 DYS;

create profile ONE1_SESSION limit
sessions_per_user 11
password_life_time 20;
-- Add users to profile
alter user zftang profile ONE1_SESSION;


alter profile ONE1_SESSION limit password_life_time 1;

ORA-01502

ORA-01502: 索引'P_ABCD.PK_WEB_BASE'或这类索引的分区处于不可用状态
原因:出现这个问题,可能有人move过表,或者disable 过索引。
1、alter table xxxxxx move tablespace xxxxxxx 命令后,索引就会失效。
2、alter index index_name unusable,命令使索引失效。

解决办法:
1、重建索引才是解决这类问题的完全的方法。
alter index index_name rebuild (online);
2、如果是分区索引只需要重建那个失效的分区 。
alter index index_name rebuild partition partition_name (online);

说明:
1. alter session set skip_unusable_indexes=true;就可以在session级别跳过无效索引作查询。
2.分区索引应适用user_ind_partitions。
3.状态分4种:
N/A说明这个是分区索引需要查user_ind_partitions或者user_ind_subpartitions来确定每个分区是否可用;
VAILD说明这个索引可用;
UNUSABLE说明这个索引不可用;
USABLE 说明这个索引的分区是可用的。

你可能感兴趣的:(ora)