You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>If you are running this tutorial in your own environment, install the following required software:</p>
109
+
<p>If you are running this tutorial in your own environment, install the required software:</p>
104
110
105
111
<ol>
106
-
<li><atarget="_blank" href="https://www.python.org/">Python</a> (3.6 preferred but 2.7 should work)</li>
107
-
<li>cx_Oracle (version 7.2 preferred but 6.3 or later should work, except for the section on Advanced Queuing which requires version 7.2 or later) and Oracle Instant Client Package - Basic (version 19.3 preferred but 18.3 or 12.2 should also work)
112
+
<li><p><atarget="_blank" href="https://www.python.org/">Python</a>. Version 3.6 is preferred.</p></li>
113
+
<li><p>cx_Oracle version 7.2 and the Oracle Client libraries.</p>
<li><atarget="_blank" href="http://cx-oracle.readthedocs.io/en/latest/installation.html#installing-cx-oracle-on-macos">macOS</a> - please note the special instructions for macOS in the link.</li>
<li><p>SQL*Plus such as from the Oracle <atarget="_blank" href="http://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html">Instant Client SQL*Plus Package</a>.</p></li>
115
122
</ol>
116
123
124
+
<p>The Advanced Queuing section requires Oracle client 12.2 or later. The SODA section requires Oracle client 18.5, or later, and Oracle Database 18 or later.</p>
125
+
117
126
<p>To create the schema run:</p>
118
127
119
128
<pre>
120
-
sqlplus sys/yoursyspassword@localhost/orclpdb as sysdba @sql/SetupSamples
129
+
sqlplus sys/yoursyspassword@localhost/orclpdb1 as sysdba @sql/SetupSamples
the password "welcome". The connect string is "localhost/orclpdb".
142
+
the password "welcome". The connect string is "localhost/orclpdb1".
134
143
See <code>sql/SampleEnv.sql</code>.</p>
135
144
136
145
<p>It is easist to have a local pluggable database with the service
137
-
'orclpdb' configured. If your database is not local, or has a
146
+
'orclpdb1' configured. If your database is not local, or has a
138
147
different service, you will need to modify the connection information in db_config.py and db_config.sql.</p>
139
148
140
149
<p>The following sections may need adjusting, depending on how you
@@ -174,16 +183,16 @@ <h4>1.1 Review the connection credentials</h4>
174
183
<pre>
175
184
user = "pythonhol"
176
185
pw = "welcome"
177
-
dsn = "localhost/orclpdb"
186
+
dsn = "localhost/orclpdb1"
178
187
</pre>
179
188
<code>db_config.sql</code>
180
189
<pre>
181
190
def user = "pythonhol"
182
191
def pw = "welcome"
183
-
def connect_string = "localhost/orclpdb"
192
+
def connect_string = "localhost/orclpdb1"
184
193
</pre>
185
194
186
-
<p>By default they connect to the 'orclpdb' database service on the same machine as Python. You can modify the values in both files to match the connection information for your environment.</p>
195
+
<p>By default they connect to the 'orclpdb1' database service on the same machine as Python. You can modify the values in both files to match the connection information for your environment.</p>
187
196
188
197
</li>
189
198
@@ -207,7 +216,7 @@ <h4>1.2 Creating a basic connection</h4>
207
216
the db_config.py module. In this case, Oracle's Easy Connect connection
208
217
string syntax is used. It consists of the hostname of your
209
218
machine, <code>localhost</code>, and the database service name
210
-
<code>orclpdb</code>. </p>
219
+
<code>orclpdb1</code>. </p>
211
220
212
221
<p>Open a command terminal and change to the <code>tutorial</code> directory:</p>
213
222
@@ -1128,7 +1137,7 @@ <h4>2.5 More DRCP investigation</h4>
1128
1137
<p>In a terminal window, start SQL*Plus using the lab credentials and connection string, such as:</p>
1129
1138
1130
1139
<pre>
1131
-
sqlplus pythonhol/welcome@localhost/orclpdb
1140
+
sqlplus pythonhol/welcome@localhost/orclpdb1
1132
1141
</pre>
1133
1142
1134
1143
<p>Use the SQL*Plus DESCRIBE command to look at the SDO definition:</p>
@@ -1661,6 +1670,9 @@ <h4>6.1 Basic output type handler</h4>
1661
1670
1662
1671
<li><h3><aname="lobs">7. LOBs</a></h3>
1663
1672
1673
+
<p>Oracle Database "LOB" long objects can be streamed using a LOB
1674
+
locator, or worked with directly as strings or bytes.</p>
1675
+
1664
1676
<ul>
1665
1677
<li>
1666
1678
<h4>7.1 Fetching a CLOB using a locator</h4>
@@ -1694,8 +1706,8 @@ <h4>7.1 Fetching a CLOB using a locator</h4>
1694
1706
</pre>
1695
1707
1696
1708
<p>This inserts some test string data and then fetches one
1697
-
record into <code>clob</code>, which is a cx_Oracle LOB Object.
1698
-
Methods on LOB include <code>size()</code> and
1709
+
record into <code>clob</code>, which is a cx_Oracle character
1710
+
LOB Object. Methods on LOB include <code>size()</code> and
1699
1711
<code>read()</code>.</p>
1700
1712
1701
1713
<p>To see the output, run the file:</p>
@@ -1947,7 +1959,7 @@ <h4>7.2 Fetching a CLOB as a string</h4>
1947
1959
1948
1960
<li><h3><aname="aq">10. Advanced Queuing</a></h3>
1949
1961
<ul>
1950
-
<li><h4>10.1 Message passing with Oracle Advanced Queuing</h4></li>
1962
+
<li><h4>10.1 Message passing with Oracle Advanced Queuing</h4>
1951
1963
1952
1964
<p>Review <code>aq.py</code>:</p>
1953
1965
@@ -2074,6 +2086,114 @@ <h4>7.2 Fetching a CLOB as a string</h4>
0 commit comments