Announcements

Oracle training based on real-time expertise as per industry standards. Upcoming batch details are here.

View batch schedule

Free Oracle mock interview. Register using the link.

Register

#DBAchallenge: submit your questions.

Ask questions
Swipe for more →
Browse by Topic
Latest Posts
    Showing posts with label Cloud. Show all posts
    Showing posts with label Cloud. Show all posts

    Wednesday, July 14, 2021

    terraform plugin download for cloud providers || AWS - GCP - Kubernetes - vSphere - Openstack

    terraform initialization to download plugin for cloud providers || AWS - GCP - Kubernetes - vSphere - Openstack


    Sample Initializing terraform script and downloading the plugins with providing the credentials:

    AWS:

    ====
    aws_main.tf
    provider "aws" {
    }

    vSphere:

    ========
    vsphere_main.tf
    provider "vsphere" {
    }

    GCP:

    ====
    google_main.tf
    provider "google" {
    }

    Kubernetes:

    ===========
    kubernetes_main.tf
    provider "kubernetes" {
    }

    Openstack:

    ==========
    openstack_main.tf
    provider "openstack" {
    }


    Output:

    =======

    AWS:

    [root@oraclemv AWS]# cat main.tf
    provider "aws" {
    }
    [root@oraclemv AWS]# 

    [root@oraclemv AWS]# ls -ltrha
    total 4.0K
    -rw-r--r--. 1 root root 21 Jul 14 14:47 main.tf
    drwxr-xr-x. 7 root root 78 Jul 14 14:50 ..
    drwxr-xr-x. 2 root root 21 Jul 14 14:50 .
    [root@oraclemv AWS]#

    [root@oraclemv AWS]# terraform init

    Initializing the backend...

    Initializing provider plugins...
    - Finding latest version of hashicorp/aws...
    - Installing hashicorp/aws v3.49.0...
    - Installed hashicorp/aws v3.49.0 (signed by HashiCorp)

    Terraform has created a lock file .terraform.lock.hcl to record the provider
    selections it made above. Include this file in your version control repository
    so that Terraform can guarantee to make the same selections by default when
    you run "terraform init" in the future.

    Terraform has been successfully initialized!

    You may now begin working with Terraform. Try running "terraform plan" to see
    any changes that are required for your infrastructure. All Terraform commands
    should now work.

    If you ever set or change modules or backend configuration for Terraform,
    rerun this command to reinitialize your working directory. If you forget, other
    commands will detect it and remind you to do so if necessary.
    [root@oraclemv AWS]#

    [root@oraclemv AWS]# ls -ltra
    total 8
    -rw-r--r--. 1 root root   21 Jul 14 14:47 main.tf
    drwxr-xr-x. 7 root root   78 Jul 14 14:50 ..
    drwxr-xr-x. 3 root root   23 Jul 14 15:07 .terraform
    -rw-r--r--. 1 root root 1077 Jul 14 15:07 .terraform.lock.hcl
    drwxr-xr-x. 3 root root   66 Jul 14 15:07 .
    [root@oraclemv AWS]# 

    [root@oraclemv AWS]# cd .terraform/providers/registry.terraform.io/hashicorp/aws/3.49.0/linux_amd64/
    [root@oraclemv linux_amd64]# ll
    total 181720
    -rwxr-xr-x. 1 root root 186081280 Jul 14 15:07 terraform-provider-aws_v3.49.0_x5
    [root@oraclemv linux_amd64]#

    vSphere:

    [root@oraclemv vSpeher]# cat main.tf
    provider "vsphere" {
    }
    [root@oraclemv vSpeher]#

    [root@oraclemv vSpeher]# ls -ltra
    total 8
    drwxr-xr-x. 7 root root   78 Jul 14 14:50 ..
    -rw-r--r--. 1 root root   24 Jul 14 14:50 main.tf
    drwxr-xr-x. 3 root root   66 Jul 14 15:12 .
    [root@oraclemv vSpeher]#

    [root@oraclemv vSpeher]# terraform init

    Initializing the backend...

    Initializing provider plugins...
    - Finding latest version of hashicorp/vsphere...
    - Installing hashicorp/vsphere v2.0.2...
    - Installed hashicorp/vsphere v2.0.2 (signed by HashiCorp)

    Terraform has created a lock file .terraform.lock.hcl to record the provider
    selections it made above. Include this file in your version control repository
    so that Terraform can guarantee to make the same selections by default when
    you run "terraform init" in the future.

    Terraform has been successfully initialized!

    You may now begin working with Terraform. Try running "terraform plan" to see
    any changes that are required for your infrastructure. All Terraform commands
    should now work.

    If you ever set or change modules or backend configuration for Terraform,
    rerun this command to reinitialize your working directory. If you forget, other
    commands will detect it and remind you to do so if necessary.
    [root@oraclemv vSpeher]#

    [root@oraclemv vSpeher]# cd .terraform/providers/registry.terraform.io/hashicorp/vsphere/2.0.2/linux_amd64/
    [root@oraclemv linux_amd64]# ll
    total 32032
    -rwxr-xr-x. 1 root root 32800768 Jul 14 15:12 terraform-provider-vsphere_v2.0.2_x5
    [root@oraclemv linux_amd64]#

    GCP:

    [root@oraclemv GCP]# cat main.tf
    provider "google" {
    }
    [root@oraclemv GCP]#

    [root@oraclemv GCP]# ls -ltra
    total 8
    drwxr-xr-x. 7 root root   78 Jul 14 14:50 ..
    -rw-r--r--. 1 root root   23 Jul 14 14:54 main.tf
    drwxr-xr-x. 3 root root   66 Jul 14 15:10 .
    [root@oraclemv GCP]#

    [root@oraclemv GCP]# terraform init

    Initializing the backend...

    Initializing provider plugins...
    - Finding latest version of hashicorp/google...
    - Installing hashicorp/google v3.75.0...
    - Installed hashicorp/google v3.75.0 (signed by HashiCorp)

    Terraform has created a lock file .terraform.lock.hcl to record the provider
    selections it made above. Include this file in your version control repository
    so that Terraform can guarantee to make the same selections by default when
    you run "terraform init" in the future.

    Terraform has been successfully initialized!

    You may now begin working with Terraform. Try running "terraform plan" to see
    any changes that are required for your infrastructure. All Terraform commands
    should now work.

    If you ever set or change modules or backend configuration for Terraform,
    rerun this command to reinitialize your working directory. If you forget, other
    commands will detect it and remind you to do so if necessary.
    [root@oraclemv GCP]# 

    [root@oraclemv GCP]# cd .terraform/providers/registry.terraform.io/hashicorp/google/3.75.0/linux_amd64/
    [root@oraclemv linux_amd64]# ll
    total 62760
    -rwxr-xr-x. 1 root root 64266240 Jul 14 15:10 terraform-provider-google_v3.75.0_x5
    [root@oraclemv linux_amd64]#

    Kubernetes:

    [root@oraclemv Kubernetes]# cat main.tf
    provider "kubernetes" {
    }
    [root@oraclemv Kubernetes]#

    [root@oraclemv Kubernetes]# ls -ltrah
    total 8.0K
    drwxr-xr-x. 7 root root   78 Jul 14 14:50 ..
    -rw-r--r--. 1 root root   27 Jul 14 14:59 main.tf
    drwxr-xr-x. 3 root root   66 Jul 14 15:11 .
    [root@oraclemv Kubernetes]#

    [root@oraclemv Kubernetes]# terraform init

    Initializing the backend...

    Initializing provider plugins...
    - Finding latest version of hashicorp/kubernetes...
    - Installing hashicorp/kubernetes v2.3.2...
    - Installed hashicorp/kubernetes v2.3.2 (signed by HashiCorp)

    Terraform has created a lock file .terraform.lock.hcl to record the provider
    selections it made above. Include this file in your version control repository
    so that Terraform can guarantee to make the same selections by default when
    you run "terraform init" in the future.

    Terraform has been successfully initialized!

    You may now begin working with Terraform. Try running "terraform plan" to see
    any changes that are required for your infrastructure. All Terraform commands
    should now work.

    If you ever set or change modules or backend configuration for Terraform,
    rerun this command to reinitialize your working directory. If you forget, other
    commands will detect it and remind you to do so if necessary.
    [root@oraclemv Kubernetes]#

    [root@oraclemv Kubernetes]# cd .terraform/providers/registry.terraform.io/hashicorp/kubernetes/2.3.2/linux_amd64/
    [root@oraclemv linux_amd64]# ll
    total 47408
    -rwxr-xr-x. 1 root root 48545792 Jul 14 15:11 terraform-provider-kubernetes_v2.3.2_x5
    [root@oraclemv linux_amd64]#

    Openstack:

    [root@oraclemv Openstack]# cat main.tf
    provider "openstack" {
    }
    [root@oraclemv Openstack]#

    [root@oraclemv Openstack]# ls -ltrah
    total 4.0K
    drwxr-xr-x. 7 root root 78 Jul 14 14:50 ..
    -rw-r--r--. 1 root root 26 Jul 14 14:52 main.tf
    drwxr-xr-x. 2 root root 21 Jul 14 14:52 .
    [root@oraclemv Openstack]#

    [root@oraclemv Openstack]# terraform init

    Initializing the backend...

    Initializing provider plugins...
    - Finding latest version of hashicorp/openstack...
    ╷
    │ Error: Failed to query available provider packages
    │
    │ Could not retrieve the list of available versions for provider hashicorp/openstack: could not connect to registry.terraform.io: Failed to request
    │ discovery document: Get "https://registry.terraform.io/.well-known/terraform.json": net/http: request canceled while waiting for connection
    │ (Client.Timeout exceeded while awaiting headers)
    ╵
    [root@oraclemv Openstack]#

    Regards,
    Mallik

    Friday, June 25, 2021

    What is infrastructure? and What is infrastructure as code (IAC)?

    What is infrastructure?
    What is infrastructure as code (IAC)?
    What are IAC software/tools?


    Infrastructure?

    >>> Framework (Resource to Run Application or Software)
    >>> Its might be Physical or Virtual to support workflow or to support your Application

    Workflow Means

    >>> Storing & Processing & Analysis of data (Business Data / End user data)

    Infrastructure Components:
    (Servers, Network, Storage, Database, Load Balancer, DNS many more)

    Infrastructure Types:

    PROD Environment
    DR Environment
    UAT Environment
    TEST Environment
    DEV/SIT Environment

    SDLC (Software Development Life Cycle):

    DEV/SIT --- TEST --- UAT --- PROD / DR

    Most common requirement for Infrastructure is?

    Scale Up and Scale Down your Infrastructure
    >>> In case if your business increases then you need to scale up your Infrastructure.
    >>> In case if your business is down then you need to scale down your Infrastructure.

    To Do All these Tasks we use IAC – Infrastructure as code

    >>> Provisioning infrastructure using script/tools instead of manually configuring.
    >>> Automating the provisioning of infrastructure or Infrastructure Components.

    Provisioning

                - Creating
                - Updating (Increase / Decrease)
                - Deleting

    IAC – Infrastructure as code

    >>> Writing code that talks to your infrastructure and work with your infrastructure.

    What are the advantages of using IAC?

    >>> Create a new infrastructure with script (No need to login to console every time and create new infrastructure)
    >>> Update your Infrastructure (Increase / Decrease).
    >>> Delete Infrastructure
    >>> Version history of your applications or servers or any infrastructure.

    Tools:

    Terraform
    AWS Cloud Formation
    Azure Resource Manager
    Google Cloud Deployment Manager etc…

     
    Other Cloud Vendors
    (VMware, Opestack, Kubernetes)

    Regards,
    Mallik

    Tuesday, April 28, 2020

    Apache Tomcat Installation in Windows Server

    Apache Tomcat Installation in Windows Server

    For more details please refer the below document for more details



    >>> First You may go to http://tomcat.apache.org website.

    >>> Click on Tomcat 8.0 link in Download section on the left the website.

    >>> Choose zip in Cores section. When your file is downloading, copy it into any path. I copy it into D disc.

    >>> Unzip it and change name for tomcat8. It will be shorter name.

    If you want to work in tomcat server you must install java jdk environment. After installation java set JAVA_HOME and JRE_HOME path.

    In Variable Name field write JAVA_HOME and in Variable Value write your. JDK installed directory.

    1) Create Tomcat directory under C:\ and unzip apache-tomcat-8.5.47-windows-x64.ZIP





    Start and Stop Apache_Tomcat:
    >>> Open the command prompt:




    Go to Apache tomcat bin directory in cmd prompt C:\Tomcat\apache-tomcat-8.5.47-windows-x64\apache-tomcat-8.5.47\bin



    Start Apache tomcat by running startup.bat from command prompt and Apache server will launch on new windows and keep this window alive & don’t close it. If you close it and Apache server will goes down.





    Browse to the URL http://localhost:8080 to access the Tomcat server.




    Regards,
    Mallik

    Sunday, March 15, 2020

    What is ACL? and How to configure ACL?


    What is ACL?

    Access Control List (ACL) is a security mechanism introduced in Oracle 11g. Its security level setup on users and roles to access data and what is the level of data access.

    In ACL:          users or roles are called principals
            operations are called privileges

    An ACL consists of a list of ACE (Access Control Entries) An ACE grants or denies a privilege to a principal. An ACL is in XML file format and each ACE is an XML element. The file is created in the /sys/acls directory by default.

    For more details on ACL Please refer MOS document: Access Control Lists and Security Classes.

    How to set up ACL for UTL_HTTP?

    Step 1. Create a new ACL (if required) or use an existing ACL to grant "connect" privilege to the user that needs to run UTL_HTTP.

    Step 2. Assign the ACL created in Step1 to the network host to be accessed using UTL_HTTP.

    ACL Script:

    begin
    -- Step 1. Create a new ACL utl_http.xml.
    -- Grant privilege 'connect' to user 'HR'
    -- using the ACL

      dbms_network_acl_admin.create_acl (
        acl         => 'utl_http.xml',
        description => 'HTTP Access',
        principal   => 'HR',
        is_grant    => TRUE,
        privilege   => 'connect'
      );

    -- Step 2. Assign the ACL created in Step 1
    -- to the network host for the web service
      dbms_network_acl_admin.assign_acl (
        acl        => 'utl_http.xml',
        host       => '*.webservice.com'
      );
      commit;
    end;
    /

    Note: Using ‘*’ in the host name gives access to any sub-domain on the host. If you want to restrict to specific sub-domains only, put the exact name in the host instead of ‘*’.
      
    Multiple hosts can be assigned to one ACL '192.168.1.100' & '192.168.1.*’

    BEGIN
      DBMS_NETWORK_ACL_ADMIN.assign_acl (
        acl         => 'utl_http.xml',
        host        => '192.168.1.100',
        lower_port  => 80,
        upper_port  => NULL);

      DBMS_NETWORK_ACL_ADMIN.assign_acl (
        acl         => 'utl_http.xml',
        host        => '192.168.1.*',
        lower_port  => NULL,
        upper_port  => NULL);

      COMMIT;
    END;
    /

    After setting up ACL as sys users in database, connect with HR and run the PL/SQL script which uses web service.

    Test ACL:
    Testing can be performed with any PL SQL procedure witch calls UTL_HTTPS

    DECLARE
      l_url            VARCHAR2(50) := 'http://192.168.1.100:80';
      l_http_request   UTL_HTTP.req;
      l_http_response  UTL_HTTP.resp;
    BEGIN
      -- Make a HTTP request and get the response.
      l_http_request  := UTL_HTTP.begin_request(l_url);
      l_http_response := UTL_HTTP.get_response(l_http_request);
      UTL_HTTP.end_response(l_http_response);
    END;
    /

    Verification View:

    As SYS User:

    COLUMN host FORMAT A30
    COLUMN acl FORMAT A30
    SELECT host, lower_port, upper_port, acl FROM   dba_network_acls;

     COLUMN acl FORMAT A30
    COLUMN principal FORMAT A30
    SELECT acl, principal, privilege, is_grant, TO_CHAR(start_date, 'DD-MON-YYYY') AS start_date, TO_CHAR(end_date, 'DD-MON-YYYY') AS end_date FROM dba_network_acl_privileges;

    With HR User:

    COLUMN host FORMAT A30
    SELECT host, lower_port, upper_port, privilege, status
    FROM   user_network_acl_privileges;

    As SYS user:

    SELECT DECODE(DBMS_NETWORK_ACL_ADMIN.check_privilege('test_acl_file.xml', 'TEST1', 'connect'), 1, 'GRANTED', 0, 'DENIED', NULL) privilege FROM dual;

    COLUMN acl FORMAT A30
    COLUMN host FORMAT A30
    SELECT acl, host, DECODE(DBMS_NETWORK_ACL_ADMIN.check_privilege_aclid(aclid, 'TEST2', 'connect'), 1, 'GRANTED', 0, 'DENIED', NULL) privilege FROM   dba_network_acls;

    SELECT * FROM TABLE(DBMS_NETWORK_ACL_UTILITY.domains('hostname.localdomain'));

    SELECT * FROM TABLE(DBMS_NETWORK_ACL_UTILITY.domains('192.168.1.100'));

    SELECT DBMS_NETWORK_ACL_UTILITY.domain_level('hostname.localdomain')
    FROM   dual;

    SELECT DBMS_NETWORK_ACL_UTILITY.domain_level('192.168.1.100') FROM dual;

    SELECT host, lower_port, upper_port, acl, DECODE(DBMS_NETWORK_ACL_ADMIN.check_privilege_aclid(aclid,  'TEST1', 'connect'), 1, 'GRANTED', 0, 'DENIED', null) PRIVILEGE FROM dba_network_acls
    WHERE  host IN (SELECT * FROM TABLE(DBMS_NETWORK_ACL_UTILITY.domains('10.1.10.191'))) ORDER BY DBMS_NETWORK_ACL_UTILITY.domain_level(host) desc, lower_port, upper_port;


    Regards,
    Mallik

    🌟 Proud to be an Oracle ACE Pro! 🚀

    🌟 Proud to be an Oracle ACE Pro! 🚀 I’m excited to share my official Oracle ACE Profile with the Oracle community. 👨‍💻 Mallikarjun ...