Oracle Cloud also has NoSQL (Oracle NoSQL Database Cloud) For NoSQL, how do you execute DDL and DML in Python? I wanted to investigate.
There is an Oracle NoSQL Database Cloud simulator, You can try it on your local PC, so I've summarized the steps to use the Oracle NoSQL Database Cloud Simulator and how to run DDL and DML in Python.
In this post It will be the contents to touch the Oracle NoSQL Database Cloud simulator from Python in the Windows 10 environment.
The prerequisite is the procedure from the state where Anaconda-Python 3.7 version is installed in the Windows 10 environment.
https://docs.cloud.oracle.com/ja-jp/iaas/nosql-database/doc/developing-oracle-nosql-database-cloud-simulator.html
The Oracle NoSQL Database Cloud Simulator simulates cloud services and You can write and test your application locally without accessing the Oracle NoSQL Database Cloud Service. The Oracle NoSQL Database Java SDK contains some samples for developers to use.
Before starting with Oracle NoSQL Database Cloud Service Develop applications with Oracle NoSQL Database Cloud Simulator to understand basic examples.
⇒ The Oracle NoSQL Database Cloud Simulator prepares an environment where you can try apps (Python, Java, Node.js, Go) in a local environment (notebook PC) without connecting to Oracle Cloud.
Prepare the following two environmental preparations ** 1. Download Oracle NoSQL Database Cloud Simulator ** ** 2. Install Oracle NoSQL Database Python SDK **
The prerequisite is the procedure from the state where Anaconda-Python 3.7 version is installed in the Windows 10 environment. To install Anaconda, go to here
Access https://docs.cloud.oracle.com/ja-jp/iaas/nosql-database/doc/downloading-oracle-nosql-cloud-simulator.html#GUID-3E11C056-B144-4EEA-8224-37F4C3CB83F6
Download oracle-nosql-cloud-simulator-1.2.0.zip to any folder and unzip it.
**-Java JDK version 10 or higher must be installed on your machine. ** ** ** · 5 GB or more of available disk space to install the Oracle NoSQL Database Cloud Simulator. ** **
https://www.oracle.com/java/technologies/javase-downloads.html Click [JDK Download] here to download the Windows x64 Installer.
Launch Anaconda prompt
At the Anaconda prompt
pip install borneo
And press [Enter]
Start command prompt Command prompt is started
Put the Java JDK path in the environment variable (PATH) The path of the Java JDK installed this time is C: \ Program Files \ Java \ jdk-14.0.1 \ bin Set the Java JDK path in the environment variable PATH with set PATH = C: \ Program Files \ Java \ jdk-14.0.1 \ bin;% PATH% Check the Java JDK version by typing Java -version ⇒ Confirm that the Java JDK 14 installed this time is used. At the command prompt Move to the directory where you unzipped oracle-nosql-cloud-simulator-1.2.0 Use the cd command to move to the directory where you unzipped oracle-nosql-cloud-simulator-1.2.0
Enter the following command at the command prompt
java -Djava.util.logging.config.file=logging.properties -jar cloudsim/lib/cloudsim.jar -root .
It will be in the state of being started with "Oracle NoSQL Cloud Simulator is ready"
Press [Ctrl] + C to stop.
Download the python sample script (nosql-python-sdk-5.2.0.zip) from GitHub. https://github.com/oracle/nosql-python-sdk/releases
Unzip nosql-python-sdk-5.2.0.zip to any folder. Sample scripts are stored in the [examples] folder.
Launch Anaconda prompt
Run the sample script (try running single_data_ops.py) Drag the sample script and press the [Enter] key. * Oracle NoSQL Database Cloud Simulator must be runningExecution result of single_data_ops.py
For more information, see Oracle NoSQL Database Python SDK (Japanese), [SQL Reference for Oracle NoSQL Database](SELECT Expression)](https://docs.oracle.com/en/database/other-databases/nosql-database/19.5/sqlreferencefornosql/select-expression.html ) Was also helpful.
multi_data_ops.py and table_ops.py can also be executed as sample scripts.
-Oracle NoSQL Database Python SDK https://docs.oracle.com/cd/E83857_01/paas/nosql-cloud/sdk/index.html
-SQL Reference for Oracle NoSQL Database (SELECT Expression) https://docs.oracle.com/en/database/other-databases/nosql-database/19.5/sqlreferencefornosql/select-expression.html
· NoSQL database manual https://docs.cloud.oracle.com/ja-jp/iaas/nosql-database/index.html
-NoSQL Database Manual (Development with Oracle NoSQL Database Cloud Simulator) https://docs.cloud.oracle.com/ja-jp/iaas/nosql-database/doc/developing-oracle-nosql-database-cloud-simulator.html
Recommended Posts