?
Solved

Is there any way with db2look, or perhaps with some other system command, where you can see the exact command structure that created a database?

Posted on 2015-01-08
12
Medium Priority
?
326 Views
Last Modified: 2015-01-26
Hi DB2 gurus,

This question was asked sometime ago sometime ago. I was never able find the answer. So let me ask again. There are various options for db2look you can use to see the DDL for just about every object in the database except the command that created the database itself. Is there any way with db2look, or perhaps with some other system command, where you can see the exact command structure that created a database?

Thank you.

Enyimba
0
Comment
Question by:Enyimba
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 40539034
For db2/400 ther is a retrieve sql function in the iSeries Navigator.
other db2 versions. I do not know
0
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 40539059
0
 
LVL 10

Assisted Solution

by:Carlos Ijalba
Carlos Ijalba earned 450 total points
ID: 40543964
In DB2 all the info is extracted via db2look, in fact navigator also uses db2look for it's retrieve SQL functions.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

Author Comment

by:Enyimba
ID: 40549192
Hi Gary Patterson,

I've been a little sick this past several days. So I pick up from Gary's suggestion. tried to use the -createdb but got an error..."The option "-createdb" is not supported by db2look."
Perhaps you could share with me where you got the -createdb command option.

Thanks

Enyimba
0
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 40549554
From the manual.  I provided you a link in my first post.  -createdb options is available stating in v10.  Are you running an old version of DB2?
0
 

Author Comment

by:Enyimba
ID: 40550029
Gary, I just tried to use the command prior to posting...here's the syntax that I used...

db2look -d db_name -e  -createdb -l -o file.out    and lo and behold this is what I got. Perhaps I am doing somethingwrong?
apmq02hdqra /home/rapmq01i/workdir >db2look -d db_name -e  -createdb -l -o file.out

The option "-createdb" is not supported by db2look.

Syntax: db2look -d DBname [-e] [-xs] [-xdir Path] [-u Creator] [-z Schema]
                          [-t Tname1 Tname2...TnameN] [-tw Tname] [-xdep] [-xddep]
                          [-o Fname] [-a] [-m] [-c] [-r] [-l] [-x] [-xd] [-f] [-h]
                          [-fd] [-td x] [-noview] [-i userID] [-w password]
                          [-v Vname1 Vname2 ... VnameN] [-dp] [-ct]
                          [-wrapper WrapperName] [-server ServerName] [-nofed]
                          [-wlm] [-ap] [-mod] [-cor] [-wrap] [-noimplschema] [-nostatsclause]
                          [-wrapper WrapperName] [-server ServerName][-fedonly] [-nofed]
0
 
LVL 10

Assisted Solution

by:Carlos Ijalba
Carlos Ijalba earned 450 total points
ID: 40550102
Enyimba,

Under what OS are you running DB2? because not all the commandset of DB2 is available for AS/400 for example, but it is for UNIX.

So it is important to know and look at the appropriate documentation, Gary's book is for DB2 for Linux/Windows.
0
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 40550119
Question tag says "DB2 LUW", so I've been operating on the assumption that this is DB2 LUW.  BIgger question for me is "what version"?  Looks to me like this must be an older version of DB2 that doesn't support the -createdb option.

-createdb option was introduced in DB2 10.1 Fixpack 4

http://blog.4loeser.net/2014/06/improved-db2look-in-db2-to-mimick.html
0
 

Author Comment

by:Enyimba
ID: 40557023
Hi all

I am running DB2 10.3 in a Unix/AIX 7.1 environment and that is where that command was issued and errored out.

Thanks


Enyimba.
0
 
LVL 35

Accepted Solution

by:
Gary Patterson earned 1050 total points
ID: 40558368
As far as I know, there is no such release as DB2 10.3 for LUW.  IBM went from 10.1 to 10.5.  Any chance you mean v10.1 Fixpack 3?  If so, then you just need to Fixpack 4 to get the db2look -createdb option:

http://www-01.ibm.com/support/docview.wss?uid=swg27007053
0
 

Author Closing Comment

by:Enyimba
ID: 40568757
General answers but no definitive example of use of -created db2look option
0
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 40570515
You supplied a "definitive example" yourself.  Your syntax was  correct:

db2look -d db_name -e  -createdb -l -o file.out

Your syntax is not the problem.  The problem is that you are running an older version of db2look that doesn't support the -createdb option.  If you applied the fixpack I recommended then the command you attempted earlier should work.
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I wrote an article (http://www.experts-exchange.com/articles/2245/Anti-rootkit-software.html) some time ago with a reference to nLite  (http://www.nliteos.com/)slipstreaming software.  I recently changed that link to point to NTLite (https://www.ntl…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question