Bootstrap

数据库安装及数据库问题解决(九)

--------回滚段是否自动回滚----------------------------------------------------------
1、首先设置回滚的retention参数Set UNDO_RETENTION in the initialization parameter file.

UNDO_RETENTION = 1800
Change UNDO_RETENTION at any time using the ALTER SYSTEM statement:

ALTER SYSTEM SET UNDO_RETENTION = 2400;
2、设置undo_management参数为自动
   undo_management                      string      AUTO
3、看undo表空间是不是guarantee,请查询dba_tablespaces表
--------重命名重做日志成员或将redo移位置--------------------------------------------------------------------------
1、将数据库shutdown: shutdown immediate
2、移文件:host mv /opt/oracle/db/oradata/orcl/redo3.log /home/oracle/db/oradata/orcl/redo3.log
3、将数据库启动到mount状态:startup mount
4、alter database rename file '/opt/oracle/db/oradata/orcl/redo3.log' to '/home/oracle/db/oradata/orcl/redo3.log';
5、将数据库open:alter database open; 
---------删除redolog-------------------------------------------------------------------------------
日志组一定要是INACTIVE:alter database drop logfile group 6;
--如果是omf方式,日志文件也被删除,如果不是,就得手工删除
检查活动的会话:select B.SQL_TEXT,a.USERNAME,a.MACHINE from v$session a,v$sql b
where A.SQL_ADDRESS=B.ADDRESS
AND A.SQL_ID=B.SQL_ID
AND a.STATUS='ACTIVE'

;