In an earlier article , I showed the steps to prepare for using the Oracle Database Cloud and Oracle Java Cloud. There are four steps: Creating an SSH key pair Creating Oracle Storage Creating Oracle Database Cloud Creating Oracle Java Cloud The previous article described the first two necessary preparation steps. This article will show how to go about actually creating an Oracle Database Cloud instance. I'll get back to creating the Java Cloud instance in a later article. I've already written about how to deploy an ADF application to an existing Java Cloud instance in this article . Invoking the Create Wizard To create your database instance, you use the Create Database Cloud Service Instance wizard. Go to cloud.oracle.com and click Sign In. Select your data center and click My Service. Enter your identity domain and then log on with your cloud username and password. Find the database service on the service dashboard and click Service Console. Click Services and then the Create Service button to start the wizard. It is pretty self-explanatory, but not the following: Set Service Level to Oracle Database Cloud Service (not “Virtual Image”). This makes it easier to create a database and provices some extra tooling. You might have a choice of database versions. At the time of writing (May 2016), the options were 11.2.0.4 and 12.1.0.2 Chose the relevant software edition. You will have to read the documentation to find out exactly which combinations of the normal Enterprise Edition database options hide behind the various EE choices (“high” and “extreme”) For Cloud Storage Container, use the container you created during preparation. When you are done with the wizard, the create process starts and runs for a while (often around 30 minutes). Connecting to the Database Once your database is created, you can click on the instance to get the connect information. For security reasons, the Oracle cloud sets up a number of access rules, but do not automatically enable access. You need to activate these rules before you can connect to the database from your development workstation. To do this, click on the menu icon next to your database name and choose Access Rules. You will see the list of rules that have been created automatically for you. To access the database from SQL Developer through SQL*Net, you need to enable the ora_p2_db_listener rule (covering port the default port 1521). If you want to use the DBaaS monitor, you also need the ora_p2_httpssl rule (port 443), and if you want to use APEX applications, you need the ora_p2_http rule (port 80). For each rule, click the menu icon to the right and choose Enable. If you chose to create an 11g database, the IP number, port and SID is all you need to connect to your database. However, if you chose a 12c database, connecting to the SID will connect you to the container database, not the pluggable database (PDB) where your actual data will reside. To connect to the PDB, you need to know the service name. You find this in the DBaaS console that you can open from the menu icon for your cloud service. You will have to log in with the user dbaas_monitor and the password you provided when you created the database instance. In the DBaaS Monitor, click on the Database Status to see your PDBs. From the action menu icon in the top right corner of your PDB instance, you can choose Connection Details to see the service name that you need to use to connect to your PDB from SQL Developer or another tool. With this information, you can create a connection from a development tool on your local machine to your Oracle Cloud database instance. Working with Application Express Of course, your Cloud database instance comes with Application Express (APEX) like every other Oracle database. Because you have enabled port 443, you can now access APEX by simply entering the IP number of your instance in a browser. Note that your browser is going to give you a security warning. This is because Oracle has only created a self-signed certificate for your cloud instance – depending on your browser, you will have to create a security exception where you explictly trust this self-signed certificate to avoid annoying security prompts. From your database main page, you can access the Database Monitor and Application Express. When you click on the Application Express icon, you get the normal APEX signin screen. You log in first time with workspace internal, user admin and the password you provided when you created the database. From the APEX Instance Administration screen, you can click Create Workspace to create a new workspace for application development. Moving Data to the Cloud If you don't want to use the normal APEX features to create tables and import data, you can use a Cloud Connection from an Oracle development tool like SQL Developer or JDeveloper. To use this feature, you need to know your SFTP username and password in addition to your connection information. You can find the SFTP users from the Users tab on your cloud overview page. You need to choose the action menu for one of these users and select Reset Password / Unlock account. When you have provided a password, the account is unlocked. When you have unlocked an SFTP account, you can create a Cloud connection from your chosen development tool and then use the neat "Database Cart" feature to move your database objects from your local database to your cloud instance. Open the database cart from the Window menu and then drag and drop your database objects onto the cart. You will notice that each object has a DDL column that you can check to create the DDL statement to create the object, and tables also has a Data column. If you check the checkbox in the Data column, JDeveloper or SQL Developer will include insert statements to re-create your data in the cloud. When you have everything you need in the cart, you click the cloud button to create and run a batch job to move everything to the cloud.
↧