标签云
asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-00742 ORA-01110 ORA-01555 ORA-01578 ORA-01595 ORA-08103 ORA-600 2131 ORA-600 2662 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (103)
- 数据库 (1,763)
- DB2 (22)
- MySQL (76)
- Oracle (1,605)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (166)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (69)
- Oracle Bug (8)
- Oracle RAC (54)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (28)
- Oracle备份恢复 (588)
- Oracle安装升级 (97)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (86)
- PostgreSQL (30)
- pdu工具 (6)
- PostgreSQL恢复 (9)
- SQL Server (32)
- SQL Server恢复 (13)
- TimesTen (7)
- 达梦数据库 (3)
- 达梦恢复 (1)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (39)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (22)
-
最近发表
- .sstop勒索加密数据库恢复
- 解决一次硬件恢复之后数据文件0kb的故障恢复case
- Error in invoking target ‘libasmclntsh19.ohso libasmperl19.ohso client_sharedlib’问题处理
- ORA-01171: datafile N going offline due to error advancing checkpoint
- linux环境oracle数据库被文件系统勒索加密为.babyk扩展名溯源
- ORA-600 ksvworkmsgalloc: bad reaper
- ORA-600 krccfl_chunk故障处理
- Oracle Recovery Tools恢复案例总结—202505
- ORA-600 kddummy_blkchk 数据库循环重启
- 记录一次asm disk加入到vg通过恢复直接open库的案例
- CHECKDB 发现了 N 个分配错误和 M 个一致性错误
- 达梦数据库dm.ctl文件异常恢复
- Oracle Recovery Tools修复ORA-00742、ORA-600 ktbair2: illegal inheritance故障
- 可能是 tempdb 空间用尽或某个系统表不一致故障处理
- 11.2.0.4库中遇到ORA-600 kcratr_nab_less_than_odr报错
- [MY-013183] [InnoDB] Assertion failure故障处理
- Oracle 19c 202504补丁(RUs+OJVM)-19.27
- Oracle Recovery Tools修复ORA-600 6101/kdxlin:psno out of range故障
- pdu完美支持金仓数据库恢复(KingbaseES)
- 虚拟机故障引起ORA-00310 ORA-00334故障处理
月归档:五月 2012
xdb组件中关于ftp/http监听
发现监听进程监听8080和2100端口
--监听端口 [oracle@xifenfei ~]$ netstat -nap|grep tnslsnr (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 29866/tnslsnr tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN 29866/tnslsnr tcp 0 0 0.0.0.0:2100 0.0.0.0:* LISTEN 29866/tnslsnr --进程名称 [oracle@xifenfei ~]$ ps -ef|grep 29866 oracle 29866 1 0 00:20 pts/0 00:00:00 /u01/oracle/9.2.0/db_1/bin/tnslsnr LISTENER -inherit
查看监听状态
[oracle@xifenfei ~]$ lsnrctl status LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 08-MAY-2012 00:26:50 Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xifenfei)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 9.2.0.4.0 - Production Start Date 08-MAY-2012 00:20:47 Uptime 0 days 0 hr. 6 min. 3 sec Trace Level off Security OFF SNMP OFF Listener Parameter File /u01/oracle/9.2.0/db_1/network/admin/listener.ora Listener Log File /u01/oracle/9.2.0/db_1/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=8080))(Presentation=HTTP)(Session=RAW)) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=2100))(Presentation=FTP)(Session=RAW)) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "xffXDB" has 1 instance(s). Instance "xff", status READY, has 1 handler(s) for this service... Service "xifenfei" has 2 instance(s). Instance "xff", status UNKNOWN, has 1 handler(s) for this service... Instance "xff", status READY, has 1 handler(s) for this service... The command completed successfully --从这里可以看出oracle的listener确实监听了8080和2100端口
查看listener.ora文件
[oracle@xifenfei ~]$ more /u01/oracle/9.2.0/db_1/network/admin/listener.ora # LISTENER.ORA Network Configuration File: /u01/oracle/9.2.0/db_1/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = xifenfei)(PORT = 1521)) ) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) ) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /u01/oracle/9.2.0/db_1) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = xifenfei) (ORACLE_HOME = /u01/oracle/9.2.0/db_1) (SID_NAME = xff) ) ) --从中确认未监听8080和2100端口,看来这两个端口是在动态注册监听的时候加入进去的. --我们知道oracle的xdb组件可能会启用http和ftp功能,这两个功能可能会开启响应端口,我们分析xdb组件.
查看xdb组件是否工作正常
SQL> select 2 comp_name, status, version from 3 DBA_REGISTRY where 4 comp_name='Oracle XML Database'; COMP_NAME STATUS VERSION ------------------------------ ---------------------- ---------- Oracle XML Database VALID 9.2.0.4.0 SQL> select count(*) from dba_objects where owner='XDB' and status='INVALID'; COUNT(*) ---------- 0 SQL> show parameter dispatchers; NAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ dispatchers string (PROTOCOL=TCP) (SERVICE=xffXDB) max_dispatchers integer 5 mts_dispatchers string (PROTOCOL=TCP) (SERVICE=xffXDB) mts_max_dispatchers integer 5 --查询证明xdb组件应该工作正常
查看xdb中ftp和http启动相关端口
SQL> select dbms_xdb.GETFTPPORT() from dual; select dbms_xdb.GETFTPPORT() from dual * ERROR at line 1: ORA-00904: "DBMS_XDB"."GETFTPPORT": invalid identifier SQL> select dbms_xdb.GETHTTPPORT() from dual; select dbms_xdb.GETHTTPPORT() from dual * ERROR at line 1: ORA-00904: "DBMS_XDB"."GETHTTPPORT": invalid identifier --9i中为提供上述查询端口的相关程序. SQL> set long 10000 SQL> set pagesize 0 SQL> SELECT dbms_xdb.cfg_get FROM dual; --从中找到类此这样记录,确实ftp启用2100端口,http启用8080端口 <ftpconfig> <ftp-port>2100</ftp-port> <ftp-listener>local_listener</ftp-listener> <ftp-protocol>tcp</ftp-protocol> <session-timeout>6000</session-timeout> </ftpconfig> <httpconfig> <http-port>8080</http-port> <http-listener>local_listener</http-listener> <http-protocol>tcp</http-protocol> <session-timeout>6000</session-timeout> <server-name>XDB HTTP Server</server-name> </httpconfig> --到这里我们可以确定是由于xdb组件中的ftp和http功能自动注册导致监听了2100和8080端口
修改xdb中监听ftp和http端口
SQL> call dbms_xdb.cfg_update(updateXML(dbms_xdb.cfg_get(),' 2 /xdbconfig/sysconfig/protocolconfig/httpconfig/http-port/text()',8888)); Call completed. SQL> call dbms_xdb.cfg_update(updateXML(dbms_xdb.cfg_get(), 2 '/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port/text()',2222)); Call completed. SQL> commit; Commit complete. SQL> exec dbms_xdb.cfg_refresh; PL/SQL procedure successfully completed. SQL> exit Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production [oracle@xifenfei ~]$ lsnrctl status LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 08-MAY-2012 00:57:13 Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xifenfei)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 9.2.0.4.0 - Production Start Date 08-MAY-2012 00:20:47 Uptime 0 days 0 hr. 36 min. 26 sec Trace Level off Security OFF SNMP OFF Listener Parameter File /u01/oracle/9.2.0/db_1/network/admin/listener.ora Listener Log File /u01/oracle/9.2.0/db_1/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=8888))(Presentation=HTTP)(Session=RAW)) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=2222))(Presentation=FTP)(Session=RAW)) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "xffXDB" has 1 instance(s). Instance "xff", status READY, has 1 handler(s) for this service... Service "xifenfei" has 2 instance(s). Instance "xff", status UNKNOWN, has 1 handler(s) for this service... Instance "xff", status READY, has 1 handler(s) for this service... The command completed successfully
xdb中ftp和http监听
SQL> alter system reset dispatchers scope=spfile sid='*'; System altered. SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started. Total System Global Area 353441008 bytes Fixed Size 451824 bytes Variable Size 184549376 bytes Database Buffers 167772160 bytes Redo Buffers 667648 bytes Database mounted. Database opened. SQL> show parameter dispatchers; NAME TYPE VALUE ------------------------------------ ---------------------- --------- dispatchers string max_dispatchers integer 5 mts_dispatchers string mts_max_dispatchers integer 5 --SELECT dbms_xdb.cfg_get FROM dual;中信息 <ftpconfig> <ftp-port>2222</ftp-port> <ftp-listener>local_listener</ftp-listener> <ftp-protocol>tcp</ftp-protocol> <session-timeout>6000</session-timeout> </ftpconfig> <httpconfig> <http-port>8888</http-port> <http-listener>local_listener</http-listener> <http-protocol>tcp</http-protocol> <session-timeout>6000</session-timeout> <server-name>XDB HTTP Server</server-name> </httpconfig> [oracle@xifenfei dbs]$ lsnrctl status LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 08-MAY-2012 01:10:07 Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xifenfei)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 9.2.0.4.0 - Production Start Date 08-MAY-2012 00:20:47 Uptime 0 days 0 hr. 49 min. 20 sec Trace Level off Security OFF SNMP OFF Listener Parameter File /u01/oracle/9.2.0/db_1/network/admin/listener.ora Listener Log File /u01/oracle/9.2.0/db_1/network/log/listener.log Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC))) Services Summary... Service "PLSExtProc" has 1 instance(s). Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service... Service "xifenfei" has 2 instance(s). Instance "xff", status UNKNOWN, has 1 handler(s) for this service... Instance "xff", status READY, has 1 handler(s) for this service... The command completed successfully --证明已经关闭了xdb 组件的ftp/http监听
xdb组件中的ftp/http监听在9i数据库中,只要你安装了xdb组件,会自动启用这功能.
在10g及其11g中默认不启用.所以为了你的数据库安全,如果不使用这些功能,建议手工关闭
发表在 Oracle 监听
评论关闭
db2 内存监控
active databa 列表
[db2inst1@xifenfei ~]$ db2 list active databases Active Databases Database name = XIFENFEI Applications connected currently = 1 Database path = /home/db2inst1/db2inst1/NODE0000/SQL00003/
查看db2各个组件内存分配
[db2inst1@xifenfei ~]$ db2mtrk -i -p -v -d Tracking Memory on: 2012/05/07 at 22:13:44 Memory for instance Other Memory is of size 10682368 bytes FCMBP Heap is of size 786432 bytes Database Monitor Heap is of size 327680 bytes Total: 11796480 bytes Memory for database: XIFENFEI Backup/Restore/Util Heap is of size 65536 bytes Package Cache is of size 196608 bytes Other Memory is of size 131072 bytes Catalog Cache Heap is of size 65536 bytes Buffer Pool Heap (1) is of size 72482816 bytes Buffer Pool Heap (System 32k buffer pool) is of size 851968 bytes Buffer Pool Heap (System 16k buffer pool) is of size 589824 bytes Buffer Pool Heap (System 8k buffer pool) is of size 458752 bytes Buffer Pool Heap (System 4k buffer pool) is of size 393216 bytes Shared Sort Heap is of size 65536 bytes Lock Manager Heap is of size 10551296 bytes Database Heap is of size 13172736 bytes Application Heap (13) is of size 65536 bytes Application Heap (12) is of size 65536 bytes Application Heap (11) is of size 65536 bytes Application Heap (10) is of size 65536 bytes Application Heap (9) is of size 65536 bytes Applications Shared Heap is of size 196608 bytes Total: 99549184 bytes Memory for agent 33 Other Memory is of size 196608 bytes Total: 196608 bytes Memory for agent 32 Other Memory is of size 196608 bytes Total: 196608 bytes Memory for agent 31 Other Memory is of size 196608 bytes Total: 196608 bytes Memory for agent 30 Other Memory is of size 196608 bytes Total: 196608 bytes Memory for agent 19 Other Memory is of size 393216 bytes Total: 393216 bytes
查看内存统计(9.5及其以后版本)
[db2inst1@xifenfei ~]$ db2pd -dbptnmem -db xff Database XFF not activated on database partition 0. Option -dbptnmem is an instance scope option. The database option has been ignored. Database Partition 0 -- Active -- Up 0 days 00:05:30 -- Date 2012-05-07-22.16.43.375064 Database Partition Memory Controller Statistics Controller Automatic: Y Memory Limit: 775904 KB Current usage: 306560 KB HWM usage: 306816 KB Cached memory: 78144 KB Individual Memory Consumers: Name Mem Used (KB) HWM Used (KB) Cached (KB) ======================================================== APPL-XIFENFEI 40000 40000 39488 DBMS-db2inst1 31936 31936 4992 FMP_RESOURCES 22528 22528 0 PRIVATE 6272 6272 0 LCL-p8353 128 128 0 LCL-p8353 128 128 0 DB-XIFENFEI 205568 205568 33664
查看内存段粗略信息
可以通过-db database 指定具体数据库
[db2inst1@xifenfei ~]$ db2pd -memset Database Partition 0 -- Active -- Up 0 days 00:18:39 -- Date 2012-05-07-22.29.52.410789 Memory Sets: Name Address Id Size(Kb) Key DBP Type Unrsv(Kb) Used(Kb) HWM(Kb) Cmt(Kb) Uncmt(Kb) DBMS 0x10000000 32769 31936 0xF5EDE61 0 0 4992 11648 11648 11648 20288 FMP 0x11F30000 65538 22592 0x0 0 0 2 0 192 22592 0 Trace 0x00000000 0 8510 0xF5EDE74 0 -1 0 8510 0 8510 0 --指定数据库名称 [db2inst1@xifenfei ~]$ db2pd -memset -db xifenfei Database Partition 0 -- Database XIFENFEI -- Active -- Up 0 days 01:26:18 -- Date 2012-05-07-23.56.47.325997 Memory Sets: Name Address Id Size(Kb) Key DBP Type Unrsv(Kb) Used(Kb) HWM(Kb) Cmt(Kb) Uncmt(Kb) XIFENFEI 0xA62E9000 1015815 205632 0x0 0 1 33664 96832 96832 96832 108800 AppCtl 0xB2BB9000 983046 40064 0x0 0 12 0 576 832 832 39232 App38 0x00000000 0 0 0x0 0 0 0 0 0 0 0 App37 0x00000000 0 0 0x0 0 0 0 0 0 0 0 App36 0x00000000 0 0 0x0 0 0 0 0 0 0 0 App35 0x00000000 0 0 0x0 0 0 0 0 0 0 0 App34 0x000E8005 950277 128 0x0 0 4 0 128 0 128 0
查看内存段具体信息
[db2inst1@xifenfei ~]$ db2pd -mempool Database Partition 0 -- Active -- Up 0 days 00:18:48 -- Date 2012-05-07-22.30.01.008074 Memory Pools: Address MemSet PoolName Id Overhead LogSz LogUpBnd LogHWM PhySz PhyUpBnd PhyHWM Bnd BlkCnt CfgParm 0x10000AA4 DBMS fcm 74 0 0 608414 0 0 655360 0 Ovf 0 n/a 0x100009F0 DBMS fcmsess 77 65440 845168 1118208 845168 983040 1179648 983040 Ovf 3 n/a 0x1000093C DBMS fcmchan 79 65440 159488 405504 159488 327680 458752 327680 Ovf 3 n/a 0x10000888 DBMS fcmbp 13 65440 590592 860160 590592 786432 917504 786432 Ovf 3 n/a 0x100007D4 DBMS fcmctl 73 186304 1176241 3118764 1176241 1376256 3145728 1376256 Ovf 11 n/a 0x10000720 DBMS monh 11 122592 144003 368640 144251 327680 393216 327680 Ovf 18 MON_HEAP_SZ 0x1000066C DBMS resynch 62 26928 104080 1703936 104080 196608 1703936 196608 Ovf 2 n/a 0x100005B8 DBMS apmh 70 2672 459104 4325376 459636 524288 4325376 524288 Ovf 25 n/a 0x10000504 DBMS kerh 52 112 276828 3997696 276828 327680 3997696 327680 Ovf 65 n/a 0x10000450 DBMS bsuh 71 65408 2235556 8978432 2266560 2359296 8978432 2359296 Ovf 44 n/a 0x1000039C DBMS sqlch 50 0 1681833 1703936 1681833 1703936 1703936 1703936 Ovf 203 n/a 0x100002E8 DBMS krcbh 69 0 106248 65536 106352 131072 65536 131072 Ovf 14 n/a 0x10000234 DBMS eduah 72 1904 2816016 2816048 2816016 2818048 2818048 2818048 Ovf 1 n/a 0x11F30234 FMP undefh 59 8048 122900 22971520 122900 131072 23003136 131072 Phy 1 n/a --指定数据库名称 [db2inst1@xifenfei ~]$ db2pd -mempool -db xifenfei Database Partition 0 -- Database XIFENFEI -- Active -- Up 0 days 00:05:29 -- Date 2012-05-07-22.35.58.149684 Memory Pools: Address MemSet PoolName Id Overhead LogSz LogUpBnd LogHWM PhySz PhyUpBnd PhyHWM Bnd BlkCnt CfgParm 0xA62E9E28 XIFENFEI utilh 5 0 2120 24313856 2544 65536 24313856 65536 Ovf 10 UTIL_HEAP_SZ 0xA62E9CC0 XIFENFEI pckcacheh 7 29216 115799 Unlimited 117211 196608 Unlimited 196608 Ovf 4 PCKCACHESZ 0xA62E9C0C XIFENFEI xmlcacheh 93 50944 80008 20971520 80008 131072 20971520 131072 Ovf 1 n/a 0xA62E9B58 XIFENFEI catcacheh 8 0 59488 Unlimited 59488 65536 Unlimited 65536 Ovf 9 CATALOGCACHE_SZ 0xA62E99F0 XIFENFEI bph 16 114464 72118000 Unlimited 72118000 72482816 Unlimited 72482816 Ovf 535 n/a 0xA62E9888 XIFENFEI bph 16 32 782592 Unlimited 782592 851968 Unlimited 851968 Ovf 5 n/a 0xA62E9720 XIFENFEI bph 16 32 520448 Unlimited 520448 589824 Unlimited 589824 Ovf 3 n/a 0xA62E95B8 XIFENFEI bph 16 32 389376 Unlimited 389376 458752 Unlimited 458752 Ovf 2 n/a 0xA62E9450 XIFENFEI bph 16 32 323840 Unlimited 323840 393216 Unlimited 393216 Ovf 2 n/a 0xA62E939C XIFENFEI shsorth 18 0 8860 28770304 8860 65536 28770304 65536 Ovf 16 SHEAPTHRES_SHR 0xA62E92E8 XIFENFEI lockh 4 32 10487424 10616832 10487424 10551296 10616832 10551296 Ovf 1 LOCKLIST 0xA62E9234 XIFENFEI dbh 2 419040 12439291 24903680 12441635 13172736 24903680 13172736 Ovf 739 DBHEAP 0xB2BB966C AppCtl apph 1 0 7452 1048576 7452 65536 1048576 65536 Phy 17 APPLHEAPSZ 0xB2BB95B8 AppCtl apph 1 0 7452 1048576 7452 65536 1048576 65536 Phy 17 APPLHEAPSZ 0xB2BB9504 AppCtl apph 1 0 7452 1048576 8864 65536 1048576 65536 Phy 17 APPLHEAPSZ 0xB2BB9450 AppCtl apph 1 0 7452 1048576 7452 65536 1048576 65536 Phy 17 APPLHEAPSZ 0xB2BB92E8 AppCtl apph 1 0 7726 1048576 18084 65536 1048576 65536 Phy 20 APPLHEAPSZ 0xB2BB9234 AppCtl appshrh 20 2048 127088 20480000 144484 196608 20512768 196608 Phy 25 application shared
发表在 DB2
评论关闭
使用dblink导致的/*+ OPAQUE_TRANSFORM */
数据库版本
--目标端 SQL> select * from v$version; BANNER ----------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production PL/SQL Release 11.2.0.3.0 - Production CORE 11.2.0.3.0 Production TNS for 32-bit Windows: Version 11.2.0.3.0 - Production NLSRTL Version 11.2.0.3.0 - Production --源端 SQL> select * from v$version; BANNER ---------------------------------------------------------------- Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi PL/SQL Release 10.2.0.4.0 - Production CORE 10.2.0.4.0 Production TNS for Linux: Version 10.2.0.4.0 - Production NLSRTL Version 10.2.0.4.0 - Production
目标端创建dblink
SQL> create database link dblink_xff connect to test identified by 2 test using 'ip/mcrm'; 数据库链接已创建。
dblink查询操作测试
--目标端 SQL> select count(*) from t_xifenfei@dblink_xff; COUNT(*) ---------- 50645 --源端 SQL> select sql_text from v$sql where lower(sql_text) like '%t_xifenfei%' and sql_text not like '%lower(%' and sql_text not like '%OPT_DYN_SAMP%'; SQL_TEXT ------------------------------------------------------------------- SELECT COUNT(*) FROM "T_XIFENFEI" "A1" SELECT /*+ FULL(P) +*/ * FROM "T_XIFENFEI" P
dblink创建空表测试
--目标端 SQL> create table chf.t_xifenfei as select * from t_xifenfei@dblink_xff where 1=0; 表已创建。 --源端 SQL> select sql_text from v$sql where lower(sql_text) like '%t_xifenfei%' and sql_text not like '%lower(%' and sql_text not like '%OPT_DYN_SAMP%'; SQL_TEXT ---------------------------------------------------------------------------- SELECT /*+ FULL(P) +*/ * FROM "T_XIFENFEI" P
dblink创建表插入数据
--目标端 SQL> create table chf.t_xifenfei_new as select * from t_xifenfei@dblink_xff; 表已创建。 --源端 SQL> select sql_text from v$sql where lower(sql_text) like '%t_xifenfei%' and sql_text not like '%lower(%' and sql_text not like '%OPT_DYN_SAMP%'; SQL_TEXT -------------------------------------------------------------------------------- SELECT /*+ FULL(P) +*/ * FROM "T_XIFENFEI" P SELECT "OWNER","OBJECT_NAME","SUBOBJECT_NAME","OBJECT_ID","DATA_OBJECT_ID","OBJE CT_TYPE","CREATED","LAST_DDL_TIME","TIMESTAMP","STATUS","TEMPORARY","GENERATED", "SECONDARY" FROM "T_XIFENFEI" "T_XIFENFEI"
dblink insert select插入数据测试
--目标端 SQL> insert into chf.t_xifenfei 2 select * from t_xifenfei@dblink_xff; 已创建 50645 行。 --源端 SQL> select sql_text from v$sql where lower(sql_text) like '%t_xifenfei%' and sql_text not like '%lower(%' and sql_text not like '%OPT_DYN_SAMP%'; SQL_TEXT -------------------------------------------------------------------------------- SELECT /*+ FULL(P) +*/ * FROM "T_XIFENFEI" P SELECT /*+ OPAQUE_TRANSFORM */ "OWNER","OBJECT_NAME","SUBOBJECT_NAME","OBJECT_ID ","DATA_OBJECT_ID","OBJECT_TYPE","CREATED","LAST_DDL_TIME","TIMESTAMP","STATUS", "TEMPORARY","GENERATED","SECONDARY" FROM "T_XIFENFEI" "T_XIFENFEI"
除掉OPAQUE_TRANSFORM 提示
--目标端 SQL> alter session set events '22825 trace name context forever, level 1' ; 会话已更改。 SQL> insert into chf.t_xifenfei 2 select * from t_xifenfei@dblink_xff; 已创建 50645 行。 --源端 SQL> select sql_text from v$sql where lower(sql_text) like '%t_xifenfei%' and sq l_text not like '%lower(%' and sql_text not like '%OPT_DYN_SAMP%'; SQL_TEXT -------------------------------------------------------------------------------- SELECT /*+ FULL(P) +*/ * FROM "T_XIFENFEI" P SELECT "OWNER","OBJECT_NAME","SUBOBJECT_NAME","OBJECT_ID","DATA_OBJECT_ID","OBJE CT_TYPE","CREATED","LAST_DDL_TIME","TIMESTAMP","STATUS","TEMPORARY","GENERATED", "SECONDARY" FROM "T_XIFENFEI" "T_XIFENFEI"
通过dblink的相关实验可以得出,在 insert-as-remote-select的时候,源端库上会出现/*+ OPAQUE_TRANSFORM */的hint提示.该hint的作用是:给出源端目标端要求的数据类型的明确信息(The OPAQUE_TRANSFORM hint is to help with the transformation of datatype when certain type of operations are done within the database).屏蔽盖hint的方法是设置event:22825 trace name context forever, level 1(官方文档还提供了另外两种hint的方式屏蔽这个,但是我测试均未成功)