Enyimba
asked on
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?
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
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
See the db2look documentation for specifics on the "-createdb" option:
http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0002051.html?cp=SSEPGG_10.5.0%2F3-6-2-6-82
http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0002051.html?cp=SSEPGG_10.5.0%2F3-6-2-6-82
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
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
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?
ASKER
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]
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]
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
-createdb option was introduced in DB2 10.1 Fixpack 4
http://blog.4loeser.net/2014/06/improved-db2look-in-db2-to-mimick.html
ASKER
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
General answers but no definitive example of use of -created db2look option
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.
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.
other db2 versions. I do not know