Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oracle_tablespace: PL/SQL error when altering a tablespace with a huge current maxsize #173

Open
jschampera opened this issue May 5, 2021 · 0 comments

Comments

@jschampera
Copy link

The oracle_tablespace module has a PL/SQL block as central element ro alter tablespaces.

I encountered an error while resizing a tablespace:

ORA-06502: PL/SQL: numerischer oder Wertefehler: Zeichenfolgenpuffer zu klein
ORA-06512: in Zeile 92
ORA-06512: in Zeile 92

It turned out that the MAXBYTES of the (temp-)tablespace in question was around 32TB, a relatively huge number in terms of bytes.

The anonymous PL/SQL block compares the current maxsize to the given one while making a string comparison between the current size calculated with the given unit ("m", "g", ...) and the given size string (module parameter) to identify if the maxsize is to be altered or not:

v_maxsize_current := ((rec.maxbytes)/v_divisor_maxsize);

v_maxsize_current is a VARCHAR2(20). In my case the resulting number ("32767.99997711181640625000") was longer than the max. size of v_maxsize_current, which lead to the error stack above.

The (quick) fix was to enlarge the relevant VARCHAR2s (I took 50, just a quickshot).

It hit me with MAXSIZE, but from what I can see it could happen with NEXT, too - at least the same way is used (but the numbers usually are smaller).

Sorry for not providing a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant