选择查询中的PL / SQL存储错误(PL/SQL Storage error in Select Query)
我有以下游标定义
cMultiplier NUMBER := 100000000000000000 ; CURSOR CR_TABLE1 IS SELECT to_char((COL_ID * cMultiplier) + SEQ,'0999999999999999999') "NEW_COL" FROM TABLE1;
然后这个光标被提取为
FETCH CR_TABLE1 BULK COLLECT INTO AR_TABLE1 LIMIT I_BULK_LIMIT; EXIT WHEN AR_TABLE1.COUNT = 0;
AR_TABLE1
的类型TYPE T_TABLE1 IS TABLE OF CR_TABLE1%ROWTYPE; AR_TABLE1 T_TABLE1;
对于所有情况,
COL_ID
的测试值是1
,并且SEQ
的测试值是1234567654322
(13位数字)。 此值在长度为19时插入另一个VARCHAR
类型的表中。问题是光标到达
FETCH
,它会引发异常,说明ORA-06500: PL/SQL: storage error
我知道它必须用select语句做一些事情,但我将它转换为字符串(varchar)。 为什么我遇到这个问题?
I have following cursor definition
cMultiplier NUMBER := 100000000000000000 ; CURSOR CR_TABLE1 IS SELECT to_char((COL_ID * cMultiplier) + SEQ,'0999999999999999999') "NEW_COL" FROM TABLE1;
Then this cursor is being fetched as
FETCH CR_TABLE1 BULK COLLECT INTO AR_TABLE1 LIMIT I_BULK_LIMIT; EXIT WHEN AR_TABLE1.COUNT = 0;
Where
AR_TABLE1
is of typeTYPE T_TABLE1 IS TABLE OF CR_TABLE1%ROWTYPE; AR_TABLE1 T_TABLE1;
The test values for
COL_ID
is1
for all cases and the test values forSEQ
is1234567654322
(13 digit number). This value is being inserted as of length 19 in another table of typeVARCHAR
.The problem is No sooner the cursor comes to
FETCH
, it throws exception statingORA-06500: PL/SQL: storage error
I know it has to do something with select statement, but i am converting it into a string (varchar). Why i am running into this issue?
原文:https://stackoverflow.com/questions/8139061
最满意答案
根据您尝试使用Measure-VM,我假设您使用的是Hyper-V。 我在我的一个Hyper-V脚本中使用类似的东西:
(Get-VM dechiro1).HardDrives | ForEach { $GetVhd = Get-VHD -Path $_.Path [pscustomobject]@{ Name = $_.Name Type = $GetVhd.VhdType ProvisionedGB = ($GetVhd.Size / 1GB) CommittedGB = ($GetVhd.FileSize / 1GB) } }
基本上,对于每个虚拟机的硬盘驱动器,使用Get-VHD获取VHD详细信息,其中包括完整大小和我所称的承诺大小(磁盘上的实际空间)。
示例输出:
Name Type ProvisionedGB CommittedGB ---- ---- ------------- ----------- Hard Drive on IDE controll... Dynamic 20 0.00390625 Hard Drive on IDE controll... Dynamic 40 0.00390625
编辑 :
如果您想从每个VM中提取并将VM名称包含在返回的对象中,并且您更喜欢使用管道表单,则可以使用:
Get-VM | ForEach { $Vm = $_; $_.HardDrives } | ForEach { $GetVhd = Get-VHD -Path $_.Path [pscustomobject]@{ Vm = $Vm.Name Name = $_.Name Type = $GetVhd.VhdType ProvisionedGB = ($GetVhd.Size / 1GB) CommittedGB = ($GetVhd.FileSize / 1GB) } }
Based on your attempt to use Measure-VM, I assumed you are using Hyper-V. I use something similar to this in one of my Hyper-V scripts:
(Get-VM dechiro1).HardDrives | ForEach { $GetVhd = Get-VHD -Path $_.Path [pscustomobject]@{ Name = $_.Name Type = $GetVhd.VhdType ProvisionedGB = ($GetVhd.Size / 1GB) CommittedGB = ($GetVhd.FileSize / 1GB) } }
Basically, for each of the virtual machine's hard drives, use Get-VHD to get the VHD details which includes the full size and what I refer to as the committed size (actual space on disk).
Example output:
Name Type ProvisionedGB CommittedGB ---- ---- ------------- ----------- Hard Drive on IDE controll... Dynamic 20 0.00390625 Hard Drive on IDE controll... Dynamic 40 0.00390625
Edit:
If you wanted to pull from every VM and include the VM name with the returned object and you prefer to use the pipeline form, this will work:
Get-VM | ForEach { $Vm = $_; $_.HardDrives } | ForEach { $GetVhd = Get-VHD -Path $_.Path [pscustomobject]@{ Vm = $Vm.Name Name = $_.Name Type = $GetVhd.VhdType ProvisionedGB = ($GetVhd.Size / 1GB) CommittedGB = ($GetVhd.FileSize / 1GB) } }
相关问答
更多-
可以使用多少内存(How much memory could vm use)[2022-06-30]
从Linux内核文档 : max_map_count: 该文件包含进程可能具有的最大内存映射区域数量。 内存映射区域被用作调用malloc的一个副作用,直接通过mmap和mprotect,以及加载共享库时。 虽然大多数应用程序需要少于一千个映射,但某些程序(尤其是malloc调试器)可能会占用很多映射,例如,每个分配最多包含一个或两个映射。 默认值是65536。 底线:该设置限制了离散映射内存区域的数量 - 本身不会限制这些区域的大小或进程可用的内存大小 。 是的,这是: sysctl -w vm.max_ ... -
是的,不是。 当你超过RAM时,Redis不会摔倒,但实际上并不推荐。 Redis作者撰写的一篇有趣的相关文章: http : //antirez.com/news/52 这并不意味着Redis是会话存储的糟糕选择,它只是意味着您需要根据容量需求适当地规划/调整架构/ RAM。 Yes and no. Redis won't fall over when you exceed RAM but it's really not recommended. An interesting related articl ...
-
点亮硬盘中的数据备份(Ignite data backup in hard disk)[2022-05-07]
您可以为任何缓存创建和配置持久性存储[1]。 如果重新启动集群,则所有数据都将存在,并可使用IgniteCache#loadCache(..)方法重新加载到内存中。 开箱即用Ignite提供与RDBMS [2]和Cassandra [3]的集成。 此外,在未来的一个版本中(很可能是下一个版本2.1),Ignite将提供一个本地磁盘持久性存储,允许使用冷缓存运行,即在集群重启后无需显式重新加载。 我建议监视dev和用户Apache Ignite邮件列表以获取更多详细信息。 [1] https://apache ... -
VBoxManage文档提供了以下Config文件行示例: Config file: /home/username/.VirtualBox/Machines/Windows XP/Windows XP.xml 因此,如果我们将您对vm_dir更改改为: vm_dir=`VBoxManage showvminfo "${vm}" | grep "Config file"| cut -2 -d:` 我们有配置文件的路径。 注意 :从=周围删除空格,因为这是不正确的。 要提取它的目录部分,我们将使用d ...
-
如何在java api中使用vphere获取vm附带的所有卷?(How to get all volumes attached with vm in vphere in java api?)[2021-07-27]
与此同时,我找到了答案。 所有礼节对Deadline VirtualMachine vm = getVM(); // get the vm object ListvirtualDiskList = new ArrayList (); VirtualMachineConfigInfo vmConfig = vm.getConfig(); VirtualDevice[] vds = vmConfig.getHardware() ... -
您在Web角色和cspkg文件中看到的站点是编译的输出,因此您无法从中获取原始.cs文件。 也就是说,您可以使用Reflector,Just Decompile或其他各种反编译器之类的工具将编译后的位反向工程,使其与原始C#代码非常接近(不是我假设这是您自己的代码或没有反向工程规定的代码。 这至少可以让你使用webrole上的位来获取大部分代码,然后查看它以查看它的工作有多好。 注意,您可以打开cspkg文件。 它只是一个zip文件。 你可以使用.zip文件扩展名重命名并打开它,但你不会在那里找到.cs文件 ...
-
Ben H在评论中提供了答案,我只是在复制他的答案: $DiskArr -join "," 被改为 $DiskArr.DiskInfo -join "," 基本上问题是缺少属性名称。 我提供的对象,但没有任何财产参考。 The answer was provided in comments by Ben H. I am merely copying his answer: $DiskArr -join "," was changed to $DiskArr.DiskInfo -join " ...
-
似乎我无法将实际和最大磁盘使用量集成到一个脚本中,因此我将它们分成两个。 对于实际的磁盘使用情况,我使用了以下脚本: Get-VM -VMName * | Select-Object VMid | Get-VHD | Select-Object Path, Size, FileSize 对于最大分配内存,我使用了以下脚本: Measure-VM -Name * | select-object -property VMName, TotalDiskAllocation It seems that I am ...
-
根据您尝试使用Measure-VM,我假设您使用的是Hyper-V。 我在我的一个Hyper-V脚本中使用类似的东西: (Get-VM dechiro1).HardDrives | ForEach { $GetVhd = Get-VHD -Path $_.Path [pscustomobject]@{ Name = $_.Name Type = $GetVhd.VhdType ProvisionedGB = ($GetVhd.Size / 1G ...
-
连续的内存块和VM(Contiguous blocks of memory and VM)[2023-02-01]
在物理内存中是否与页面边界重叠的内容实际上是连续的,现代内存处理程序永远无法知道。 内存粘合逻辑基本上将所有可寻址内存页面视为无序集合,并且排序基本上与进程相关联; 不能保证对于不同的进程最终被分配相同的两个物理内存页面(在不同的时间点),这些物理页面之间的表达关系将是相同的。 实际上,在CPU和处理这些东西的内存之间有一个转换层。 Whether or not something that overlaps a page boundary is actually contiguous in Physica ...