Oracle stored procedure ORA-00972: identifier is too long - oracle

I've imported some customer DB using Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production. Now I need to create a procedure with identifier length > 30 but this is failing with the following error : "ORA-00972: identifier is too long". I read that in oracle 12.1.x and lower the limitation was 30 bytes and in 12.2.0.1.0 size is increased to 128 bytes. I ran 'describe all_objects/describe user_objects' on the DB and it's showing that identifier size is set to 128
DB all_objects result. However, it is still failing to create...Is it possible that the export was created in 12.1 and retained the 30 char limit even though it's showing 128 when imported into my local 12.2 db server. Any ideas?

Related

How to solve this error signaled in parallel query server ORA-12801 when delete

When i run this delete statement
delete /*+ PARALLEL(19) */
from billing_lines
where id_service in (select before_line from number_change)
and id_service not in (select max(a.new_line)
from number_change a, number_change bef
where a.new_line = bef.before_line
and not exists(select null from billing_lines f where f.id_contract= a.id_contract)
group by a.id_contract);
I get this error
ORA-12801: error signaled in parallel query server P003
ORA-12853: insufficient memory for PX buffers: current 12192K, max needed 6255360K
ORA-04031: unable to allocate 65560 bytes of shared memory ("
ORA-06512: at line 28
What is the problem. Do I have to increase the memory?
Any suggestion to solve this problem. Thanks in advance.
Oracle version
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
"CORE 11.2.0.4.0 Production"
TNS for HPUX: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
We need memory for each parallel thread in order to pass data between the threads and back to the coordinator. The more threads you have, the more memory you need.
"parallel 19" could give you up to 38 processes (19 producers, 19 consumers). Try reducing that, otherwise you probably need to bump up your SGA

Why getting different number of records using same query & same ODBC connection from different applications?

We have an application that uses ODBC to interact with an Oracle database. It has been in use for many years starting with Oracle 9. We are now moving from Oracle 11g to Oracle 19c.
On Windows 10 using an ODBC connection from the Oracle 19c, we see fewer records retrieved for a query than when we use the same query and a connection from Oracle 11g.
On Windows 7, using either connection works and brings back the expected number of records.
I also tried using the same ODBC connection for Oracle 19c in Excel on Windows 10 and with the same query retrieved the correct number of records.
From our application log
2020-Nov-03 09:54:27.579 DEBUG - CODBCDynamic::CreatePreparedStatement: 'SELECT ****'. [query truncated for posting]
2020-Nov-03 09:54:27.588 DEBUG - CODBCDynamic::BindArgument: index = 1, value = ****.
2020-Nov-03 09:54:27.679 DEBUG - CODBCDynamic::ExecuteQuery: 0 records returned.
There should have been one record returned.
Any clues, ideas would be greatly appreciated
Some new info:
We've created simplified versions: one 32 bit app (like the original) and one 64 bit. The 64 bit version works OK bringing back all the records. The 32 bit one doesn't bring back all the records (like the original).
Also, I forgot to note above that we are using the 32 bit client.

import oracle dump file where source and destination databases have different character sets

I am trying to import a .dmp file that was exported using Oracle Database 11g Enterprise Edition into Oracle 11g XE running on Windows 7 but I receive many errors like the following:
ORA-02374: conversion error loading table "SCHEMA"."TABLENAME"
ORA-12899: value too large for column COLNAME (actual: 90, maximum: 75)
The import command I use:
impdp system/pwd remap_schema=OLD_SCHEMA:NEW_SCHEMA tables=OLD_SCHEMA.Table1,OLD_SCHEMA.Table2 directory=DATA_PUMP_DIR dumpfile=mydump.dmp logfile=import.log exclude=grant,index,statistics
The charset of the dump file is WE8ISO8859P1 while my destination database is AL32UTF8
I read somewhere that Oracle 11g XE support AL32UTF8 only. Hence, I cannot alter this character set to match the source.
Is there any way I can import the dump file without getting the conversion errors?
Thanks
The problem is that some of the characters will take up more than one byte per character. You will need to change your database nls_length_semantics to 'CHAR' and redo the import. A step by step explanation is to be found here: http://albertolarripa.com/2012/06/10/ora-12899-changing-columns-to-char/

Unable to alter Oracle Parameters

I am unable to add more than 200 datafiles in my database because of these parameters:
select records_total from v$controlfile_record_section where type = 'DATAFILE';
select value from v$parameter where name = 'db_files';
Both of these give me an output of 200. I need to increase this to 400 so I have tried:
alter system set records_total = 400 where name = 'db_files';
alter system set value= 400 where type = 'DATAFILE';
but I am getting
S
QL Error: ORA-02065: illegal option for ALTER SYSTEM
02065. 00000 - "illegal option for ALTER SYSTEM"
*Cause: The option specified for ALTER SYSTEM is not supported
*Action: refer to the user manual for option supported
Am I able to change these parameters and how?
You probably want to use commands like this:
C:\Users\jonearles>sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Fri Jul 10 13:07:16 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> show parameter db_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_files integer 200
SQL> alter system set db_files=400 scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 1048576000 bytes
Fixed Size 3053584 bytes
Variable Size 662702064 bytes
Database Buffers 377487360 bytes
Redo Buffers 5332992 bytes
Database mounted.
Database opened.
SQL> show parameter db_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_files integer 400
SQL>
This assumes you are using an SPFILE (or else you will need to manually edit the init.ora file and restart) and you are not using RAC (or else you will need to use a command like srvctl stop database -d my_sid).
As ditto mentioned, it can help to look at the ALTER syntax. It may also help to look at the Oracle Database Reference, which will tell you if the command is dynamic (meaning it can be run without restarting the database).

Oracle table from SAS dataset

I was trying to create Oracle tables from SAS datasets. I am successful in many cases, but am stuck for a particular dataset. I am providing the log file below. I am working with SAS 9 and Oracle 11.2.0.1.0 on Linux.
Any suggestions?
1 libname dibsdata "/data2/dibyendu/Jan_9/on_demand/";
NOTE: Libref DIBSDATA was successfully assigned as follows:
Engine: V9
Physical Name: /data2/dibyendu/Jan_9/on_demand
2 libname myora oracle user=sasuser password=XXXXXXXXXX path=CIOEDATA ;
NOTE: Libref MYORA was successfully assigned as follows:
Engine: ORACLE
Physical Name: CIOEDATA
3 data myora.on_demand;
4 set dibsdata.on_demand;
5 run;
NOTE: SAS variable labels, formats, and lengths are not written to DBMS tables.
ERROR: Error attempting to CREATE a DBMS table. ERROR: ORACLE execute error: ORA-00904: : invalid identifier..
NOTE: The DATA step has been abnormally terminated.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: SAS set option OBS=0 and will continue to check statements. This might cause NOTE: No observations in data set.
WARNING: The data set MYORA.ON_DEMAND may be incomplete. When this step was stopped there were 0 observations and 48 variables.
ERROR: ROLLBACK issued due to errors for data set MYORA.ON_DEMAND.DATA.
NOTE: DATA statement used (Total process time):
real time 0.06 seconds
cpu time 0.00 seconds
ERROR: Errors printed on page 1.
2 The SAS System 17:00 Wednesday, January 9, 2013
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
real time 1.24 seconds
cpu time 0.04 seconds
Oracle error ORA-00904 means you are trying to create a table with an invalid column name. Most likely you have a SAS variable with a name longer that 30 characters or is an Oracle reserved word. For example, the two variables in this SAS dataset are illegal in Oracle:
data a;
column_name_too_long_for_oracle = 1;
date = today(); /* This is a reserved word */
run;
Here is the Oracle 11g Reserved Words list. Check the variable names in your SAS dataset and rename them to something legal in Oracle. If example, if the offender is a SAS variable named DATE, you might try this:
data myora.on_demand;
set dibsdata.on_demand(rename=(DATE=PROJ_DATE));
run;

Resources