-1

I downloaded trail version of DB2 (by following steps here:https://www.db2tutorial.com... some steps didn't come when i installed)and i opened Administrator:DB2 CLP - DB2COPY1 -db2, then i have given the cmd as

db2 => LIST ACTIVE DATABASES

output(error):

SQL1096N The command is not valid for this node type.

db2 =>

it's not working, here version of DB2 is:11.5.0.1077,Please advice how to proceed further.In fact not only this command, so many commands are not working.

mustaccio
  • 18,234
  • 16
  • 48
  • 57
Devi George
  • 45
  • 2
  • 8
  • Are you running db2 clp on the server (contrary to a client node)? I don't know windows, but you can try running db2licm -l and see what it says – Lennart - Slava Ukraini Apr 11 '20 at 11:42
  • db2 => db2licm -l DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL1024N A database connection does not exist. SQLSTATE=08003 db2 => – Devi George Apr 11 '20 at 12:22
  • You can not run that from within db2clp – Lennart - Slava Ukraini Apr 11 '20 at 12:23
  • I am not running db2 clp, I am running db2 command window administrator as mentioned in the above tutorial(https://www.db2tutorial.com/getting-started/create-db2-sample-database/)..i working on windows.means shall i run db2 clp for sql.Actually I want to practise database using db2.I don't want other things like mainframes,cobol etc. – Devi George Apr 11 '20 at 12:25
  • where I need to run? pls suggest.I am running db2 command window administrator. – Devi George Apr 11 '20 at 12:27
  • What other alternative do you have in the start menu under db2? I cant remember what the tool is called – Lennart - Slava Ukraini Apr 11 '20 at 12:41

1 Answers1

2

The message:

"SQL1096N The command is not valid for this node type."

as a response to "list active databases" command usually means that you did not install a Db2-server product, or you have multiple Db2-products installed and you chose to act on a client instance instead of a server instance.

You might have installed a full Db2-client product by accident, by clicking the wrong button on the setup program gui page for Install a product, or the installable image that you downloaded was not a server image (but instead a client image).

Different ways to see the node type:

  • You can see which Db2 product(s) you installed if you run appwiz.cpl from the Windows Start menu and examine the list.

  • You can also see what you installed if you examine the log file created by the setup program during installation.

  • open a db2cmd.exe window (from Windows Start > Run) and in there run the command db2 get dbm cfg | more and near the start you will see Node type = ..... If your db2cmd.exe window is addressing a server installation, then the node type will be something like ...Server edition with local and remote clients. If you see Node type = Client, then you are not addressing a server installation. So in this case, you can either uninstall the client image and install a server image, or configure your db2cmd.exe window to address a server installation.

If you have multiple Db2 products installed then run the Default DB2 and Database Client Interface Selection wizard which should appear in your Windows Start menu under the IBM Db2 group. This lets you choose which instance to make the default, so that when you run a db2cwadmin/db2cmd window, then the correct product gets addressed.

If you installed a Db2-server product, then you can run db2cwadmin.bat (from the Windows Start Menu) and in that window the commands db2start and db2stop will be available, and the command-line db2 list active databases will report (by default) one local database called SAMPLE assuming you created the default database in the First Steps that runs after installation.

If you installed a Db2-server product, with all the default settings on a Microsoft Windows operating-system, then you will also see a process called db2sysc.exe in the Task List when the Db2-instance is running.

Verify that you downloaded the server image from IBM, and then re-run the setup program and ensure you choose to install a server product.

mao
  • 11,321
  • 2
  • 13
  • 29
  • Here I am running in db2 command window administrator, and i ran the appwiz.cpl, then db2 => appwiz.cpl DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL1024N A database connection does not exist. SQLSTATE=08003. – Devi George Apr 11 '20 at 14:13
  • then I ran db2 get dbm cfg | more, then db2 => get dbm cfg | more SQL0104N An unexpected token "|" was found following "CFG". Expected tokens may include: "END-OF-STATEMENT". SQLSTATE=42601, – Devi George Apr 11 '20 at 14:13
  • then i ran db2cwadmin.bat,db2 => db2cwadmin.bat DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL1024N A database connection does not exist. SQLSTATE=08003 db2 => – Devi George Apr 11 '20 at 14:14
  • 2
    Understand the difference between the __interactive__ command line processor(db2.exe), and the db2cmd.exe __shell__. Click Start > Run > db2cwadmin.bat , or Start > Run > db2cmd.exe ,and in the new window that opens, there run the commands that I show in the answer. You cannot run operating-system commands in the interactive clp, instead you run them in db2cmd.exe. – mao Apr 11 '20 at 14:18