Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Code sample for dax_extract() function

kayhandApr 12 2016 — edited Aug 4 2016

Hi all,

I wanted to share a simple code sample for the dax_extract() function in the DAX API.

I didn't have the facility for creating an OZIP compressed stream, so for this example I tried to create it by hand by assigning specific values to specific byte addresses (see create_ozip() function below).

Seems like first 16 bytes of an OZIP compressed stream consists of some signature values, after that actual values about compressed data starts.

Starting from index 17, it keeps the number of values in the dictionary, the widths of the dictionary symbols, then real symbol values and number of code words in the data. Finally, the end of the stream consists of the actual compressed data.

In this example, I used a really simple data set which has only 4 distinct values (8 elements in total), thus OZIP needs 2-bit compression. dax_extract() function takes the OZIP compressed stream as input and the program prints out the uncompressed values.

I also have a question related with the dax_scan() operation :

-- Can we do predicate checking directly on ozip compressed data or we always need to feed it with an uncompressed stream (i.e., the result of the dax_extract() function) ?

Best,

Kayhan

#include "dax.h"

#include "dax_query.h"

#include <stdio.h>

#include <stdlib.h>

#include <unistd.h>

/*

Creates a sample OZIP compressed stream

*/

void create_ozip(int8_t **data_stream){

  int errno;

  printf("Creating a sample OZIP compressed data stream ...\n\n");

  uint8_t byte0 = 0x4f;

  uint8_t byte1 = 0x5a;

  uint8_t byte2 = 0x49;

  uint8_t byte3 = 0x50;

  uint8_t byte4 = 0x00;

  uint8_t byte5 = 0x06;

  uint8_t byte6 = 0x00;

  *data_stream = (int8_t *) memalign(64, sizeof(uint8_t));

  (*data_stream)[0] = byte0;

  (*data_stream)[1] = byte1;

  (*data_stream)[2] = byte2;

  (*data_stream)[3] = byte3;

  (*data_stream)[4] = byte4;

  (*data_stream)[5] = byte5;

  (*data_stream)[6] = byte6;

  size_t i;

  for(i = 7; i < 16; i++){

    (*data_stream)[i] = byte6;

  }

  /* Number of symbols in the dictionary (4) */

  (*data_stream)[i++] = 0x00;

  (*data_stream)[i++] = 0x04;

  //Symbol widths

  //Ford : 4 , VW : 2

  (*data_stream)[i++] = 0x42;

  //BMW : 3 , Mercedes : 8

  (*data_stream)[i++] = 0x38;

  // Fill Symbol data//

 

  //Ford

  (*data_stream)[i++] = 0x46;

  (*data_stream)[i++] = 0x6f;

  (*data_stream)[i++] = 0x72;

  (*data_stream)[i++] = 0x64;

    //VW

  (*data_stream)[i++] = 0x56;

  (*data_stream)[i++] = 0x57;

    //BMW

  (*data_stream)[i++] = 0x42;

  (*data_stream)[i++] = 0x4d;

  (*data_stream)[i++] = 0x57;

    //Mercedes

  (*data_stream)[i++] = 0x4d;

  (*data_stream)[i++] = 0x65;

  (*data_stream)[i++] = 0x72;

  (*data_stream)[i++] = 0x63;

  (*data_stream)[i++] = 0x65;

  (*data_stream)[i++] = 0x64;

  (*data_stream)[i++] = 0x65;

  (*data_stream)[i++] = 0x73;

  //Number of code words(or values in data)  (8)

  (*data_stream)[i++] = 0x00;

  (*data_stream)[i++] = 0x00;

  (*data_stream)[i++] = 0x00;

  (*data_stream)[i++] = 0x08;

   //Compressed data

   //0001 0101

  (*data_stream)[i++] = 0x15;

  //0010 1110

  (*data_stream)[i++] = 0x2e;

}

int main(int argc, char * argv[])

{

  /*Create OZIP stream*/

  int8_t *compressed_stream;

  create_ozip(&compressed_stream);

  dax_query_api_1_0_t *my_dax_api = (dax_query_api_1_0_t *) dax_query_init(1, 0);

  my_dax_api->dax_query_set_log_level(4);

  dax_enc_ctx_t *src_ctx_comp = (dax_enc_ctx_t *) malloc(sizeof(dax_enc_ctx_t));

  src_ctx_comp->enc_flags = 0x800;

  src_ctx_comp->data_width = 2;

  src_ctx_comp->len_width = 0;

  src_ctx_comp->flag_width = 0;

  dax_vec_t *comp_source = (dax_vec_t *) memalign(64, sizeof(dax_vec_t));

  comp_source->data_stream = (uint8_t *) compressed_stream;

  comp_source->enc_ctx = src_ctx_comp;

  comp_source->nrows = 8;

  dax_vec_t *comp_result = (dax_vec_t *) memalign(64, sizeof(dax_vec_t));

  comp_result->enc_ctx = src_ctx_comp;

  comp_result->data_stream = (uint8_t *) memalign(64, sizeof(uint8_t));

  comp_result->nrows = 8;

  int8_t errno = my_dax_api->dax_extract(comp_result, comp_source);

  printf("%s\n\n", comp_result->data_stream);

  printf("DAX EXTRACT Return Code: %s %d\n\n", dax_strerror(errno), errno);

  free(compressed_stream);

  free(src_ctx_comp);

  free(comp_source);

  free(comp_result->data_stream);

  free(comp_result);

}

This post has been answered by Yoda-Oracle on Apr 25 2016
Jump to Answer

Comments

L. Fernigrini

From what you say, the software installation runs OK (the product) is installed but the DB creation is somehow hanging.

You can try installing again and include the database alert log, it may show any serious error that may occur, or review if any trace file is generated.

AAndrei

Hi,

Thanks for your interest.

I've checked the database alert logs and ORA-00445 pops-up:

alert_xe.log

"

2020-01-23T14:52:29.135087+02:00

Errors in file C:\APP\USER1\PRODUCT\18.0.0\diag\rdbms\xe\xe\trace\xe_mmon_12924.trc  (incident=20555) (PDBNAME=CDB$ROOT):

ORA-00445: background process "M000" did not start after 120 seconds

2020-01-23T14:54:34.237803+02:00

Errors in file C:\APP\USER1\PRODUCT\18.0.0\diag\rdbms\xe\xe\trace\xe_aqpc_11892.trc  (incident=20552) (PDBNAME=CDB$ROOT):

ORA-00445: background process "QM03" did not start after 120 seconds

2020-01-23T14:56:39.326552+02:00

Errors in file C:\APP\USER1\PRODUCT\18.0.0\diag\rdbms\xe\xe\trace\xe_mmon_12924.trc  (incident=20556) (PDBNAME=CDB$ROOT):

ORA-00445: background process "MZ01" did not start after 120 seconds

"

xe_mmon_12924.trc

"

*** 2020-01-23T15:05:08.482150+02:00 (CDB$ROOT(1))

calling location                         entry point                              arg #1           arg #2           arg #3           arg #4         

---------------------------------------- ---------------------------------------- ---------------- ---------------- ---------------- ----------------

00007FFA9337F7E4                         0000000000000000                         0000000000000000 00007ffa93321563 0000000000000000 0000000000000000

00007FFA9331D815                         00007FFA9337F7D0                         0000000000000000 0000000000000000 0000000000000000 0000000000000000

00007FFA933267C7                         00007FFA9331D6B8                         0000000000000000 0000000000000000 0000000000000000 0000000000000000

00007FFA93355765                         00007FFA9332673C                         0000000000000000 0000000000000000 0000000000000000 0000000000000000

00007FFA933556C3                         00007FFA933556DC                         0000000000000000 ffffffff932e0000 0000000000000000 0000000000000000

00007FFA9335566E                         00007FFA93355688                         0000000000000000 0000000000000000 0000000000000000 0000000000000000

---------------- End of Call Stack Trace -----------------

Call stack acquisition performance stats:

  setup time (lock acquis., memory alloc.): 0 ms

  frame get time (time the target proc was suspended): 0 ms

  symbol translation time: 0 ms

  total time: 0 ms

DDE: Problem Key 'ORA 445' was flood controlled (0x4) (incident: 20558)

ORA-00445: background process "MZ01" did not start after 120 seconds

"

xe_aqpc_11892.trc

"

*** 2020-01-23T15:03:00.229499+02:00

DDE: Problem Key 'ORA 445' was flood controlled (0x4) (incident: 20562)

ORA-00445: background process "QM03" did not start after 120 seconds

"

I don't know what i need to do next, so if anything comes in mind, please share

I've checked this thread https://community.oracle.com/thread/4206522, but it isn't my case.

All the best,

Andrei

Billy Verreynne

There are support notes on this error:

  • Master Note: Troubleshooting Oracle Background Processes (Doc ID 1509616.1)
  • Troubleshooting Guide (TSG) - Ksvcreate: Process(xxxx) Creation Failed / ORA-00445: Background Process "xxxx" Did Not Start After n Seconds (Doc ID 1379200.1)

If you are technically inclined, troubleshoot by setting trace 10281 via custom pfile and do a manual db start.

If you are logically inclined, change from Windows to Linux. Exchange dirty and convoluted complexity for the elegance of simplicity.

Christian.Shay -Oracle

Please disable anti-virus and try again.

I think you said you have seen this list of common issues, but just to be sure:

1) Is ORACLE_HOME or TNS_ADMIN set in the environment? Go to a command prompt, type "set". You will need to temporarily unset any such environment variables.

2) Are you using Windows 10 Home Edition? It is not supported and the installer is not properly checking for it in the Prerequisite check.

3) Are you using Server 2019? Same issue.

4) On your network adapter that you are using, check (enable) "Client for Microsoft Networks" and "File and Printer Sharing for Microsoft Networks".

5) Check to make sure Netbios is enabled on your network connection:

See this link for more info:

http://ecross.mvps.org/howto/enable-netbios-over-tcp-ip-with-windows.htm

6) In some cases, antivirus has interfered with an installation.  Try installing without AV.

7) Try creating a local user and adding to local administrator group and then log in and install as that user.

user2685436

Hi all

I tried to install express 18c on Win 10 HOME and Win10 PRO and it was hanging at about 90-95% progress also.

The way I did to bypass this issue, working as well as for Win 10 Home as for Pro : all is about administrator account !

What I did :

     log to win 10 using the usual account and run cmd.exe (as administrator) and issue : net user administrator /active:yes

     log to win 10 with the real administrator account and run the 18xe setup.exe (no need to run as administrator). Then the install achieved well. Give full access to folder (and all sub-folders and sub-files)18xe was installed in to the win 10 usual account

    log to win 10 using the usual account and run cmd.exe (as administrator) and issue : net user administrator /active:no

Then I was able to use the 18xe from my usual account ...

I hope this will help someones

User_PIBOU

After 6hours on this stupid pile of wet leaves where i tried 21c xe which would constantly give only errors and 18c xe which would be stuck forever and tried every other thing i could find this finally worked for me. Thank you.

With XE 21c what errors were you getting?

User_PIBOU

When I was installing it, it would suddenly do roll back and then that oracle installation completed with errors. In logs and I hope I got right ones is this:
INFO: WindowsSecurityException has occurred
SEVERE: PRCZ-1082 : Failed to add Windows user or Windows group "Me" to Windows group "USERS"
O/S-Error: (OS 1387) A member could not be added to or removed from the local group because the member does not exist.

[FATAL] Failed to add ME\Me install user to %2% group.

Thank you, and sorry you hit this.
Could you please zip up and email to me the logs located in the following directories:

  1. [youroraclehome]/cfgtoollogs/oui
  2. C:\Program Files\Oracle\Inventory
    Please email them to me at christian dot shay at oracle dot com
    Thanks!
1 - 9