Access Apex On the Cloud Using DBaas

Oracle Database Cloud Service include Oracle Application Express, which you manage using the Oracle Application Express administration console. You access this administration console by going to the Oracle Application Express.

To access the Apex Application on the cloud;-

  • From the Dbaas you want, press on the tool panel and choose Apex.
  • To use the Apex you need to enable https on your cloud, to do this you have to access to compute services –> network and choose https
  • After doing this you will be able to access to Apex Page enter the following information:-
    • In the Workspace box, enter INTERNAL.
    • In the Username box, enter ADMIN.
    • In the password box, enter your password.
Enjoy the cloud
Cheers
Osama mustafa

Enable master key Encryption Key for a PDB on the cloud

SELECT wrl_parameter, status, wallet_type FROM v$encryption_wallet;Master Key Encryption allow you to encrypt sensitive data, such as credit card numbers, stored in table columns. Encrypted data is transparently decrypted for a database user who has access to the data. Transparent data encryption helps protect data stored on media in the event that the storage media or data file gets stolen for more information about it here.

After creating Database on the cloud ( Dbaas ) you can enable the master key by using the below steps :-

  • First of all you need to check the name of the container that you want to enable master key.
    • select con_id, dbid, name from v$pdbs;
  • as you see my container name is PDB1 set the session to this.
    • ALTER SESSION SET CONTAINER = PDB1;
  • Check the location for the wallet by running the below query :-
    • SELECT wrl_parameter, status, wallet_type FROM v$encryption_wallet;
  • Back to Root Container run the below query to see the wallet parameter type there is two value autologin or password each one of them having it’s own usage, in my case the value set to password.
  • Now i should close the wallet depend on the wallet type in my case it’s set as password then i will use the below  for more information about ADMINISTER KEY MANAGEMENT here
    • ADMINISTER KEY MANAGEMENT SET KEYSTORE close IDENTIFIED BY Mypassword;
  • When i tried to open the wallet using the same password i set it before. 
    • ADMINISTER KEY MANAGEMENT SET KEYSTORE open IDENTIFIED BY MyPassword CONTAINER=all
But my wallet is closed, i found oracle support document here Document number 1944507.1 which discuss this error and provide a solution for this error you can back to this document.
Once you apply the solution you will be able to open the wallet as below.
Welcome to TDE on the cloud.

Thank you
Osama Mustafa

Enable-Disable Database Vault on the Cloud

Oracle Database Vault restricts access to specific areas in an Oracle database from any user, including users who have administrative access. For example, you can restrict administrative access to employee salaries, customer medical records, or other sensitive information. for more information about it here

Now to enable DBV on the cloud it’s very simple all you have to do is the following :-

  • Connect to the compute node as oracle user using putty i post about this before.
  • To enable DBV Run the below command :-
    • dbaascli dv on
  • After this the output should like this “Successfully configured DV”
Congratulation DBV is enabled now.
And to Disable DBV All you have to do is Run :-
  • dbaascli dv off
Enjoy the Cloud , Cheers,
Osama Mustafa
Notes :-
  1. For the username i put C## because i am using database 12cR1 and enable pluggable..

Delete Oracle Storage cloud Container using File Transfer Manager CLI – FTMCLI

In this post i will show you how to delete the container with all the objects in it, we are using storage container to configure Oracle Cloud backup and store database backup in it, But if you want to delete this container oracle cloud will not allow you to do this because the container should be empty.

there are different way to do this all of them using command line, the way are :-

  • Web Console — working only if the container is empty.
  • RESTful API
  • Java Library
  • Oracle Storage Cloud File Transfer Manager CLI
  • File Transfer Manager API
Each one of them having it’s own advantage and disadvantage you can check oracle documentation foe this from here 
Let’s talk about FTMCLI it’s very simple and easy to use it you should have JRE 7 or later download from here
and Download FTMCLI From here
  • Now to make it simple as you can when you download put everything in one folder extract them 
  • inside FTMCTL zip file you will see files called ftmcli.properties”, this file allow you to save the storage name and configuration of Storage cloud if you do this it will not necessary to add it each time in the command line i prefer to do this, trying to do it once better to do it each time, the file having different parameters like this :-
    • auth-url :- URL of your Oracle Storage Cloud
    • user :- Your user name.
    • service :- The cloud service name.
    • identity-domain :- The name of your identity domain.
    • storage-class :- default standrad or you can change it to archive
    • max-threads :- The maximum number of threads to be used in a request.
    • retries :-  The number of times that a request must be retried in case of failure.
    • segment-size :- The segment size in MB.
    • segments-container :- The container in which the segments must be stored during the upload process.
            You can get all the information from the console –> Storage cloud –> Details.
  • Now Let’s using the command line on your PC open cmd or ssh depend on your operating system if you having Linux you need to set the export the following Check the documentation here :-
    • export FTM_AUTH_URL
    • export FTM_USER
    • export FTM_SERVICE
    • export FTM_IDOMAIN
  • using this command java.exe -jar ftmcli.jar –help you can see how to use the FTMCLI file.
  • My container on Oracle storage cloud called DBBackup so i want to delete with the below command ;-

c:\FTMCL\bin>java.exe -jar C:\FTMCL\ftmcli.jar delete -f DBBackup –properties-f
ile c:\FTMCL\ftmcli.properties

The output should be like this :-

Cheers And Enjoy the cloud.
Osama Mustafa

Deleting a Backup On The Cloud

In this post i will show you how to delete backup on the cloud using the command line :-

  • Connect to the compute node as the opc user.
  • Start a root-user command shell using sudo command 
    • sudo su –
  • List the backup
    • # /var/opt/oracle/bkup_api/bkup_api recover_list –keep
  • Delete the backup 
    • # /var/opt/oracle/bkup_api/bkup_api bkup_delete –bkup=backup-tag
      • where backup-tag is the tag of the backup you want to delete.
Thank you
Osama Mustafa

Failed to perform patching of Database Cloud Service

I mentioned before how to Patching database on the cloud, But today when i was trying to apply the new one i faced an issue, while i was searching i found a post that could solve this issue like here

From the above picture you see that database trying to download the patch but useless,using the command Line :-
After searching online for couple of hours my friend Gokhan Atil here , describe it very well an explained the issue.
Regarding to the Post and Oracle Community i should update my dbaascli
After following oracle documentation and the blog you will be able to patch the database successfully.
Osama

Create Backup On Demand On the Cloud

In This Post i will show how to create backup for Dbaas :-

  • Open the Oracle Database Cloud Service console.
  • Click the database deployment for which you want to create a backup.
  • Click the Administration tile.
  • Click Backup Now and then confirm the action.
Or you can use the command line by connect to your compute node as root use and run the following command :-
  • To create a backup that follows the current retention policy

# /var/opt/oracle/bkup_api/bkup_api bkup_start
  • To create a long-term backup
# /var/opt/oracle/bkup_api/bkup_api bkup_start –keep
  • Check Status 
# /var/opt/oracle/bkup_api/bkup_api bkup_status
Rentation in the cloud like the following :-

  • Both Cloud Storage and Local Storage: 30 days, with the 7 most recent days’ backups available on local storage
  • Cloud Storage Only: 30 days
  • Local Storage Only: 7 days
Enjoy the cloud
Osama 

Configure Putty to connect to the cloud

After posting different blog about Cloud and how to use the console what about the putty ?

How to use it :-

  • Download and install PuTTY from here.
  • Run the PuTTY program.
  • In host name put the ip address for the cloud services.
  • Connection type should be SSH.
  • After This On the left Panel Choose SSH –> Auth, and Click the Browse button next to the Private key file for authentication box. Then, in the Select private key file window, navigate to and open the private key file that matches the public key that is associated with the deployment .
You should remember the password for this or you need to add another SSH key.
Notes :-
  1. By Default you are connecting as Oracle user.
  2. if you want to use root access you should connect as opc user then ssh password and run “sudo -s” to switch to root user.
Thank you
Osama

Patching Database Cloud Service

There is nothing simple more than this , Applying patch on the cloud (Dbaas), Oracle Cloud allow you to check the following :-

  • Viewing Available Patches
  • Check Prerequisites.
  • Apply Patch.
  • Rollback Patch.
In this post it will show you how to do all the above steps :-
  • Open the Oracle Database Cloud Service console.
  • Click the database deployment on which you want to check patching.
  • Click the Administration tile and then click the Patching tab.
  • If you want to use command line it’s possible as well, you have to connect to the cloud using Putty on windows check the post from here that will tell you how to connect using putty to the cloud, however if the below you will see that the available patch in the picture for my Dbaas, you can check the prerequisites again by press on it. 

If you want to run the same without GUI ( Cloud Console ) you can do the following 

Remember you should configure Putty to be able to access the root on the cloud.
  • Now If you want to apply the patch on the cloud Using the console it’s very easy. 
Enjoy the Cloud 
Thank you 
Osama

Scaling a Database Deployment – Oracle Cloud

If a database deployment on Oracle Database Cloud Service is performing poorly or is running out of storage, you can scale up the environment supporting the database deployment.

follow these steps to scale up/Down your Dbaas :-

  • Open the Oracle Database Cloud Service console.
  • Click the name of the deployment you want to scale.
  • Choose the scaling command:
  • The Scale Up/Down Service overlay is displayed. 
Choose which resource you want to Press Yes.
Thank you
Osama