You can get data using various ways, or using different Data Ingestion tools.
It would also depend upon multiple factors but naming a few
- On-premise or Cloud(AWS, Azure, GCP)
- Whether you want to get data only once or on daily basis.
I am assuming you want to get data only once and your DB connectivity is working fine. Install these, if they are not
pip install pandas
pip install SQLAlchemy
pip install cx_Oracle
In your python notebook or IDE
import pandas as pd
import cx_Oracle
import sqlalchemy
Add appropriate values of (user, password, hostIP:Port , service_name) in engine.
engine = sqlalchemy.create_engine("oracle+cx_oracle://user:password@hostIP:port/service_name=DB_name", arraysize=1000)
SQL_query = """SELECT* from table"""
df = pd.read_sql(SQL_query, engine)