Tuesday, 5 February 2008

MicroStrategy Narrowcast Tips

Examining the DELog*.txt files in:

C:\Program Files\MicroStrategy\Narrowcast Server\Delivery Engine

is slightly easier than the entire message log. Copy the service id of the Service name you are investigating and search the relevant file in the above folder to trace the events associated with the service.

If there are pre/post SQL scripts, open up the Subscription Set editor, then from the menu
Edit -> Subscription Set properties.

pre/post SQL scripts on the subscription sets can also be used to determine for example if an ETL Completion flag is set so that NC Services can be run.

Friday, 5 October 2007

Creating Oracle Table Varray Data Type Columns

Best explained reference to this with easy examples can be found here:

PART I
http://blogs.ittoolbox.com/database/solutions/archives/working-with-varrays-in-oracle-part-i-9111

PART II

http://blogs.ittoolbox.com/database/solutions/archives/working-with-varrays-in-oracle-part-ii-9229

PART III
http://blogs.ittoolbox.com/database/solutions/archives/working-with-varrays-in-oracle-part-iii-9349

I tried creating an attribute in MicroStrategy which uses this column as its Form but it seems MicroStrategy does not support this data type. Even Freeform Sql failed to generate the sql.

Wednesday, 29 August 2007

Installing a Loopback Adapter on Windows 2000

Dynamic Host Configuration Protocol (DHCP) assigns dynamic IP addresses on a network. Dynamic addressing allows a computer to have a different IP address each time it connects to the network. In some cases, the IP address can change while the computer is still connected.

You can have a mixture of static and dynamic IP addressing in a DHCP system. In a DHCP setup, the software tracks IP addresses, which simplifies network administration. This lets you add a new computer to the network without having to manually assign that computer a unique IP address. However, before installing Oracle Database onto a computer that uses the DHCP protocol, you need to install a loopback adapter to assign a local IP address to that computer.

Loopback adapter approach is recommended particularly for laptops (presumably used only for learning purposes!) which connect and disconnect from the real, corporate network. The loopback adapter means that Oracle will function regardless of whether the laptop is connected to the network or not. It gives Oracle a static, always-there, point of reference independent of what shenannigans the real NIC gets up to.

For instructions regarding the Loopback Adapter on Windows 2000 see the instructions from 2.4.5.3 onwards:

http://download-west.oracle.com/docs/html/B10130_02/reqs.htm#BABDJJFF

Friday, 24 August 2007

Transparent Data Encryption (TDE)

You can find all the basic stuff about Transparent Data Encryption here:
http://www.oracle.com/technology/oramag/oracle/05-sep/o55security.html

and here:
http://www.oracle.com/technology/oramag/oracle/05-jan/o15security.html

We needed to issue the statement in MicroStrategy before running the report:
alter system set encryption wallet open authenticated by "password"; so that the encrypted columns would be displayed in the report.

" around password are double quotes.

However if the statement is issued like this then by selecting the Sql view for the report in MicroStrategy, one can easily see the password and so we needed to hide it inside a procedure.

I couldnt find any examples of using the alter statement in a procedure and this failed when executed:

create or replace procedure open_my_wallet is
begin
execute immediate 'alter system set encryption wallet open authenticated by "password"'; end;

with privilege errors.

The reason is that the alter system privilege was given through a role and needs to be granted directly. Alternatively by doing it this way, the privileges are granted directly

--
create or replace procedure open_wallet authid current_user
is
begin
execute immediate 'alter system set encryption wallet open authenticated by "password"';
end open_wallet;
/
--

When a procedure is defined as authid current_user (invoker rights), than all privileges available with granted roles will be available to the procedure

Friday, 22 June 2007

Returning clause with insert does not work!

On the web there is a lot of material about the new 10g feature returning clause with examples.
However it looks like those who have published these examples have not tested the code and just typed it out.
See : http://orafaq.com/node/34

Returning clause works fine with Update and Delete.

Ex:

declare
tot_count number;
begin
delete from pn_1
RETURNING count(a1) INTO tot_count;

dbms_output.put_line(tot_count);
end;

However with insert

table pn_1 is created with two columns s1 varchar2(30), a2 number

declare
tot_count number;
begin

insert into pn_1
select table_name,1
from user_tables
RETURNING count(a1) INTO tot_count;

dbms_output.put_line(tot_count);
end;


it gives syntax error
ORA-06550: line 5, column 16:
PL/SQL: ORA-00933: SQL command not properly ended

See Metalink Note:302910.1

So still the best way to note how many records have been inserted :


declare

begin
insert into pn_1
select table_name,1 b
from user_tables;
--RETURNING sum(b) INTO tot_count;
dbms_output.put_line(sql%rowcount);
exception
when others then
dbms_output.put_line(sqlerrm);
end;

Thursday, 21 June 2007

How to Check ORACLE_HOME from the Database

First Method:

select NVL(substr(file_spec, 1, instr(file_spec, '\', -1, 2) -1) , substr(file_spec, 1, instr(file_spec, '/', -1, 2) -1)) folder
from
dba_libraries
where
library_name = 'DBMS_SUMADV_LIB'


2nd Method (Requires priv to run sys.dbms_system) :

DECLARE

folder VARCHAR2(100);

BEGIN

sys.dbms_system.get_env('ORACLE_HOME', folder);
dbms_output.put_line(
folder);

END;


Archivelog Mode

Just a note of all the things I forget about Archivelog mode

The easiest way to find out if a database is running in archivelog mode:

SQL> select log_mode from v$database;

LOG_MODE
------------
NOARCHIVELOG

And for more reference:

Archive log related stuff