Oracle
We will be using a Linux Oracle
machine which already has the Oracle
database set up
Prerequisites
You will need sudo
privileges for the following steps.
Create a database
Log in to the oracle user which is already set up, for example, if a user 'oracle' is already set up, then log in as:
sudo su - oracle
Start the database listener
lsnrctl start
Create a data directory for the oracle data files (here mount point is assumed to be /u01 , it could be anything like /u02 on your machine)
mkdir /u01/oradata
Run the Database Creation Assistant:
dbca -silent \
-createDatabase \
-templateName General_Purpose.dbc \
-gdbname <your_db_name> \
-sid <your_db_name> \
-responseFile NO_VALUE \
-characterSet AL32UTF8 \
-sysPassword <your_password> \
-systemPassword <your_password> \
-createAsContainerDatabase false \
-databaseType MULTIPURPOSE \
-automaticMemoryManagement false \
-storageType FS \
-datafileDestination "/u02/oradata/" \
-ignorePreReqsReplace <your_db_name> with the name you want for your database, and replace <your_password> with the password you want to set
Set oracle variables required to connect (Here we assume your database name is "tdms_test"):
export ORACLE_SID=tdms_test
You should also add the ORACLE_SID variable to the oracle users .bashrc file for future sign-ins using the following command:
echo "export ORACLE_SID=tdms_test" >> ~oracle/.bashrc
Here again we assume that the user name is "oracle"
Log in to sqlplus shell:
sqlplus sys as sysdba
and enter the password when prompted
Create a user
Log in to sqlplus shell:
sqlplus sys as sysdba
and enter the password when prompted
Create a user:
SQL> CREATE USER tdms_user IDENTIFIED BY yoursupersecretpassword DEFAULT TABLESPACE users QUOTA UNLIMITED ON users PASSWORD EXPIRE;
Here we are creating a user named "tdms_user" and password as "yoursupersecretpassword"
Create a role for the same user:
SQL> CREATE ROLE tdms_user_role;
Here we are naming the role as "tdms_user_role"
Grant permissions to the role
SQL> GRANT CREATE SESSION, CREATE TABLE, CREATE SEQUENCE, CREATE VIEW, CREATE TRIGGER to tdms_user_role;
Grant the role to the user
SQL> GRANT tdms_user_role TO tdms_user;
Allow remote connections on Oracle
Open your
listener.ora
file which is located at$ORACLE_HOME/network/admin/
, and set the host as the IP of yourCloudTDMS
server as follows:...
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = <your_ip_here>)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
...Here you need to replace "<your_ip_here>" to the IP of your
CloudTDMS
serverAfter changing the configuration, restart the listener service:
lsnrctl start
Additionally you might need to configure firewall on the host. For this tutorial you can shutdown the firewall using the following command
sudo systemctl stop firewalld
Setting up your Oracle storage on CloudTDMS
Open the storages
tab and insert the following values for your new Oracle storage
Name
: Name for the storage.Hostname
: Domain Name or IPv4 address of yourOracle
server.Port
: The port on which yourOracle
server is listening for connections (default is 1521, cam be found in thelistener.ora
file).Username
: Username of yourOracle
server.Password
: Password of yourOracle
user.Database
: The database name.