Search This Blog

Tuesday, December 13, 2011

Printer is printing in portrait instead of landspace

Here I assumed all prints are coming in portrait instead of landspace and found below workaround with oracle

"Solution

1. Setup for BI Publisher printing as per Note 338990.1 "How To Print XML Publisher PDF Reports Via The Concurrent Manager", however. Install and configure the pasta_pdf.cfg file with the acroread tool instead of pdf2ps or pdftops. If pdftops or pdf2ps is the prefered tool, please check with the vendor an/or with the product's documentation for the equivalent options used in the following example.

2. Copy the pasta_pdf.cfg file and rename it pasta_pdf_land.cfg. Edit the preprocessing section as follows.

% Preprocess for PDF output
% This is an example for PDF output to print.
; Xpdf
; preprocess=pdftops {infile} {outfile}
; Ghost Script
; preprocess=pdf2ps {infile} {outfile}
; Acrobat
preprocess=acroread -toPostScript -pairs -shrink -landscape {infile} {outfile}

3. Copy the "PDF Publisher" print style and rename it "PDF Publisher Landscape" In the Orientation field of the new style type "Landscape" and populate the SRW field with the "PSTLL" landscape print style.

4. Copy the "PASTA_PDF" printer driver and rename it "PASTA_PDF_LAND". Edit the new printer driver, populate the SRW field with the "PSTLL" landscape print style and modify the print argument as follows.

-pn$PROFILES$.PRINTER -f$PROFILES$.FILENAME -c$PROFILES$.CONC_COPIES -Fpasta_pdf_land.cfg

5. Associate the new "PDF Publisher Landscape" style and "PASTA_PDF_LAND" driver to the "--PASTA Universal Printer Type".

6. Bounce the concurrent manager.

NOTE:   Printer type, print style and printer driver information is cached in memory; in order for any printer setup form changes to take effect, you will need to bounce (restart) the concurrent managers on the concurrent processing server or restart the "Request Processing Managers" using OAM. 

Ref Doc:Custom Landscape Reports In PDF Format Print In Portrait Orientation [ID 421358.1]

Wednesday, December 7, 2011

Demantra performance issue

Issue: User is not able open worksheets
Solution: Rebuild the schema
Step 1) 
# ---------------------------------------------------------------------------
# Clean temp_tables and rebuild msdem schema
# ---------------------------------------------------------------------------
sqlplus /nolog << EOF
conn msdem/******
col PCT_CHAIN_CNT for  999.99
spool /tmp/${ORACLE_SID}_demantra_maintenance.log
select 'Start drop_temps at '|| to_char(sysdate,'YYYY-MON-DD HH24:MI:SS') from dual;
exec DROP_TEMPS(0);
select count(1) from audit_values;
select 'Start drop_temps at '|| to_char(sysdate,'YYYY-MON-DD HH24:MI:SS') from dual;
exec clean_log_tables();
select count(1) from audit_values;
select 'Start rebuild_schema at '|| to_char(sysdate,'YYYY-MON-DD HH24:MI:SS') from dual;
Select table_name,num_rows, chain_cnt,(chain_cnt/num_rows)*100 pct_chain_cnt
from user_tables where chain_cnt >  0 order by chain_cnt desc;
exec rebuild_schema('1');
Select table_name,num_rows, chain_cnt,(chain_cnt/num_rows)*100 pct_chain_cnt
from user_tables where chain_cnt >  0 order by chain_cnt desc;
select 'Start exception_checking at '|| to_char(sysdate,'YYYY-MON-DD HH24:MI:SS') from dual;
select  to_char(err_date,'YYYYY-MON-DD HH24:MI:SS')||'|'||
proc_name||'|'||err_msg  from db_exception_log where trunc(err_date)=trunc(sysdate);
spool off
@ /home/oracle/dba/gen_msdem_index_rebuild.sql
@ /home/oracle/dba/msdem_index_rebuild.sql
EOF


Step 2)
Rebuild table and index
alter table MDP_MATRIX move; -- connect to object owner and start
select 'alter index '||INDEX_NAME ||' rebuild online nologging parallel 8;' from user_indexes where
table_name='MDP_MATRIX' and status='UNUSABLE';
select INDEX_NAME,status from user_indexes where table_name='MDP_MATRIX' and
status='UNUSABLE';
alter index SALES_DATA_LUD_IDX rebuild online nologging parallel 8;
ANALYZE table MSDEM.MDP_MATRIX estimate statistics sample 10 percent;
Gather stats
exec DBMS_STATS.GATHER_TABLE_STATS('MSDEM','SALES_DATA',NULL,5,FALSE,'FOR ALL COLUMNS SIZE 1',5,'ALL',TRUE);
exec DBMS_STATS.GATHER_TABLE_STATS('MSDEM','MDP_MATRIX',NULL,5,FALSE,'FOR ALL COLUMNS SIZE 1',5,'ALL',TRUE);
execute dbms_stats.gather_schema_stats (ownname => 'MSDEM', estimate_percent => 50, degree => 5, cascade => true);
use below querry to compare the data after gather stats.
SQL> select count(*) from mdp_matrix
COUNT(*)
----------
222400
@@@@@@@@@chaning row information@@@@@@@
select table_name, chain_cnt, num_rows, (chain_cnt/num_rows)*100 percent
from user_tables where chain_cnt >0 and num_rows > 0 order by chain_cnt desc;
SELECT table_name, tablespace_name, chain_cnt, num_rows, (chain_cnt / num_rows) * 100 PERCENT, last_analyzed FROM user_tables
WHERE chain_cnt > 0 AND num_rows > 0;
SELECT TABLE_NAME, CHAIN_CNT, NUM_ROWS, (CHAIN_CNT/NUM_ROWS)*100 PERCENT FROM USER_TABLES where table_name='MDP_MATRIX';



Transportable tablespace refresh

  1.check tablespace for the user which need to refresh -------------------------------------------------------------------  SQL> select ...