Db2 mainframe commands - command

I am naive in mainframe and my question would sound silly. However, I want to know where do we write or issue db2 commands,say diplay database command. Under which option do we issue these commands. Also, how do we find which database is active? This question sounds weird, however, the same was asked to me.

IBM has an Info Center article about where you can issue DB2 commands on the Mainframe. However, if you're not familiar with the Mainframe in general, it may not be all that useful to you.
As #cschneid recommends, you may want to ask around in your employer if there is any expertise on the subject. Otherwise, you need to get some training from somewhere.

There is a useful DB2 tool on the mainframe called SPUFI which can execute SQL statements.
https://www.ibm.com/support/knowledgecenter/en/SSEPEK_11.0.0/apsg/src/tpc/db2z_executesqlspufi.html
There's also a DB2 Admin Tool as well.

Related

How to enable new table option in oracle sql developer tool

I want to create table automatically using new table option in oracle SQL developer,but that option is disabled in my tool.
Can any one please help me out in this issue.
Please find the below image highlighted with red mark for your better understanding.
Thanks in advance.
To quote Jeff Smitth:
SQL Developer is built by Oracle, for Oracle. It’s the database IDE.
...
But, SQL Developer is also ... a 3rd party database migration platform.
...
Since we support migrations from these other database platforms, wouldn’t it be neat if SQL Developer could connect and query those 3rd party databases too? Surprise, surprise – that’s exactly what we DO do today.
What ‘Support’ means
You can connect to, browse, and query (SELECTs only) SQL Server, DB2, Access, MySQL, and Teradata.
What ‘Support’ does NOT mean
providing debuggers
delivering database administration features
write access to the database
Sound a little harsh or spartan? Going much further in any of these areas would just open a big ole can of worms, and we’re committed to providing an optimal experience for the Oracle database. But, since we already support these limited features, there’s no real reason to hide it.
That post is from 2012, but as far as I'm aware is still mostly true.
Since creating tables would count as write access and a DBA feature, it isn't a matter of enabling the option for your MySQL database, it isn't supported. This is an area of functionality that only applies to Oracle databases. (Even though Oracle Corp. owns MySQL... this means the Oracle RDBMS).

PostgreSQL - Do I need the command-line tool?

I decided to give PostgreSQL a try. It looks really interesting, but it isn't very user friendly at all.
I got some great help from the PostgreSQL e-mail list, but they insist that the tool to use is the command-line editor (PSQL). Unfortunately, it's a total disaster. When I open it, it opens at least two instances, which soon multiply into a dozen. It also seems to somehow hijack my Apple terminal on my Mac. I can type the same command into two different terminal boxes and get two different results. I don't have a clue what's going on.
Anyway, to get to the point, PostgreSQL is obviously over my head. There's a local PostgreSQL users group that meets once a month - at night, when I'm working. But I'd like to try and make the very beginning of their next meeting and drop them a note. I'd like to hire someone to help me get PostgreSQL set up on my laptop and online, fix whatever the problem is and show me how to create a database and table.
Actually, I've already created a database and table, which I can access with pgAdmin III. But I can't see them with the shell/ terminal. So that's my question: If I can hire someone to get PostgreSQL up and running, will I be able to work with it using pgAdmin III or some other tool, or am I going to be chained to the shell (PSGL)?
If the shell/terminal is indispensable, then I think I'm going to abandon it. It looks like a great program, but I just don't have time to jump through all the hoops right now.
You don't need psql to use PostgreSQL. Many experienced users prefer it, but you can use nothing but PgAdmin and get by just fine. That's what a great many users do.
PostgreSQL is fine on Mac OS X. A number of core developers use Mac OS X and do their development on it. Much like many MySQL users use phpmyadmin, etc, and never use the mysql command line tool.
There were some packaging issues on OS X related to Apple's bundling of PostgreSQL but those are resolved in more recent versions of OS X.
There are also some challenges with different packages of PostgreSQL on OS X - EnterpriseDB, Macports, Homebrew, etc. But those are mostly a matter of documentation and user misunderstanding; each package is in its self just fine. Similar issues exist on Linux, where OS packages, PGDG packages, and EDB's packages can tread on each others' toes.
Characterising the PostgreSQL community as a "Microsoft/Linux fan club" is hilarious, by the way. Windows is tolerated at best by most of the core devs and users on the mailing list.
It's really hard to tell what problem you're encountering based on the description given. Maybe you have multiple different PostgreSQL packages installed, so you have more than one server instance, and are getting them confused? Similarly, I can't tell what's going on with the psql terminal link in the dock. I'd ignore it and use psql from the usual Apple Terminal.app if you want to use psql. Otherwise just use PgAdmin.
One area where you will run into trouble is that because most experienced users use psql, if you ask questions specific to PgAdmin or other tools, rather than PostgreSQL its self, people will pretty much shrug their shoulders and say "dunno, but you do it like in psql". I haven't used PgAdmin for my own stuff in years, and have to go hunting around in the manual if I want to figure out how to do something so I can explain it to somebody. Moreso with things like Navicat, which I've never used at all. The people who use those tools are usually not the ones spending their time helping other people out, so you get help from experienced and enthusiastic users who're also the ones most likely to use the expert-oriented tools.
Relevant link: http://phili.pe/posts/postgresql-on-the-command-line/
I've been using DBeaver to write and execute my Postgres queries because I don't like neither psql nor PgAdmin. Not that DBeaver is without its faults but at least it has decent code completion and an easy way to switch databases / schemas. In the end it's also about what you're used to and I guess coming form SQL Server with Management Studio I found this an easier way in into Postgres.
It's true that in most Postgres books psql is the standard but I usually try to convert the psql specific code to queries I can run in DBeaver, which is usually an interesting (although somewhat frustrating at times) exercise...

Recovery Models for SQL Anywhere

What is the equivalent to Simple/Full Recovery mode in SQL Anywhere? How do I switch between the recovery models? I have a database that I would like to change to simple recovery mode during an upgrade, so that the log file doesn't blow up, flood our write cache, etc.
I have tried looking all over for this, but maybe I'm using the wrong wording, and recovery models don't exist in SQL Anywhere.
Thanks in advance!
I do not believe there is such a concept in SQL Anywhere.
You may want to ask your question at http://sqlanywhere-forum.sap.com/, a Q&A site specifically for SQL Anywhere.
Disclaimer: I work for SAP in SQL Anywhere engineering.

IBM DB2 9.7 free monitoring tools

Any good advice on what tools to use to monitor a DB2 database? I have used the db2top command but was wondering if there are more verbose tools out there. Our DB is running on Linux64
As tools, you can use the memory tracker db2mtrk, Problem determination db2pd. But also you can use many other things, such as:
function tables
administrative views
get snapshot
create and active event monitors.
It really depends on what you are goin to do.
Also, the IBM Optim Performance Expert is a good tool to find bttlenecks or issues in the Database. Also the DBI panther brother. And finally the Data Studio Web Console is a basic tool to monitor few elements.
What do you want to monitor? probably with the help of a cron that executes a script you can do many things.

How to deploy/versioning database with Cruise Control Net?

Hi i have configured the basics of cruise control to make releases, and automated nunit test using just MSBuild. Now i'm wondering if is possible to deploy/versioning databases with this?
I'm a beginner at CCNet .So if is possible some suggestions or tutorials (if there are) . Also if someone knows a free tool for database deployment/versioning let me know.. i will be grateful.
Thanks in advance
Hugh
It isn't free but SQL Source Control from RedGate can do what you're looking for, assuming it's a SQL Server database. It has a commandline interface that you can use in CCNet tasks. The easy approach of just migrating up is... easy, the changes are applied to your database schema / data. There was an issue with v2x of the tool that they've overcome with 3, which is that if you were to rename a table column then it would delete the column and create a new one with the right name. Obviously that's quite a big problem if you've got data you want to keep, so with v3 there's the concept of migrations and this allows you to specify alter scripts so instead of dropping the column you could script the change non-destructively.
As far as I know, at this time, they don't have anything that allows you to roll back your version.
Otherwise you could take a look at database migration tools, there seemed to be some promise for these in .Net at least. There is also this post that has some other tools (again for .net) and then there's this https://stackoverflow.com/search?q=database+migration+tool which is not restricted to any language but is general database migrations
If you're still looking for ways to version and migrate databases, one such tool is dbdeploy.net . I've hosted it on github after forking it and doing some work. Latest version is fully up to date and has some interesting features (done by someone who also uses it and sent a pull request).