Oracle相关问题记录
目录
2.ORA-8001: the password has expired
3.ORA-01502: 索引或这类索引的分区处于不可用状态
1.ORA-00257:archiver error
归档日志满了
1.1切换用户
su - oracle |
1.2登录oracle并以DBA身份连接
sqlplus / as sysdba |
1.3查看归档目录使用情况
SQL> |
SELECT * FROM V$FLASH_RECOVERY_AREA_USAGE; |
1.4进入rman并连接目标DB
退出sqlplus,执行rman命令
rman target cdr/cdr |
1.5检查无效的归档日志
同步控制文件的信息和实际物理文件的信息,将无效的expired的archivelog标出来
rman> |
crosscheck archivelog all; |
1.6删除归档日志
1.6.1单例模式
删除一天之前的归档日志
rman> |
delete archivelog until time 'sysdate-1'; |
1.6.2RAC模式
1.6.2.1普通删除
不经过提示,直接删除过期或无效的归档日志
noprompt 不经过提示
expired 期满的
rman> |
delete noprompt expired archivelog all; |
情况一:
WARNING: archived log not deleted, needed for standby or upstream capture process
证明此时数据库还正在需要应用这些归档,可以采用强制删除
情况二:
specification does not match any archived log in the repository
证明rman没有找到expired(过期)的备份
1.6.2.2强制删除
参考文章:http://blog.itpub.net/628922/viewspace-1181651/
不经过提示,并且强制删除归档日志
删除指定日期前的日志
注:没有完成的归档日志也会被删掉!慎用
rman> |
delete noprompt force archivelog until time 'sysdate-1'; |
删除所有归档日志:
注:没有完成的归档日志也会被删掉!慎用
rman> |
delete noprompt force archivelog all; |
删除所有已完成的日志:
注:推荐使用
rman> |
delete noprompt force archivelog all completed before 'sysdate'; |
1.7查看删除效果
rman> |
crosscheck archivelog all; |
2.ORA-8001: the password has expired
密码过期
2.1切换用户
su - oracle |
2.2登录oracle
sqlplus /nolog |
2.3以dba身份连接
SQL> |
conn / as sysdba |
2.4查询密码过期时间
SQL> |
select * from dba_profiles where profile='DEFAULT' and resource_name='PASSWORD_LIFE_TIME'; |
语句查看密码的有效天数为180天
2.5设置密码永久生效
SQL> |
alter profile default limit password_life_time unlimited; |
3.ORA-01502: 索引或这类索引的分区处于不可用状态
若无数据可以清空表
truncate table tablename |