File tree Expand file tree Collapse file tree 5 files changed +32
-13
lines changed Expand file tree Collapse file tree 5 files changed +32
-13
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ Thick Mode Changes
2727 standalone connections in addition to creating pools. For standalone
2828 connections, this parameter is optional.
2929
30+ Common Changes
31+ ++++++++++++++
32+
33+ #) Improved samples and documentation.
3034
3135oracledb 1.0.1 (June 2022)
3236--------------------------
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ def create_schema():
118118 id number generated by default as identity,
119119 username varchar2(40))';
120120
121- insert into demo (username) values ('chris') ;
121+ execute immediate ' insert into demo (username) values ('' chris'')' ;
122122
123123 commit;
124124 end;""" )
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ def create_schema():
165165 id number generated by default as identity,
166166 username varchar2(40))';
167167
168- insert into demo (username) values ('chris') ;
168+ execute immediate ' insert into demo (username) values ('' chris'')' ;
169169
170170 commit;
171171 end;""" )
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ USER root
4949
5050RUN microdnf module disable python36 && \
5151 microdnf module enable python39 && \
52- microdnf install python39 python39-pip python39-setuptools python39-wheel vim vi && \
52+ microdnf install python39 python39-pip python39-setuptools python39-wheel vim vi httpd-tools && \
5353 microdnf clean all
5454
5555WORKDIR /samples/
@@ -63,7 +63,7 @@ RUN curl -LO https://github.com/oracle/python-oracledb/archive/refs/heads/main.
6363
6464USER oracle
6565
66- RUN python3 -m pip install oracledb --user
66+ RUN python3 -m pip install oracledb Flask --user --no-warn-script-location
6767
6868ARG PYO_PASSWORD
6969
Original file line number Diff line number Diff line change 1717import os
1818import time
1919
20+ oracledb .init_oracle_client ()
21+
2022pw = os .environ .get ("ORACLE_PASSWORD" )
2123os .environ ["PYO_SAMPLES_ADMIN_PASSWORD" ] = pw
2224
4042 print ("Try again in a few minutes" )
4143 exit ()
4244
43- # Connect to the CDB to start DRCP because enable_per_pdb_drcp is FALSE by
44- # default
45- print ("Starting DRCP pool" )
46- with oracledb .connect (user = "sys" ,
47- password = pw ,
48- dsn = "localhost/XE" ,
49- mode = oracledb .AUTH_MODE_SYSDBA ) as connection :
50- with connection .cursor () as cursor :
51- cursor .callproc ("dbms_connection_pool.start_pool" )
45+
46+ print ("Enabling per-PDB DRCP" )
47+
48+ c = oracledb .connect (mode = oracledb .SYSDBA )
49+ cursor = c .cursor ()
50+ cursor .execute ("alter pluggable database all close" )
51+ cursor .execute ("alter system set enable_per_pdb_drcp=true scope=spfile sid='*'" )
52+
53+ c = oracledb .connect (mode = oracledb .SYSDBA | oracledb .PRELIM_AUTH )
54+ c .startup (force = True )
55+
56+ c = oracledb .connect (mode = oracledb .SYSDBA )
57+ cursor = c .cursor ()
58+ cursor .execute ("alter database mount" )
59+ cursor .execute ("alter database open" )
60+
61+ c = oracledb .connect (user = "sys" ,
62+ password = pw ,
63+ dsn = "localhost/xepdb1" ,
64+ mode = oracledb .SYSDBA )
65+ cursor = c .cursor ()
66+ cursor .callproc ("dbms_connection_pool.start_pool" )
5267
5368# create_schema.py will be appended here by the Dockerfile
You can’t perform that action at this time.
0 commit comments