代码改变世界

随笔分类 -  Work in Singapore

Oracle 表的统计信息收集情况查询

2023-10-17 11:31 by 明朝散发, 985 阅读, 收藏,
摘要: 1 check stats status 1. select owner,last_ddl_time from dba_objects where object_name = '&table'; 2. select owner,table_name, to_char(last_analyzed,'D 阅读全文

从AWR快照中固定执行计划

2023-05-19 16:34 by 明朝散发, 600 阅读, 收藏,
摘要: Troubleshooting/resolution cw97pxhjgtcqq –sql_id provide by user if not pls confirm sql_id using following query: --1. Active sessions info order by L 阅读全文

增加redo大小

2023-05-19 16:28 by 明朝散发, 40 阅读, 收藏,
摘要: ``` --#increase log file size SELECT a.GROUP#, a.THREAD#, a.SEQUENCE#, a.ARCHIVED, a.STATUS, b.MEMBER AS REDOLOG_FILE_NAME, (a.BYTES/1024/1024) AS SIZ 阅读全文

清理SYSAUX(其三)

2023-05-19 16:21 by 明朝散发, 70 阅读, 收藏,
摘要: ``` SQL> col occupant_name format a30 select occupant_name,space_usage_kbytes from v$sysaux_occupants order by space_usage_kbytes desc; OCCUPANT_NAME 阅读全文

清理SYSAUX(其二)

2023-05-19 16:06 by 明朝散发, 43 阅读, 收藏,
摘要: 【是由于升级到19C之后index扩大导致,重建index】 1. ```--检查表空间使用情况 column used format 999,999,999 heading 'USED(MB)' column free format 999,999,999 heading 'FREE(MB)' c 阅读全文

清理SYSAUX(其一)

2023-05-19 16:03 by 明朝散发, 37 阅读, 收藏,
摘要: 1: add SYSAUX tablespace 或者如下脚本: ``` if test -f /var/opt/oracle/oratab then voratab=/var/opt/oracle/oratab else voratab=/etc/oratab fi export voratab 阅读全文

19C DG 应用lag快捷恢复

2023-05-19 16:00 by 明朝散发, 46 阅读, 收藏,
摘要: --standby db: SELECT thread#, group#, sequence#, bytes, archived, status FROM v$standby_log order by thread#, group#; --lack of archivelogs --solution 阅读全文

oracle CPU usage 100% 处理一例

2023-05-19 15:58 by 明朝散发, 311 阅读, 收藏,
摘要: 1. 确定cpu usage top sqls ``` select * from ( select SQL_ID , sum(decode(session_state,'ON CPU',1,0)) as CPU, sum(decode(session_state,'WAITING',1,0)) - 阅读全文

SQL server 备份job堵塞查询

2023-05-19 15:53 by 明朝散发, 28 阅读, 收藏,
摘要: ``` SELECT req.session_id, database_name = db_name(req.database_id), req.status, req.blocking_session_id, req.command, [sql_text] = Substring(txt.TEXT 阅读全文

check and kill long running session if needed

2023-05-19 15:48 by 明朝散发, 13 阅读, 收藏,
摘要: select 'alter system kill session '''|| t.SID||','||t.SERIAL#||''';' from v$session t where t.SQL_ID='&sql_id' 阅读全文

oracle归档日志清理

2023-05-19 15:45 by 明朝散发, 101 阅读, 收藏,
摘要: 1.检测所有归档 RMAN> crosscheck archivelog all; 2.列出所有无效的归档 RMAN> list expired archivelog all; 3.删除过期的归档 RMAN> delete noprompt expired archivelog all; 阅读全文

oracle表空间自动扩容[shell]

2023-02-07 17:07 by 明朝散发, 70 阅读, 收藏,
摘要: ############################################################################################# # Version 1 20191021 # Manual # The purpose of this scri 阅读全文

ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit

2023-02-07 14:19 by 明朝散发, 357 阅读, 收藏,
摘要: 查看资源限制信息 set pagesize 100; set linesize 100; col username for a15; col profile for a15; col resource_name for a30; col limit for a10; SELECT DISTINCT 阅读全文