Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Thin mode fails with ORA-24964 when trying to open a PDB migrated from Oracle 19c to 26ai

Aperta
#592 6 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python

Direzione di ricerca

Inizia eseguendo gli script forniti test_thin.py e test_thick.py sulla PDB migrata descritta, quindi confronta la gestione di ALTER PLUGGABLE DATABASE test OPEN READ WRITE in modalità thin e thick. Traccia il punto di ingresso della modalità thin responsabile della risposta ORA-24964; il lavoro è completato quando il comando in modalità thin apre correttamente la PDB senza quell'errore.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

1. What versions are you using?

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0

Oracle AI Database 26ai Enterprise Edition Release 23.26.1.0.0 - Production
Version 23.26.1.0.0

platform.platform: Linux-5.15.0-319.201.4.2.el8uek.x86_64-x86_64-with-glibc2.28
sys.maxsize > 2**32: True
platform.python_version: 3.12.13
oracledb.__version__: 4.0.1

2. Is it an error or a hang or a crash?

Command ALTER PLUGGABLE DATABASE test OPEN READ WRITE fails with ORA-24964: ALTER SESSION SET CONTAINER error when run in oracledb thin mode

3. What error(s) or behavior you are seeing?

First, I detach a PDB from 19c with commands:
ALTER PLUGGABLE DATABASE test UNPLUG INTO '/tmp/test.pdb';

Then I attach it to 26ai:
create pluggable database test as clone using '/tmp/test.pdb';

Finally, I'm trying to open it:
ALTER PLUGGABLE DATABASE test OPEN READ WRITE;

If I run last command using sqlplus or oracledb in thick mode, PDB gets automatically upgraded and open after 20 minutes.

If I run last command using oracledb in thin mode, last command fails with error ORA-24964 after fer seconds.

4. Does your application call init_oracle_client()?

Failing application does not call init_oracle_client(), it runs in thin mode.

I tried same command with calling init_oracle_client() and using thick mode and it worked fine.

5. Include a runnable Python script that shows the problem.

This fails:

import oracledb

# Thin mode is default
print("Running in Thin mode:", oracledb.is_thin_mode())

dsn = "hostname:1521/CDB"

connection = oracledb.connect(
    user="sys",
    password="password",
    dsn=dsn,
    mode=oracledb.SYSDBA
)

cursor = connection.cursor()

try:
    cursor.execute(
        "ALTER PLUGGABLE DATABASE test OPEN READ WRITE"
    )
    connection.commit()
    print("PDB opened successfully in Thin mode")

except Exception as e:
    print("Thin mode error:")
    print(e)

finally:
    cursor.close()
    connection.close()
$ python3.12 test_thin.py
Running in Thin mode: True
Thin mode error:
ORA-24964: ALTER SESSION SET CONTAINER error
Help: https://docs.oracle.com/error-help/db/ora-24964/

This succeeds:

import oracledb

# Enable Thick mode
oracledb.init_oracle_client(
    lib_dir="/u01/app/oracle/product/23/dbhome_1/lib"
)

print("Running in Thin mode:", oracledb.is_thin_mode())

dsn = "hostname:1521/CDB"

connection = oracledb.connect(
    user="sys",
    password="password",
    dsn=dsn,
    mode=oracledb.SYSDBA
)

cursor = connection.cursor()

try:
    cursor.execute(
        "ALTER PLUGGABLE DATABASE test OPEN READ WRITE"
    )
    connection.commit()
    print("PDB opened successfully in Thick mode")

except Exception as e:
    print("Thick mode error:")
    print(e)

finally:
    cursor.close()
    connection.close()

$ python3.12 test_thick.py
Running in Thin mode: False
PDB opened successfully in Thick mode
Lingua principale
Python
Stelle
451
Fork
118
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oracle/python-oracledb

Tutte le issue di oracle/python-oracledb

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.