About Me

My photo
Hello friends I welcome you all to my BLOG and invite you all to come and participate and share useful genuine Knowledge related to "Teradata" which can make a difference in each other's life and can be put for a better use. Let us Speak on every topic, lets share our views and if together we can bring a change to the World . With all your contribution I want to make this blog a real success.

Sunday, November 23, 2008

Permanent Journal

Creating Permanent Journal

Create Database Test11 as perm=10e3 DEFAULT JOURNAL TABLE =jtemp111
Modify user Test2 as DEFAULT JOURNAL TABLE =jtemp12

Here JTemp111 is created in the database Test11

Setting Permanent Journals

Permanent Journal can be set at table level or at database level.

a) If a table is created in a database which has a default journal table set, then by default all the journal images of the tables
in the database are maintained in the default journal table of the database.

Create database Test1 as perm=10e3 password= Test1 DEFAULT JOURNAL TABLE =jtemp111

Create table Test1.temp115
, after journal
(
i int,
j int
)

Show table Test1.temp115

CREATE SET TABLE Test1.temp115, NO FALLBACK,
NO BEFORE JOURNAL,
NOT LOCAL AFTER JOURNAL,
WITH JOURNAL TABLE = Test1.jtemp111,
CHECKSUM = DEFAULT
(
i INTEGER,
j INTEGER)
PRIMARY INDEX ( i );


b) When specified explicitly, the journals images can be maintained in a journal table present in different database.


Create table Test1.temp116
, after journal
, with JOURNAL TABLE= Test2. jtemp12
(
i int,
j int
)

Where Test2 database has a permanent journal jtemp12

Dropping Permanent Journal Tables

A journal table can be dropped when no tables point to the journal table.

To stop pointing to journal table

Alter table Test1.temp115, no after journal

When no more tables point to PJ table ,drop it

Modify user Test1 as drop DEFAULT JOURNAL TABLE =jtemp111

No comments: