How to Install LLVM & Clang on Oracle Linux

1) Install CMake.

2) Install G++.

3) Install Subversion.

4) Checkout the LLVM & Clang projects:

svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
svn co http://llvm.org/svn/llvm-project/cfe/trunk llvm/tools/clang

5) Configure, build and install them:

cmake . llvm
cmake --build .
cmake --build . --target install

You can find more details here.

How to Run the Oracle Database In-Memory Advisor

Source Database

1) Start SQL*Plus.

2) Create a temporary directory:

CREATE DIRECTORY IM_ADVISORDIR AS '/tmp';

3) Run the AWR extraction script:

@?/rdbms/admin/awrextr

4) Enter the DBID in the “Enter value for dbid:” prompt.

5) Enter the number of days in the “Enter value for num_days:” prompt.

6) Enter the AWR snapshots IDs in the “Enter value for begin_snap:” and “Enter value for “end_snap:” prompts.

7) Enter “IM_ADVISORDIR” in the “Enter value for directory_name:” prompt.

8) Press the Enter key in the “Enter value for the file_name:” prompt.

9) Run the AWR augment export script:

@imadvisor_awr_augment_export

10) Press the Enter key in the “Enter value for sqlset_owner:” and “Enter value for sqlset_name:” prompts.

11) Enter “IM_ADVISORDIR” in the “Please enter the Oracle directory object to use for export (default=DATA_PUMPDIR)?” prompt.

12) Press the Enter key in the “Please press <return> to use this name prefix; otherwise, enter an alternative name prefix?” prompt.

13) Copy the generated files to the /tmp folder of the target host.

14) Optionally, remove the temporary directory:

DROP DIRECTORY IM_ADVISORDIR;

Target Database

1) Start SQL*Plus.

2) Run the advisor installation script:

@instimadv

3) Press the Enter key in the “Enter value for permanent_tablespace:” and “Enter value for temporary_tablespace:” prompts.

4) Create a temporary directory:

CREATE DIRECTORY IM_ADVISORDIR AS '/tmp';

5) Run the AWR load script:

@?/rdbms/admin/awrload

6) Enter “IM_ADVISORDIR” in the “Enter value for directory_name:” prompt.

7) Enter the dump file name in the “Enter value for file_name:”.

8) Press the Enter key in the “Enter value for schema_name:”, “Enter value for default_tablespace:” and “Enter value for temporary_tablespace:” prompts.

9) Run the AWR augment import script:

@imadvisor_awr_augment_import

10) Enter “IM_ADVISORDIR” in the “Please enter the Oracle directory object to use for import (default=DATA_PUMPDIR)?” prompt.

11) Press the Enter key in the “The default IM Advisor AWR augment dump file name prefix is imadvisor_awr_augment. Please press to use this name prefix; otherwise, please enter an alternative name prefix?” prompt.

12) Run the advisor:

@imadvisor_recommendations

13) Press the Enter key in the “Enter value for task_name:” prompt.

14) Enter “YES” in the “Enter value for run_against_augmented_awr:” prompt.

15) Enter the DBID of the source database in the “Enter value for dbid:” prompt.

16) Press the Enter key in the “Enter value for inmemory_size:”, “Enter value for begin_time:” and “Enter value for duration:” prompts.

17) Optionally, remove the temporary directory:

DROP DIRECTORY IM_ADVISORDIR;

18) Optionally, uninstall the advisor:

@catnoimadv

Refer to Doc ID 1965343.1 for more information.

How to Receive a Notification from the IBM Message Hub with Java

MessageHubSample.java

import static java.lang.System.out;

import java.util.Arrays;
import java.util.Properties;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;

public final class MessageHubSample {

  public static void main(final String[] args) {
    final Properties props = new Properties();

    props.put("bootstrap.servers", "host:9093");

    props.put("enable.auto.commit", "true");

    props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");

    props.put("security.protocol", "SASL_SSL");

    props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");

    final KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props);

    consumer.subscribe(Arrays.asList("SampleTopic"));

    while (true) {
      final ConsumerRecords<String, String> records = consumer.poll(1000);

      for (final ConsumerRecord<String, String> record : records)
        out.println(record.value());

    }

  }

}

jaas.conf

KafkaClient {
  com.ibm.messagehub.login.MessageHubLoginModule required
  serviceName="kafka"
  username="username"
  password="password";
};

How to Send a Notification to the IBM Message Hub with Java

MessageHubSample.java

import java.util.Properties;

import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;

public final class MessageHubSample {

  public static void main(final String[] args) {
    final Properties props = new Properties();

    props.put("bootstrap.servers", "host:9093");

    props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");

    props.put("security.protocol", "SASL_SSL");

    props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");

    final Producer<String, String> producer = new KafkaProducer<>(props);

    producer.send(new ProducerRecord<String, String>("SampleTopic", "Sample Message"));

    producer.close();
  }

}

jaas.conf

KafkaClient {
  com.ibm.messagehub.login.MessageHubLoginModule required
  serviceName="kafka"
  username="username"
  password="password";
};

How to Receive a Notification from IBM MQ Light with Java

import static com.ibm.mqlight.api.Delivery.Type.STRING;
import static java.lang.System.out;

import com.ibm.mqlight.api.ClientOptions;
import com.ibm.mqlight.api.Delivery;
import com.ibm.mqlight.api.DestinationAdapter;
import com.ibm.mqlight.api.NonBlockingClient;
import com.ibm.mqlight.api.NonBlockingClientAdapter;
import com.ibm.mqlight.api.StringDelivery;

public final class MqLightSample {

  public static void main(final String[] args) {
    NonBlockingClient.create("amqp://host:1912", ClientOptions.builder().setCredentials("username", "password").build(), new NonBlockingClientAdapter<Void>() {

        public void onStarted(final NonBlockingClient client, final Void context) {
          client.subscribe("SampleTopic", new DestinationAdapter<Void>() {

              public void onMessage(final NonBlockingClient client, final Void context, final Delivery delivery) {

                if (delivery.getType() == STRING)
                  out.println(((StringDelivery) delivery).getData());

              }

            }, null, null);
        }

      }, null);
  }

}

How to Send a Notification to IBM MQ Light with Java

import com.ibm.mqlight.api.ClientOptions;
import com.ibm.mqlight.api.NonBlockingClient;
import com.ibm.mqlight.api.NonBlockingClientAdapter;

public final class MqLightSample2 {

  public static void main(final String[] args) {
    NonBlockingClient.create("amqp://host:1912", ClientOptions.builder().setCredentials("username", "password").build(), new NonBlockingClientAdapter<Void>() {

        public void onStarted(final NonBlockingClient client, final Void context) {
          client.send("SampleTopic", "Sample Message", null);
        }

      }, null);
  }

}