首页
Search
1
v2ray异常错误之二
3,310 阅读
2
linux时区设置
2,698 阅读
3
DB2常用操作
2,173 阅读
4
websphere修改jvm内存xmx和xms
1,929 阅读
5
nfs客户端文件属主为nobody的现象
1,552 阅读
技术
生活
运动
游戏
电影
登录
Search
标签搜索
docker
linux
troubleshooting
nginx
secure
truenas
mysql
windows
python
esxi
docker swarm
oracle
zabbix
tomcat
blog
dsm
群晖
rpa
freenas
db
yuc
累计撰写
291
篇文章
累计收到
0
条评论
首页
栏目
技术
生活
运动
游戏
电影
页面
搜索到
9
篇与
的结果
2023-09-18
Oracle统计内存实际占用的问题
0x1 背景 在服务器上,一般我们要查询进程占用了多少内存,使用 top 查看其 res 即可,对于大多数的服务都比较适用,但是 Oracle 却不能使用这个办法。 0x2 原因 如何统计oracle使用的内存一直是一个复杂的问题,通过操作系统top命令观察oracle进程,在低版本或者低负载的情况我们可能觉得没问题,使用率不高,但如果在高负载的情况我们就会看到一个奇怪的事情,那就是不管是 RES 相加还是 %MEM 相加,数值远超过系统内存或者 100%,所以结论是直接通过 top 命令计算 Oracle 内存使用时行不通的。 0x3 为什么 因为Oracle有一个SGA的概念,改内存在Oracle所有进程之间共享数据,如果某些Oracle进程使用到了SGA中的一些数据,那么内存就会重复统计 Oracle关于不能正确获取内存使用的解释 # https://docs.oracle.com/en-us/iaas/os-management/doc/known-issues.html Display of Memory Utilization data for DB Instance resource types is not supported in this release. Memory Utilization(%) metric is not supported for Oracle Database Instance. Oracle Database processes have shared memory, and using a non-root user, it is not possible to accurately calculate memory across all processes without overcounting. This will be addressed in future releases with support for full monitoring of the Oracle Database. 0x4 how 那么该怎么统计Oracle实际使用的内存呢? 可以通过统计 SGA 和 PGA 使用的大小来确定
2023年09月18日
4 阅读
0 评论
0 点赞
2023-09-11
根据操作系统进程查询Oracle会话
0x1 场景 很多时候我们可以看到 top 中有些 Oracle进程持续占用很高的 CPU 或者内存,但是无奈会话太多,不能确定是哪个导致,那么应该如何定位呢? 0x2 查询sql 直接执行此SQL,根据提示输入系统进程号即可 Enter the os pid and find the sql id select sid, sql_id from v$session s, v$process p where s.paddr = p.addr and p.spid = &OS_PID; 根据上面的SQL返回内容,替换下面的 sql_id Enter the sql_id to find the sql_text set long 1000 set pages 1000 lines 1000 col sql_text for a100 select sql_text from v$sql where sql_id = '&sql_id'; 0x3 其他 仍然会存在不准确的现象,因为有些事务很大,包含很多SQL,可能当前查询出来的sql是整个事务中性能影响较小的,已经错过了最佳的执行时间。
2023年09月11日
3 阅读
0 评论
0 点赞
2023-08-24
rman备份策略以及脚本
0x1 rman推荐每周一次0级备份,其他时间1级备份,不需要搞其他级别备份,麻烦但是节省不了多少空间。 https://www.oracle.com/br/a/tech/docs/technical-resources/best-practices-for-oda.pdf 0x2 0级备份 echo `date +%a` rman target / run { allocate channel t1 type disk; allocate channel t2 type disk; allocate channel t3 type disk; allocate channel t4 type disk; backup as compressed backupset incremental level 0 tag 'db_level0' skip inaccessible format '/rman/back_%s_%p_%T_%d' database; sql 'alter system archive log current'; backup skip inaccessible tag 'archlog' format '/rman/arclogback_%s_%p_%t_%d' archivelog all; backup tag 'controlfile' format='$BACKUPDIR/controlfile_%d_%U_%T.ctl' current controlfile; backup tag 'spfile' format='$BACKUPDIR/spfile_%d_%U_%T.ora' spfile; #delete input; release CHANNEL t1; release CHANNEL t2; release CHANNEL t3; release CHANNEL t4; } allocate channel for maintenance device type disk; crosscheck archivelog all; delete noprompt expired archivelog all; crosscheck backup; delete noprompt expired backup; report obsolete; delete noprompt obsolete; list backup summary; release channel; 1级累积备份 rman target / run { allocate channel t1 type disk; allocate channel t2 type disk; allocate channel t3 type disk; allocate channel t4 type disk; backup as compressed backupset incremental level 1 cumulative tag 'db_level1' skip inaccessible format '/rman/back_%s_%p_%T_%d' database; sql 'alter system archive log current'; backup skip inaccessible tag 'archlog' format '/rman/arclogback_%s_%p_%t_%d' archivelog all; backup tag 'controlfile' format='$BACKUPDIR/controlfile_%d_%U_%T.ctl' current controlfile; backup tag 'spfile' format='$BACKUPDIR/spfile_%d_%U_%T.ora' spfile; #delete input; release CHANNEL t1; release CHANNEL t2; release CHANNEL t3; release CHANNEL t4; } allocate channel for maintenance device type disk; crosscheck archivelog all; delete noprompt expired archivelog all; crosscheck backup; delete noprompt expired backup; report obsolete; delete noprompt obsolete; list backup summary; release channel;
2023年08月24日
5 阅读
0 评论
0 点赞
2022-09-06
expdp及impdp CTRL-C 结束后后台还在跑怎么解决
0x1 因为某些原因恢复报错,想要直接中断,重新执行恢复任务,但实际ctrl+c会在后台继续执行任务,所以需要手动停止 0x2 首先看数据库中数据泵的任务状态 sqlplus / as sysdba select job_name,state from dba_datapump_jobs; exit 进入impdb停止任务状态为运行中的任务 impdp \' / as sysdba\' attach=SYS_IMPORT_SCHEMA_01 #SYS_IMPORT_SCHEMA_01为刚查出来的正在跑的job名 Import> stop_job =immediate Are you sure you wish to stop this job ([yes]/no): yes 停止任务后,再进入数据库查询是否有任务历史,因为历史可能会很大,导致表空间爆满 select job_name,state from dba_datapump_jobs; 如果存在未运行中的历史记录,删除对应的表即可: # sys执行的数据泵任务 drop table sys.SYS_IMPORT_SCHEMA_01; # 其他用户执行的任务同理
2022年09月06日
1,029 阅读
0 评论
0 点赞
1
2