Introduction
In this article, I want to talk about Oracle database running on Amazon RDS. Amazon RDS is the Amazon´s proposal for hosting relational databases in the cloud. We can simply the administration and scaling operations related to database applications as well as to reduce the total cost of ownership (TCO). Since 2011, we can host Oracle databases on Amazon RDS and Amazon is responsible for all database administration operations such as installations, upgrades, backups and so forth.
Creating an Oracle database on Amazon RDS
In order to create a database on Amazon RDS, we need an Amazon AWS account. After we have logged into Amazon AWS with our account, we go to the AWS console and go to the RDS console.
Now we can follow a wizard with the required instructions to create an Oracle database instance and related database.
The first step is to select the database engine. In our case, we select the Oracle Database Standard Edition One option since we want to use an Oracle licence from Amazon (see figure 1).
Figure 1
The second step is for setting parameters that impact positively on the performance and availability of the system in the production environment. For example, Multi-AZ deployment to provide high availability by automatically replicating the data onto several “standby” replicas in different availability zones (in order words, Amazon data centers on different geographic regions) as well as provisioned IOPS to support critical applications that require low latency.
In our case, because we´re running a demo, we don´t need these features as shown in the figure 2.
Figure 2
The third step allows specifying the parameters of the new instance. Now let´s describe the fields:
· License Model
o bring your own license
o license included (license supported by Amazon). This is our option
· DB Engine Version:
o At the time of this article, the only supported version of Oracle database is 11.x. In our case, we have selected the version 11.2.0.4.v3
· DB Instance Class:
o This is the type of EC2 instance where Oracle database system will be hosted. We have a range options depending on our requirements regarding to CPU and RAM. In our case, we have selected a db.t1.micro instance with 1 vCPU and 613 MB of RAM
· Multi-AZ deployment. This parameter was explained before. In our case, we say no to this option
· Storage type. It enables to select the type of storage
o General Purpose SSD. The storage medium is SSD and it´s available for a range a use cases
o Provisioned IOPS SSD. The storage medium is SSD and we can tune the IOPS according to our use case, for example, we have I/O-bound solutions
o Magnetic. The storage medium is a traditional hard disk and it´s available for low used databases. This is our case as a demo
· Allocated Storage: The storage capacity
· DB Instance Identifier. An identifier to be used for Amazon cloud infrastructure. It´s not actually the instance/service name. In our case, it´s mytestdbinstance
· The username and password of the master user is the information for the account with DBA privileges
The parameters regarding to the third step are shown in the figure 3.
Figure 3
The fourth step allows specifying the parameters regarding to the Oracle database instance. The parameters are described below:
· VPC. We select Not in VPC
· Availability Zone. We can specify the availability zone where we want to host our Oracle database instance. In our case, we select the us-east-1b option
· DB Security Group. This is a kind of firewall to control the external accesses to the Oracle database system using a network connection. In our case, we select the default option not authorizing any connections. Later we´re going to make some additional settings to grant connections to everyone
· Database Name. This is the actual instance/service name
· Database Port. This is port used by Oracle database instance to listen for network connections
· Parameter Group, Option Group and Character Set Name is selected by default
· Backup retention period specifies how many days; the automatic backup to the database is retained. In our case, we have selected the default 7 days
· Backup Window specifies the time to start executing the automatic backups
· Auto Minor Version Updates enables to execute automatic updates and upgrades to the database system
· Maintenance Window specifies the time to start executing the automatic updates and upgrades
The parameters regarding to the fourth step are shown in the figure 4 and figure 5.
Figure 4
Figure 5
Finally, we can click on the button “Launch DB instance” and we need to wait until the instance is finally created.
Now we can see the details associated to the newly created instance as shown in the figure 6.
Figure 6
It´s remarkable to say that we cannot connect to the Oracle database system because the endpoint is not allowed to receive network connections. See the red text close to the Endpoint label as shown in the Figure 7.
Figure 7
In order to configure the security group (the Amazon firewall) to enable network connections from any IP address, we need to click on the default security group, select a CIDR/IP connection type and specify all IPs (0.0.0.0/0) enable to connect as shown in the figure 8.
Figure 8
Now when we come back to the instance details, we can see that the endpoint is available for accepting network connections as shown in the figure 9.
Figure 9
Now, it´s time to connect to the Oracle database system residing on Amazon AWS RDS. In order to connect, we need the following information from the figure 9 above: Endpoint and DB_Name fields. With this information, we can create a TNSNAMES to connect via SQLPLUS command using the following format: username/password@endpoint/DB_Name.
Figure 10
With the DBA privilege, we can do the same administrator operations as normal on-premise Oracle database system, for example:
· Create users
· Create tablespaces
· Create database objects: tables, indexes
· Grant privileges to users
· And so on
Although, it´s remarkable to say that we have restrictions such as:
· We can´t connect directly to the OS
· Datafiles must be Oracle Managed Files. No filesystem access is allowed. ASM is not supported
· SQL statements to change the behavior of the system are not allowed (using ALTER SYSTEM statement)
At the end, we need to think about Oracle database system on Amazon RDS as a database self-managed, so there is no need to execute DBA operations.
Now let´s create a table for storing information about employees as shown below in the figure 11.
Figure 11
Now let´s add some data and execute a query as shown in the figure 12.
Figure 12
Summary
In this article, I´ve showed the key concepts, principles and examples for the creation of an Oracle database instance in Amazon AWS RDS services. With this option, you can reduce the total cost of ownership of your Oracle database formation by provisioning and deploying some instances onto Amazon cloud.