Home Database Mysql Tutorial 一次丧心病狂的PLS-00306错误分析

一次丧心病狂的PLS-00306错误分析

Jun 07, 2016 pm 04:36 PM
dat analyze mistake

在做database replay预处理的时候遇到一个问题,初略的看,是执行包调用内部(函数/存储过程)出现的错误。感觉是一个典型的传参的错误。 SQL exec dbms_workload_replay.PROCESS_CAPTURE('AAA');BEGIN dbms_workload_replay.PROCESS_CAPTURE('AAA'); END; *ER

在做database replay预处理的时候遇到一个问题,初略的看,是执行包调用内部(函数/存储过程)出现的错误。感觉是一个典型的传参的错误。

SQL> exec dbms_workload_replay.PROCESS_CAPTURE('AAA');
BEGIN dbms_workload_replay.PROCESS_CAPTURE('AAA'); END; 
*
ERROR at line 1:
ORA-06550: line 1, column 15:
PLS-00306: wrong number or types of arguments in call to 'ADD_CAPTURE'
ORA-06550: line 1, column 9:
PL/SQL: Statement ignored
ORA-06512: at "SYS.DBMS_WORKLOAD_REPLAY", line 2301
ORA-06512: at line 1
Copy after login

这种问题,一般我们都会做10046 trace进一步看调用了那个函数引起的问题。从trace中看到是在运行dbms_wrr_internal.add_capture出的问题。

BEGIN   :1 := dbms_wrr_internal.add_capture( :name,                                        :db_id,                                        :db_name, 
                              :db_version,                                        'tmp',                                        '/tmp', 
                  'TRUE',                                        :status,                                        NULL, 
NULL,                                        :stime,                                        NULL,                                        :sscn, 
                           :dflt_action,                                        NULL,                                        NULL, 
             :wid,                                        :internal_stime                                      ); END; 
END OF STMT 
PARSE #11529215044979176000:c=0,e=540,p=0,cr=0,cu=0,mis=1,r=0,dep=1,og=1,plh=0,tim=434859905841 
===================== 
PARSING IN CURSOR #11529215044979172808 len=8 dep=1 uid=0 oct=45 lid=0 tim=434859906846 hv=2761672982 ad='0' sqlid='8sst43uk9rk8q' 
ROLLBACK 
END OF STMT 
PARSE #11529215044979172808:c=0,e=12,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=0,plh=0,tim=434859906844 
XCTEND rlbk=1, rd_only=1, tim=434859906921 
EXEC #11529215044979172808:c=0,e=33,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=0,plh=0,tim=434859906939 
CLOSE #11529215044979172808:c=0,e=2,dep=1,type=3,tim=434859906960 
PARSE #11529215044979172808:c=0,e=6,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=0,plh=0,tim=434859907039 
XCTEND rlbk=1, rd_only=1, tim=434859907062 
EXEC #11529215044979172808:c=0,e=15,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=0,plh=0,tim=434859907074 
CLOSE #11529215044979172808:c=0,e=1,dep=1,type=3,tim=434859907091 
EXEC #11529215044981457272:c=10000,e=77698,p=0,cr=60,cu=29,mis=0,r=0,dep=0,og=1,plh=0,tim=434859907137 
ERROR #11529215044981457272:err=6550 tim=434859907154
SQL> desc dbms_wrr_internal 
FUNCTION ADD_CAPTURE RETURNS NUMBER 
Argument Name                  Type                    In/Out Default? 
------------------------------ ----------------------- ------ -------- 
NAME                           VARCHAR2                IN 
DB_ID                          NUMBER                  IN 
DB_NAME                        VARCHAR2                IN 
DB_VERSION                     VARCHAR2                IN 
DIR                            VARCHAR2                IN 
DPATH                          VARCHAR2                IN 
DPATH_SHARED                   VARCHAR2                IN 
STATUS                         VARCHAR2                IN 
ECODE                          NUMBER                  IN 
EMSG                           VARCHAR2                IN 
STIME                          DATE                    IN 
ETIME                          DATE                    IN 
SSCN                           NUMBER                  IN 
DEFAULT_ACTION                 VARCHAR2                IN 
AWR_DB_ID                      NUMBER                  IN 
AWR_BSNAP                      NUMBER                  IN 
WID                            VARCHAR2                IN
SQL> select NAME,DATATYPE_STRING,VALUE_STRING from v$sql_bind_capture where sql_id='3h55aw49j63g8'; 
no rows selected
Copy after login

本来以为10046能够把绑定变量这些数值抓出来,但是这里确没有,v$sql_bind_capture也抓不到绑定变量的值。我怀疑和内部的包有关系。所以我们无从判断是哪一个参数的调用类型出了问题。遇到这样的问题也没什么好的办法,以前在自己的Linux环境上搞过database replay,是能够成功的,所以想法就是把Linux上环境的这个包迁移到Hp环境上在试试。于是就用grep去搜索具体是那个文件。搜到了文件名为"prvtwrr.plb"的文件,里面是一堆加密的东西。把这个文件传到HP上运行,运行完后发现,妹的还是报以前的错误。郁闷啊,为什么在我Linux上的环境就可以了,在HP的环境就不行了。走投无路的时候,同事在$ORACLE_HOME目录下面执行了下列命令。

w4sd23pa#[/home/oracle]find $ORACLE_HOME -name "prvtwrr.plb" 
/oracle/app/oracle/product/11.2.0/db_1/rdbms/admin/prvtwrr.plb 
/oracle/app/oracle/product/11.2.0/db_1/.patch_storage/17411249_Apr_21_2014_22_29_21/files/rdbms/admin/prvtwrr.plb 
w4sd23pa#[/home/oracle] 
w4sd23pa#[/home/oracle]ls -l /oracle/app/oracle/product/11.2.0/db_1/rdbms/admin/prvtwrr.plb 
-rw-r--r--   1 oracle     oinstall    151611 Apr 22 13:29 /oracle/app/oracle/product/11.2.0/db_1/rdbms/admin/prvtwrr.plb 
w4sd23pa#[/home/oracle]ls -l /oracle/app/oracle/product/11.2.0/db_1/.patch_storage/17411249_Apr_21_2014_22_29_21/files/rdbms/admin/prvtwrr.plb 
-rw-r--r--   1 oracle     oinstall    149850 Sep 29  2013 /oracle/app/oracle/product/11.2.0/db_1/.patch_storage/17411249_Apr_21_2014_22_29_21/files/rdbms/admin/prvtwrr.plb
Copy after login

执行find命令居然发现能够找到两个文件,而另外一个文件明眼一看就是补丁文件17411249,赶紧用opatch看了一下补丁的情况。发现这个补丁是最近新装的。

w4sd23pa#[/home/oracle]opatch lsinventory 
Oracle Interim Patch Installer version 11.2.0.3.6 
Copyright (c) 2013, Oracle Corporation.  All rights reserved. 
Oracle Home       : /oracle/app/oracle/product/11.2.0/db_1 
Central Inventory : /oracle/app/oraInventory 
   from           : /oracle/app/oracle/product/11.2.0/db_1/oraInst.loc 
OPatch version    : 11.2.0.3.6 
OUI version       : 11.2.0.4.0 
Log file location : /oracle/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2014-05-27_23-23-16PM_1.log 
Lsinventory Output file location : /oracle/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2014-05-27_23-23-16PM.txt 
-------------------------------------------------------------------------------- 
Installed Top-level Products (1): 
Oracle Database 11g                                                  11.2.0.4.0 
There are 1 product(s) installed in this Oracle Home. 
Interim patches (18) : 
Patch  17411249     : applied on Tue May 20 18:41:12 GMT+08:00 2014 
Unique Patch ID:  17551033 
   Created on 21 Apr 2014, 22:29:21 hrs PST8PDT 
   Bugs fixed: 
     17411249
Copy after login

看到了这个信息之后,我们就怀疑是不是安装这个补丁出了问题。如果是的话,我们回退了再试试,于是我们把这个补丁做了一个回退,在readme里面看还要运行一个postinstall.sql脚本,回退完成后在执行预处理的操作发现居然成功了。然后我们再一次安装了这个补丁,运行了postinstall.sql脚本,发现预处理还是成功的。后面问了安装补丁的同事,最终发现是他忘记了执行postinstall.sql脚本。总的来说,这个故事还是很丧心病狂的,如果不去执行一把find命令,根本就不会发现是因为安装了新补丁造成的错误。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Unable to complete operation (Error 0x0000771) Printer error Unable to complete operation (Error 0x0000771) Printer error Mar 16, 2024 pm 03:50 PM

If you encounter an error message when using your printer, such as the operation could not be completed (error 0x00000771), it may be because the printer has been disconnected. In this case, you can solve the problem through the following methods. In this article, we will discuss how to fix this issue on Windows 11/10 PC. The entire error message says: The operation could not be completed (error 0x0000771). The specified printer has been deleted. Fix 0x00000771 Printer Error on Windows PC To fix Printer Error the operation could not be completed (Error 0x0000771), the specified printer has been deleted on Windows 11/10 PC, follow this solution: Restart Print Spool

Revealing the causes of HTTP status code 460 Revealing the causes of HTTP status code 460 Feb 19, 2024 pm 08:30 PM

Decrypting HTTP status code 460: Why does this error occur? Introduction: In daily network use, we often encounter various error prompts, including HTTP status codes. These status codes are a mechanism defined by the HTTP protocol to indicate the processing of a request. Among these status codes, there is a relatively rare error code, namely 460. This article will delve into this error code and explain why this error occurs. Definition of HTTP status code 460: First, we need to understand the basics of HTTP status code

Solution to Windows Update prompt Error 0x8024401c error Solution to Windows Update prompt Error 0x8024401c error Jun 08, 2024 pm 12:18 PM

Table of Contents Solution 1 Solution 21. Delete the temporary files of Windows update 2. Repair damaged system files 3. View and modify registry entries 4. Turn off the network card IPv6 5. Run the WindowsUpdateTroubleshooter tool to repair 6. Turn off the firewall and other related anti-virus software. 7. Close the WidowsUpdate service. Solution 3 Solution 4 "0x8024401c" error occurs during Windows update on Huawei computers Symptom Problem Cause Solution Still not solved? Recently, the web server needs to be updated due to system vulnerabilities. After logging in to the server, the update prompts error code 0x8024401c. Solution 1

How to solve the 403 error encountered by jQuery AJAX request How to solve the 403 error encountered by jQuery AJAX request Feb 20, 2024 am 10:07 AM

Title: Methods and code examples to resolve 403 errors in jQuery AJAX requests. The 403 error refers to a request that the server prohibits access to a resource. This error usually occurs because the request lacks permissions or is rejected by the server. When making jQueryAJAX requests, you sometimes encounter this situation. This article will introduce how to solve this problem and provide code examples. Solution: Check permissions: First ensure that the requested URL address is correct and verify that you have sufficient permissions to access the resource.

Linux Oops: Detailed explanation of what this error means Linux Oops: Detailed explanation of what this error means Mar 21, 2024 am 09:06 AM

LinuxOops: Detailed explanation of the meaning of this error, need specific code examples What is LinuxOops? In Linux systems, "Oops" refers to a situation where a serious error in the kernel causes the system to crash. Oops is actually a kernel crash mechanism that stops the system when a fatal error occurs and prints out relevant error information so that developers can diagnose and fix the problem. Oops usually occur in kernel space and have nothing to do with user space applications. When the kernel encounters

Why does the Xiangxiangfuzhai app display an error? Why does the Xiangxiangfuzhai app display an error? Mar 19, 2024 am 08:04 AM

The display error is a problem that may occur in the Xiangxiang Fuzhai app. Some users are not sure why the Xiangxiang Fuzhai app displays errors. It may be due to network connection problems, too many background programs, incorrect registration information, etc. Next, This is the editor’s introduction to how to solve app display errors for users. Interested users should come and take a look! Why does the Xiangxiang Fuzhai app display an error answer: network connection problem, too many background programs, incorrect registration information, etc. Details: 1. [Network problem] Solution: Check the device connection network status, reconnect or choose another network connection to use. Can. 2. [Too many background programs] Solution: Close other running programs and release the system, which can speed up the running of the software. 3. [Incorrect registration information

Interpreting Oracle error 3114: causes and solutions Interpreting Oracle error 3114: causes and solutions Mar 08, 2024 pm 03:42 PM

Title: Analysis of Oracle Error 3114: Causes and Solutions When using Oracle database, you often encounter various error codes, among which error 3114 is a relatively common one. This error generally involves database link problems, which may cause exceptions when accessing the database. This article will interpret Oracle error 3114, discuss its causes, and give specific methods to solve the error and related code examples. 1. Definition of error 3114 Oracle error 3114 pass

Fatal: Unable to fast forward, GIT pull aborted with error Fatal: Unable to fast forward, GIT pull aborted with error Feb 20, 2024 am 09:13 AM

When performing a gitpull operation, you may encounter a fatal error that cannot be fast forwarded, causing the process to be terminated. Even trying to use -ff-only doesn't solve the problem. This article explores possible solutions and countermeasures. Fix Fatal Error: Unable to fast-forward, aborting Git Pull Error If you get Fatal Error: Unable to fast-forward, aborting GitPull error, follow the below-mentioned solutions to resolve the issue. Pull rebasing merges the changes in the master branch into a new branch. Let’s talk about it in detail. 1] Pulling with rebase In addition to the commonly used "gitpull" command, you can also try the "gitpull-rebase" command. This command will first get the latest changes from the remote branch and then copy your

See all articles