Monday, March 06, 2017

Samsung M2070 wireless printer installation , even supporting Linux

Excited with my very first new laser printer, started to set it up.

Followed the quick installation guide, insert the CD to ROM, choose wireless, however the stuck at connecting printer, time out after waiting for 10 minutes. intially suspect it is related to default OOTB 1 minute autosleep, adjust to longer time. still the same problem  -- the installation from the CD failed to detect the printer, although I had the USB cable connected. Real bad user experience, I started to regret chose this brand.
\


Thinking not right time to call the hot line at weekend night, while daytime I need to work.  Does it mean I need to take half day to stay at to call service centre and follow the instruction.

Searched to hard copy manual comes with the box, have to read the  guide again and again, finally I paid attention the sentence "use the CDROM and download installer from www.samsung.com/printersetup "  . I started to guess something with the installer from CDROM.

Tried my luck to download the installer online, in few steps, the new installer detect the wireless printer in few seconds.  I had spent new two hours for that buggy installer from CDROM.

What if customer not so techy like me? Isn't that very bad user experience?

Next I tested with mobile app "samsung mobile print" smoothly.


My final challenge is print from my Ubuntu PC, which I never thought when I decided to buy a laser print.

Tried to add a printer from Ubuntu, but failed to find right model.
Googled and find there is Driver for Linux, thanks to Samsung.

http://www.samsungdrivers.net/samsung-m2070-driver/


The filename I downloaded is ULD_v1.00.29.tar.gz.

tar xvfz it


cd uld

sudo  ./install.sh


...

If you have any questions regarding this agreement and other products, please co
ntact SAMSUNG ELECTRONICS.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

**** Do you agree ? [y/n] : y
**** Are you going to use network devices ? If yes, it is recommended to configure your firewall.
**** If you want to configure firewall automatically, enter 'y' or just press 'Enter'. To skip, enter 'n'. : n
**** Registering CUPS backend ...
**** CUPS restart OK.
**** Print driver has been installed successfully.
**** Registering SANE backend ...
**** Restarting udev ...
**** Scan driver has been installed successfully.
**** Install finished.
hmc@hmc-P55A-UD3:~/Downloads/uld$ sudo

Added the printer again , the correct printer model is shown.






Print the Test Page!


Thanks! I shall have no more worry about dry ink when I want to print!


Other References:

http://askubuntu.com/questions/454910/how-can-i-connect-ubuntu-14-04-to-my-wireless-printer-canon-mp620

http://askubuntu.com/questions/170880/how-do-i-install-the-drivers-for-my-samsung-printer



Addendum:

From the http://www.samsungsetup.com/TS/Client/en/Install.html , I even see there is installer for more platforms like Linux, AIX , Solarix, HPUX !  Appreciate this .

Thursday, March 02, 2017

considerations to use logical standby to sync partial schema

Two points to highlight based on 12.2c document shared below.

1. application side to ensure prerequisites of logical standby database can be met.

http://docs.oracle.com/database/122/SBYDB/creating-oracle-data-guard-logical-standby.htm#SBYDB4731

4.1.1 Determine Support for Data Types and Storage Attributes for Tables

4.1.2 Ensure Table Rows in the Primary Database Can Be Uniquely Identified


2. As partial objects  within a schema, it can be achieved by oracle package dbms_logstdby.   For each new object creation after go-live and to be skipped from changing, the procedure should be executed.  Requires well documentation and maintenance effort.

http://docs.oracle.com/database/122/SBYDB/managing-oracle-data-guard-logical-standby-databases.htm#SBYDB4804

11.5.2 Using DBMS_LOGSTDBY.SKIP to Prevent Changes to Specific Schema Objects


Other relevant article

http://www.databasejournal.com/features/oracle/skipping-schema-dml-in-an-oracle-11.2-logical-standby-database.html


Tuesday, February 28, 2017

convert low_value and high_value for date datatype in column's index statistics

1. The dictionary view of dba_tab_col_statistics

https://docs.oracle.com/cd/B28359_01/server.111/b28320/statviews_2089.htm#REFRN20275

Note the low_value and high_value are in RAW(32) format.


2. google and found a few article, but only this works correctly for me. As some of  them giving higher number for low_value than high_value. i.e. the low_value is likely to be year 2169, while high value is year 2017. Guess this is computer using two digits to represent years in YY.

http://oracle-study-notes.blogspot.sg/2008/06/how-to-display-highvaluelowvalue.html


sharing his code here. Thanks Mr. Sun.

1. create a function as follows (copied from a website) 

create or replace function display_raw (rawval raw, type varchar2)  
return varchar2  
is 
   cn     number;  
   cv     varchar2(32);  
   cd     date;  
   cnv    nvarchar2(32);  
   cr     rowid;  
   cc     char(32);  
begin 
   if (type = 'NUMBER') then 
      dbms_stats.convert_raw_value(rawval, cn);  
      return to_char(cn);  
   elsif (type = 'VARCHAR2') then 
      dbms_stats.convert_raw_value(rawval, cv);  
      return to_char(cv);  
   elsif (type = 'DATE') then 
      dbms_stats.convert_raw_value(rawval, cd);  
      return to_char(cd);  
   elsif (type = 'NVARCHAR2') then 
      dbms_stats.convert_raw_value(rawval, cnv);  
      return to_char(cnv);  
   elsif (type = 'ROWID') then 
      dbms_stats.convert_raw_value(rawval, cr);  
      return to_char(cnv);  
   elsif (type = 'CHAR') then 
      dbms_stats.convert_raw_value(rawval, cc);  
      return to_char(cc);  
   else 
      return 'UNKNOWN DATATYPE';  
   end if;  
end;  
/ 








2. Issue the following statement with table name and column name 


col column_name format a20
col low_val format a20
col high_val format a20

select 
   a.column_name,  
   display_raw(a.low_value,b.data_type) as low_val,  
   display_raw(a.high_value,b.data_type) as high_val,  
   a.num_distinct
from 
   dba_tab_col_statistics a, dba_tab_cols b  
where 
      a.table_name='TABLE_NAME'
  and a.table_name=b.table_name
  and a.column_name=b.column_name  
  and  a.owner='MYOWNER'
  and b.owner='MYOWNER'
--  and a.column_name ='COL_NAME'
/ 



Today I had chance to try this article and found it works well too.

 select low_VALUE , high_value from dba_tab_col_statistics where TABLE_NAME='ACCOUNTS' and COLUMN_NAME='DATETIME';

LOW_VALUE                                                        HIGH_VALUE
---------------------------------------------------------------- ----------------------------------------------------------------
77C50718010101                                                   78710C17103A39

set serveroutput on
DECLARE
rv RAW(32) ;
dt DATE;
BEGIN
select LOW_VALUE into rv from dba_tab_col_statistics where TABLE_NAME='ACCOUNTS' and COLUMN_NAME='DATETIME' and owner='TAN';
dbms_stats.convert_raw_value(rv, dt);
dbms_output.put_line( TO_CHAR(dt, 'dd-MON-yyyy hh:mm'));
END;
/


23-OCT-1970 12:10

PL/SQL procedure successfully completed.



following the code in https://mwidlake.wordpress.com/2010/01/03/decoding-high_value-and-low_value/

The low_value decoded are not correct for date columns.


COLUMN_NAME            DATA_TYPE   LOW_V              HI_V
---------------------- ----------  ------------------ ------------------
ID                     NUMBER      6820               877120576
DATETIME               DATE        2096-7-24 0:0:0    2013-12-23 15:57:56
TRANSACTIONDATE        DATE        2096-7-24 0:0:0    2013-12-23 2:37:3

..
36 rows selected.

..
36 rows selected.

Friday, December 30, 2016

RMAN-20020: database incarnation not set

I have one PT env using storage sync for database sync.

Thought need to re-register DB after DB refresh, so unregister and register again.

RMAN> register database;
starting full resync of recovery catalog
full resync complete
database registered in recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03008: error while performing automatic resync of recovery catalog
RMAN-20020: database incarnation not set


However, this is the error.

Disconnected RMAN connection, and attempted to re- register , and finally succeed.

RMAN>   unregister database;



Do you really want to unregister the database (enter YES or NO)? yes
database unregistered from the recovery catalog

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
 full resync complete


Another way to overcome this , is to issue RESET DATABASE command, e.g in http://www.dbaref.com/home/rman/rman-20020databaseincarnationnotset

But I don't want to change DBID explicitly.




One more thought, in fact I don't need to unregister  & register again, as there is no change to DBID.



As such, what I need to do is just configure RMAN setting directly.


CONFIGURE DEFAULT DEVICE TYPE TO disk;
starting full resync of recovery catalog
full resync complete
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> #parallelism 2 for EE only
2> #CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO compressed backupset;
3>
4> #parallelism 1 for SE only
5> CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO compressed backupset;
old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> show all;
RMAN configuration parameters for database with db_unique_name PSCRMP are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/software/oraps/product/11.2.0/dbs/snapcf_PSCRMP.f'; # default

RMAN>
RMAN> #To ensure the control file is backed up by default, type the following at the RMAN prompt:
2> CONFIGURE CONTROLFILE AUTOBACKUP ON;
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN>
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
old RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN>
RMAN> #To change how many backup sets you would like to retain, type the following at the RMAN prompt:
2> CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN>
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO disk;
old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete



In the end, I even get back backupsets before refresh listed in catalog DB in few seconds.


RMAN> list backup summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
10519659 B     U SBT_TAPE    2016-JUL-13 18:31:25 1       1       NO         DLPX2015052818345511D6F7437298
10519660 B     U SBT_TAPE    2016-JUL-13 18:32:35 1       1       NO         DLPX2015052818345511D6F7437298
10519661 B     U SBT_TAPE    2016-JUL-13 18:34:04 1       1       NO         DLPX2015052818345511D6F7437298
...
10520973 B  F  A DISK        2016-DEC-21 16:38:15 1       1       YES        TAG20161221T163047
10520974 B  F  A DISK        2016-DEC-21 16:47:00 1       1       YES        TAG20161221T163047
10520975 B  F  A DISK        2016-DEC-21 16:53:40 1       1       YES        TAG20161221T163047
10520976 B  F  A DISK        2016-DEC-21 16:58:26 1       1       YES        TAG20161221T163047
10520977 B  F  A DISK        2016-DEC-21 17:00:34 1       1       YES        TAG20161221T163047
10520978 B  F  A DISK        2016-DEC-21 17:03:35 1       1       YES        TAG20161221T163047
10520979 B  F  A DISK        2016-DEC-21 17:04:23 1       1       YES        TAG20161221T163047
10520980 B  F  A DISK        2016-DEC-21 17:05:07 1       1       YES        TAG20161221T163047
10520981 B  F  A DISK        2016-DEC-21 17:07:17 1       1       YES        TAG20161221T163047
10520982 B  F  A DISK        2016-DEC-21 17:09:28 1       1       YES        TAG20161221T163047
10520983 B  F  A DISK        2016-DEC-21 17:12:34 1       1       YES        TAG20161221T163047
10520984 B  F  A DISK        2016-DEC-21 17:13:47 1       1       YES        TAG20161221T163047
10520985 B  F  A DISK        2016-DEC-21 17:14:44 1       1       YES        TAG20161221T163047
10520986 B  F  A DISK        2016-DEC-21 17:15:01 1       1       YES        TAG20161221T163047
10520987 B  F  A DISK        2016-DEC-21 17:15:33 1       1       YES        TAG20161221T163047
10520988 B  F  A DISK        2016-DEC-21 17:15:50 1       1       YES        TAG20161221T163047
10520989 B  F  A DISK        2016-DEC-21 17:16:47 1       1       YES        TAG20161221T163047
10520990 B  F  A DISK        2016-DEC-21 17:18:01 1       1       YES        TAG20161221T163047
10520991 B  F  A DISK        2016-DEC-21 17:18:26 1       1       YES        TAG20161221T163047
10520992 B  F  A DISK        2016-DEC-21 17:20:53 1       1       YES        TAG20161221T163047
10520993 B  F  A DISK        2016-DEC-21 17:22:16 1       1       YES        TAG20161221T163047
10520994 B  F  A DISK        2016-DEC-21 17:23:05 1       1       YES        TAG20161221T163047
10520995 B  F  A DISK        2016-DEC-21 17:24:21 1       1       YES        TAG20161221T163047
10520996 B  F  A DISK        2016-DEC-21 17:25:24 1       1       YES        TAG20161221T163047
10520997 B  F  A DISK        2016-DEC-21 17:26:13 1       1       YES        TAG20161221T163047
10520998 B  F  A DISK        2016-DEC-21 17:27:57 1       1       YES        TAG20161221T163047
10520999 B  F  A DISK        2016-DEC-21 17:28:30 1       1       YES        TAG20161221T163047
10521000 B  F  A DISK        2016-DEC-21 17:29:31 1       1       YES        TAG20161221T163047
10521092 B  F  A DISK        2016-DEC-21 17:29:34 1       1       NO         TAG20161221T172934
10568384 B  F  A DISK        2016-DEC-22 12:41:04 1       1       NO         TAG20161222T124104
10568391 B  F  A DISK        2016-DEC-22 11:42:06 1       1       YES        TAG20161222T114206
10568401 B  F  A DISK        2016-DEC-22 11:49:41 1       1       YES        TAG20161222T114206
10568413 B  F  A DISK        2016-DEC-22 11:58:26 1       1       YES        TAG20161222T114206
10568426 B  F  A DISK        2016-DEC-22 12:05:12 1       1       YES        TAG20161222T114206
10568440 B  F  A DISK        2016-DEC-22 12:09:57 1       1       YES        TAG20161222T114206
10568455 B  F  A DISK        2016-DEC-22 12:12:02 1       1       YES        TAG20161222T114206
10568471 B  F  A DISK        2016-DEC-22 12:14:57 1       1       YES        TAG20161222T114206
10568488 B  F  A DISK        2016-DEC-22 12:15:43 1       1       YES        TAG20161222T114206
10568506 B  F  A DISK        2016-DEC-22 12:16:28 1       1       YES        TAG20161222T114206
10568525 B  F  A DISK        2016-DEC-22 12:18:43 1       1       YES        TAG20161222T114206
10568545 B  F  A DISK        2016-DEC-22 12:20:48 1       1       YES        TAG20161222T114206
10568566 B  F  A DISK        2016-DEC-22 12:23:54 1       1       YES        TAG20161222T114206
10568588 B  F  A DISK        2016-DEC-22 12:25:09 1       1       YES        TAG20161222T114206
10568611 B  F  A DISK        2016-DEC-22 12:26:14 1       1       YES        TAG20161222T114206
10568635 B  F  A DISK        2016-DEC-22 12:26:39 1       1       YES        TAG20161222T114206
10568660 B  F  A DISK        2016-DEC-22 12:27:04 1       1       YES        TAG20161222T114206
10568686 B  F  A DISK        2016-DEC-22 12:27:20 1       1       YES        TAG20161222T114206
10568713 B  F  A DISK        2016-DEC-22 12:28:25 1       1       YES        TAG20161222T114206
10568741 B  F  A DISK        2016-DEC-22 12:29:40 1       1       YES        TAG20161222T114206
10568770 B  F  A DISK        2016-DEC-22 12:30:05 1       1       YES        TAG20161222T114206
10568800 B  F  A DISK        2016-DEC-22 12:32:30 1       1       YES        TAG20161222T114206
10568831 B  F  A DISK        2016-DEC-22 12:33:56 1       1       YES        TAG20161222T114206
10568863 B  F  A DISK        2016-DEC-22 12:34:41 1       1       YES        TAG20161222T114206
10568896 B  F  A DISK        2016-DEC-22 12:35:56 1       1       YES        TAG20161222T114206
10568930 B  F  A DISK        2016-DEC-22 12:37:01 1       1       YES        TAG20161222T114206
10568965 B  F  A DISK        2016-DEC-22 12:37:47 1       1       YES        TAG20161222T114206
10569001 B  F  A DISK        2016-DEC-22 12:39:32 1       1       YES        TAG20161222T114206
10569038 B  F  A DISK        2016-DEC-22 12:40:07 1       1       YES        TAG20161222T114206



Wednesday, November 30, 2016

database link between Vertica/non-Vertica database

Summarize some research about database link  between Vertica/non-Vertica database


As of now, DB links feature in not present in Vertica. We can not create Vertica database links like those that exist in Oracle and SQL Server. Moreover, we cannot run two databases simultaneously at one time in Vertica cluster.

But we can easily connect to another Vertica database if we need to to copy data between two Vertica databases. See the SQL Reference Manual:
CONNECT TO VERTICA database USER username PASSWORD 'password' ON 'host',port

For copy ORACLE data to Vertica, once can uses a unix shell script. Use COPY command in Vertica. In a shell script, pipe the output from oracle to Vertica in COPY command ( using input as STDIN) and then run the script. This shell script can also be used as STORED PROC in Vertica and running this Stored Proc from Vertica will pull the data from Oracle to Vertica.

For table join, if it requires join two tables in two Vertica databases, why not use two different schemas in same cluster/database  which can act as two different database.

Create Linkserver from SQL Server to Vertica via ODBC is possible, however there can have  performance concern.

Thursday, November 24, 2016

install 32bit instantclient ODBC for 64bit windows 2008 R2

One of my developer encountered similar issue in this nice article .

His creates Visual Basic form in MS Office Excel to pull data from Oracle database, while the Excel is 32 bits installed in his 64 bits windows 7 , hence requires 32 bits ODBC for this to work.















Launch 32bit ODBC configuration program (ODBC Data Source ) C:\Windows\SysWOW64, we can see there is "Microsoft ODBC for Oracle".  This is the same finding for his target depLoying server (windows 2008R2).  I was thinking no more 32bits  "Microsoft ODBC for Oracle" in windows 2008, which is wrong.


The server has 64 bits oracle client already installed for other application,

Luckily  I notice there is 32bit ODBC for 11g instantclient.  This is help to minimize the impact.


Follow the instantclient ODBC installation guide :
1. run odbc_install.exe as administrator in command prompt.
2. Append path of instantclient (e:\instantclient11203) to system environment variable PATH
3. create tnsnames.ora in e:\instantclient11203\netwoork\admin\

Missing part of the guide is : Launch 32bit ODBC configuration program (ODBC Data Source ) C:\Windows\SysWOW64\odbcad32.exe,

After this, my developer told me that his program can run suddenly.






Reference:

MS ODBC for Oracle

Oracle ODBC Centre