« October 2006 | Main | December 2006 »

1 2 Next

November 2006 Archives

November 1, 2006

Start selling of AUL/MyDUL licence now ...

    I published a CGI script on my site for online apply of AUL/MyDUL license, so you can get the full license even I am not online or available. In Oct 2006, you could get free license with free account, but since Nov, the free account will be disabled, you need to buy license, and I will set an account for you to apply license online.

    The cost of license will be much lower than the cost of service, and it's easy to use and with lot's of documents on my site, the most important is the support of newest release of Oracle. Buy license is the best solution for you.

    How to count the license count, it will be counted for each distinct day, for same date, 5 accesses will be treated as only one license, the following list will be counted as 3 license requests.

DAY=20061013 IP=58.212.85.189 CODE=5IFW-1D8F-UB4U-MT6J-K89C
DAY=20061013 IP=66.211.156.98 CODE=OC0Y-USYX-PP5C-YAGD-O6AN
DAY=20061014 IP=200.6.100.10 CODE=AU3I-KV2S-KQKM-30VS-TV46
DAY=20061014 IP=69.140.195.22 CODE=F901-OX9H-RTAN-NMTT-RDON
DAY=20061014 IP=69.140.195.22 CODE=GLHF-22F5-TR7F-0KL1-NQS5
DAY=20061014 IP=65.113.143.60 CODE=9WBJ-9Q1A-74W1-UK7C-PO88
DAY=20061014 IP=65.113.143.60 CODE=0SDJ-K3BI-KS4D-952X-0WQ9
DAY=20061014 IP=65.113.143.60 CODE=69S2-4TOG-5PY3-O710-EWFN
DAY=20061014 IP=65.113.143.60 CODE=UJ42-URTU-ZEPK-16NZ-2M7L

    The current price is 1000 USD/800 EUR for each license.

    If you contact me just when you need recovery service, I will not sell license at this price to you, it will be treated as recovery service.

    Updated: The count logic in SQL mode:

-- TABLE AUL_REQUEST (DAY,IP,CODE)
-- PK (DAY,IP,CODE)
SELECT SUM(CEILING(DAYCNT)/5)
FROM
(SELECT DAY, COUNT(*) DAYCNT FROM AUL_REQUEST)

November 7, 2006

Very happy to be a dad, some pictures ...

More photos ...

Captured on Oct 25, 2006, the baby's birthday.

View Full Article ...

How to perform DML on mview to manually refresh the data?

    There is an MVIEW (MV_FACT_SALES) in my personal database, direct update is not allowed unless in replication, following error will be reported:

SQL> DESC MV_FACT_SALES
Name                    Null?    Type
----------------------- -------- -------------
F_MONTH                          VARCHAR2(7)
M_AMOUNT1                        NUMBER
M_AMOUNT2                        NUMBER

SQL> INSERT INTO MV_FACT_SALES VALUES ('3000-1',1500,1600);
INSERT INTO MV_FACT_SALES VALUES ('3000-1',1500,1600)
            *
ERROR at line 1:
ORA-01732: data manipulation operation not legal on this view

    But we can do DML through exchange partition, like manually refresh the MVIEW's data, check the MVIEW status first:

SQL> SELECT STALENESS,STALE_SINCE FROM USER_MVIEWS;

STALENESS           STALE_SINCE
------------------- ------------
FRESH

    Let's create a partitioned table to perform partition exchange:

View Full Article ...

November 13, 2006

Get started with AnySQL utility -- chapter 6 (LONG and LOBs)

    I always hear people are asking how to view the content in LONG, LONG RAW, CLOB and BLOB fields. In SQL*Plus, it's really not easy, but in AnySQL I have special designed commands. This feature allow you to query LONG/LOBs contents to client side OS file (not server side as DBMS_LOB).

    LOB command, the query should return one column and one row with LONG or LOB type.

Usage:
  LOB query >> file
Note :
  >> mean export long/long raw/blob/clob to a file

    LOBEXP command, the query should return two columns, first as file name, second as LONG or LOB type column.

Usage:
  LOBEXP query
Note :
  Query should return tow column as following:
  col1 : CHAR or VARCHAR specify the filename.
  col2 : blob/clob field.

    Following is a demo table in my personal database:

ASQL> SELECT FNAME FROM T_LOB;

FNAME
-----
a.txt
otop

2 rows returned.

ASQL> desc t_LOB;

NO# NAME              NULLABLE TYPE        
--- ----------------- -------- ------------
  1 FNAME                      VARCHAR2(20)
  2 FTEXT                      CLOB

    View it with LOB command:

ASQL> LOB SELECT FTEXT FROM T_LOB WHERE FNAME='otop' >> otop.txt;

Command succeed.

    View it with LOBEXP command:

ASQL> LOBEXP SELECT FNAME, FTEXT FROM T_LOB;

Write to file: a.txt , bytes=37
Write to file: otop , bytes=483
Command succeed.

    Now check the files generated where you run AnySQL, it's so easy here.

New utility -- get some basic information of archived log

    How to get the first SCN, next SCN, first time, next time of archived log? the first way should be check rows from V$LOG_HISTORY or V$ARCHIVED_LOG, but these view just keep information of few latest archived logs, it depend on the control file record keep time setting, in quite a few databases, it did not keep long time than one week. The another ways is to dump the log file header, the check the trace file, you may find the following lines:

FILE HEADER:
......
Low scn: 0x031f.05c00824 08/23/2006 19:08:21
Next scn: 0x031f.05c00990 08/23/2006 19:08:58
......

    But dump log is quite complex, I have spent some time on log format, so just spent few minutes to write a new utility "lslog" to get these information, it's native C program, no Oracle environment is required:

$> lslog file=PROD_26375.arc
26375,3436537083312,2006-11-12 18:13:57,3436537256045,2006-11-12 21:09:24

    It print out five fields split by "," as following:

1, Log Sequence
2, Start SCN
3, Start Time
4, Next Log Start SCN
5, Next Log Start Time

    This feature is platform independent, and support 8i/9i/10g's archive log file. as following:

SQL> SELECT FIRST_CHANGE#,FIRST_TIME,NEXT_CHANGE#
  2  FROM V$LOG_HISTORY WHERE SEQUENCE#=26375;

   FIRST_CHANGE# FIRST_TIME              NEXT_CHANGE#
---------------- ------------------- ----------------
   3436537083312 2006-11-12 18:13:57    3436537256045

00:36:55 SQL> select FIRST_TIME from  v$log_history where SEQUENCE#=26376;

FIRST_TIME
-------------------
2006-11-12 21:09:24

    Now powerful utility, download it?

1 2 Next

About November 2006

This page contains all entries posted to AnySQL.net English in November 2006. They are listed from oldest to newest.

October 2006 is the previous archive.

December 2006 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 3.34