RE: DB2 equivalence information ...

RE: DB2 equivalence information ...

 

  

OK...Let me give it a try...

CREATED - that is when was the database created, reset, etc.

"select date(create_time) from syscat.tables where tabname='SYSTABLES'; --Assumption catalog tables are created when the database is created and cant be dropped!

"select DB2START_TIME,LAST_RESET from table (snapshot_dbm(-1)) snap_dbm"

LOG_MODE - is the database in NOARCHIVELOG or ARCHIVELGO

Couldnt find a table function like get_db_cfg('dbname',-1) ! will see later..

PLATFORM_NAME - the server info that is running on, can possibly get away with
this using uname

db2 "select * from table (sysproc.env_get_sys_info()) as sys_info"

OPEN_MODE - in Oracle, this is whether the database is READ-WRITE or MOUNTED
like when it is a standby database

db2 "select db_status from table(snap_get_db('xxxx',-1)) as t" may have to interpret the status code...

N.B. You may have to switch on monitors for some of the table functions to return the right result.

Praveen

-----Original Message-----
From: benbart
[mailto:db2udbdba-ezmlmshield-x15579904.[Email address protected]
Sent: 27 June 2006 23:25
To: LazyDBA Discussion
Subject: DB2 equivalence information ...


Hi all,

Am currently trying to write a "generic" or "universal" that I can use for both
Oracle and DB2 to do some sort of history growth plus recording some database
information bit.

Am done with the Oracle flavour and is now currently doing the DB2 flavour, can
someone tell me what is the equivalence of the following DB2 information that I
am looking for:

I got the INSTANCE_NAME, and DATABASE_NAME sorted, I want to know if I can get
these other informations via any DB2 commands:

CREATED - that is when was the database created, reset, etc.
LOG_MODE - is the database in NOARCHIVELOG or ARCHIVELGO
PLATFORM_NAME - the server info that is running on, can possibly get away with
this using uname
OPEN_MODE - in Oracle, this is whether the database is READ-WRITE or MOUNTED
like when it is a standby database

Disregard, RUNNO and RUNTIME, they're user-defined. Thanks in advance.


SQL> desc info_database
Name Null? Type
----------------------------------------- -------- ----------------------------
INSTANCE_NAME VARCHAR2(16)
DATABASE_NAME VARCHAR2(30)
CREATED DATE
LOG_MODE VARCHAR2(12)
PLATFORM_NAME VARCHAR2(101)
OPEN_MODE VARCHAR2(10)
RUNNO NUMBER
RUNTIME DATE




---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html




This email and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. This communication represents the originator's personal views and opinions, which do not necessarily reflect those of HPI Limited. If you are not the original recipient or the person responsible for delivering the email to the intended recipient, be advised that you have received this email in error, and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you received this email in error, please immediately notify [Email address protected] message has been scanned by Anti-Virus. Recipients are advised to apply their own virus checks to this message on delivery.


DB2 & UDB email list listserv db2-l LazyDBA home page