Posts

Showing posts from March, 2015

Create restore point on the database

mkdir -p /u01/test/FLASH_AREA -- turn on flashback- database in archive log mode alter system set db_recovery_file_dest=' /u01/test/FLASH_AREA' scope =spfile; alter system set db_recovery_file_dest_size=50G scope =spfile; shutdown  startup show parameter db_flashback_retention_target alter database flashback on ; SELECT flashback_on, log_mode FROM v$database; SELECT estimated_flashback_size FROM v$flashback_database_log; select (dd.SPACE_LIMIT-dd.SPACE_USED +dd.SPACE_RECLAIMABLE)/1024/1024/1024 size_avail from v$recovery_file_dest dd; SELECT * FROM v$flashback_database_stat; start release ------------------------------------------- SELECT flashback_on, log_mode FROM v$database; alter database flashback on; create restore point Restore_upgrade guarantee  flashback database; after finish Select name, preserved from v$restore_point; drop restore point Restore_upgard alter database flashback off; SELECT flashback_on, log_mode FROM v$database;

Blockers on the database and user sessions

session details set linesize 200 col MACHINE format a30 col OSUSER format a10 col SCHEMANAME format a10 col MODULE format a20 Select to_char(logon_time,'dd/mm/yyyy hh24:mi:ss'),osuser,status,schemaname,machine,SID,module, INST_ID from gv$session where type !='BACKGROUND' and USERNAME='&a' order by logon_time asc; Select to_char(logon_time,'dd/mm/yyyy hh24:mi:ss'),osuser,status,schemaname,machine,SID,module, INST_ID from gv$session where type !='BACKGROUND'  order by logon_time asc; Select to_char(logon_time,'dd/mm/yyyy hh24:mi:ss'),osuser,status,schemaname,machine,SID,module,INST_ID from gv$session where type !='BACKGROUND' and module like '%Developer' order by logon_time asc; Blockers on the database ---------------------------- column sess format A20 SELECT substr(DECODE(request,0,'Holder: ','Waiter: ')||sid,1,12) sess, id1, id2, lmode, request, type, inst_id  FROM GV$LOCK WHERE (i...