Category Archives: Technology

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.

Advertisements

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) Restart SQL*Plus.

5) Create a temporary directory:

CREATE DIRECTORY IM_ADVISORDIR AS '/tmp';

6) Run the AWR load script:

@?/rdbms/admin/awrload

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

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

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

10) Run the AWR augment import script:

@imadvisor_awr_augment_import

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

12) 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.

13) Run the advisor:

@imadvisor_recommendations

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

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

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

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

18) Optionally, remove the temporary directory:

DROP DIRECTORY IM_ADVISORDIR;

19) Optionally, uninstall the advisor:

@catnoimadv

Refer to Doc ID 1965343.1 for more information.

How to Convert an Oracle Linux Guest VM from HVM to PVM in Oracle VM

1) Connect to the guest VM.

2) Create a new initial ramdisk image with the PV drivers:

dracut --add-drivers "xen-blkfront xen-netfront" -f /boot/initramfs-$(uname -r).img $(uname -r)

3) Edit the /boot/grub/grub.conf file to boot the PV kernel by default:

default=<PV Kernel Entry Number>

4) Open the Oracle VM Manager console.

5) Switch to the “Servers and VMs” tab.

6) Select the server pool, server and guest VM.

7) Click on the “Edit” button.

8) Select the “Xen PVM” domain type.

9) Restart the guest VM.

How to Setup the Node Manager to Start an Instance in Oracle HTTP Server

1) Start the Node Manager.

2) Start the Scripting Tool.

3) Connect to the Node Manager:

nmConnect(username='username', password='password', domainName='sample_domain')

4) Start the instance with the Node Manager:

nmStart(serverName='SampleInstance',serverType='OHS')

5) Exit the Scripting Tool:

exit()

6) Change the value of the CrashRecoveryEnabled property in the $ORACLE_HOME/user_projects/domains/sample_domain/nodemanager/nodemanager.properties file to true.

You can find more details here.

How to Estimate HCC Ratio in Oracle Database

1) Start SQL*Plus.

2) Create a temporary tablespace:

CREATE TEMPORARY TABLESPACE SAMPLETBS;

3) Run the following script:

SET SERVEROUTPUT ON;

DECLARE
  blkcnt_cmp PLS_INTEGER;
  blkcnt_uncmp PLS_INTEGER;
  row_cmp PLS_INTEGER;
  row_uncmp PLS_INTEGER;
  cmp_ratio NUMBER;
  comptype_str VARCHAR2(32767);

BEGIN
  DBMS_COMPRESSION.GET_COMPRESSION_RATIO('SAMPLETBS', 'USER', 'SAMPLETB', NULL, DBMS_COMPRESSION.COMP_FOR_QUERY_HIGH, blkcnt_cmp, blkcnt_uncmp, row_cmp, row_uncmp, cmp_ratio, comptype_str);

  DBMS_OUTPUT.PUT_LINE('Estimated HCC ratio = ' || cmp_ratio);

END;
/

4) Exit SQL*Plus.

Refer to section 36 of the Oracle Database PL/SQL Packages and Types Reference manual for more information.

How to Rename a Database in Oracle Database

1) Start SQL*Plus.

2) Close the database:

ALTER DATABASE CLOSE;

3) Change the database name:

host nid TARGET=/ DBNAME=SAMPLE SETNAME=YES;

4) Re-create the PFILE from the SPFILE:

CREATE PFILE FROM SPFILE;

5) Change the DB_NAME parameter in the PFILE.

6) Create a new SPFILE from the PFILE:

CREATE SPFILE FROM PFILE;

7) Create a new password file:

host orapwd FILE=$ORACLE_HOME/dbs/orapwSAMPLE;

8) Open the database:

ALTER DATABASE SAMPLE OPEN READ WRITE;

9) Exit SQL*Plus.

Refer to section 19 of the Oracle Database Utilities manual for more information.