cancel
Showing results for 
Search instead for 
Did you mean: 

Help about access DB to unlock user SAP* in db2 client 000

jerryhien
Explorer
0 Kudos

Hi consultant,

I has a mistake, input wrong password many times and user SAP* & DDIC on client 000 was locked.

I try to unlock these user, but when i run a command on db2 (with Administrator permission) , it show me a error message:

"SQL1031N  The database directory cannot be found on the indicated file system.

SQLSTATE=58031 "

I jus found this page: IBM SQL1031N when running DB2 command - United States

it show the direction - found  the db2 instance, but i do not how to do

could you please help me do it, i very need open these user to config the system for the SAP services consultants check our system.

Thanks you for your read !

Best Regards,

Hien Nguyen

Accepted Solutions (1)

Accepted Solutions (1)

martin_mikala
Participant
0 Kudos

Hi,

I think, you must use for connect to DB name and not to instance name.

db2 connect to P01.

B.R.
Martin

jerryhien
Explorer
0 Kudos

Hi Martin,

It show the same error

Best Regards,

Hien

Former Member
0 Kudos

Hi Hien,

Did you try the commands mentioned by me earlier..? Did they work..?

Regards,

Prithviraj.

jerryhien
Explorer
0 Kudos

Hi Prithviraj,

I also try it, it not work, thanks for your help

Best Regards,

Hien

Former Member
0 Kudos

Hi Hien,

It won't work because you missed double qoutes in the command, Please copy paste below commands and try..

db2 "list db directory on E:\db2\P01" or db2 "list db directory on \db2\P01"


db2 "select tabschema from syscat.tables where tabname = 'SVERS'" (Ends with ' and ")

Let me know the result

Regards,

Prithviraj.

jerryhien
Explorer
0 Kudos

Hi Prithviraj,

Thanks you for your answers!

It show the path invalid, then i change the path, it show the same error.

Best Regards,

Hien

manumohandas82
Active Contributor
0 Kudos

Try

1 ) db2 attach to db2p01

2 ) db2 list db directory

Former Member
0 Kudos

Hi Hien,

In the screenshot you have fired both the commands at once.

You need to type db2 "list db directory on E:\db2\P01" if this doesnot work than give the command db2 "list db directory on \db2\P01"

Either of this should work

Also what is the result of

db2 "select tabschema from syscat.tables where tabname = 'SVERS'"

Did this work...?

Regards,

Prithviraj.

jerryhien
Explorer
0 Kudos

Hi Prithviraj,

I was try some command , but i still not find solution

and your command:

Thanks & Best Regards,

Hien

manumohandas82
Active Contributor
0 Kudos

Now try

db2 connect to P01

db2 "select tabschema from syscat.tables where tabname = 'SVERS'"

former_member185954
Active Contributor
0 Kudos

Hello Hien,

You still haven't confirmed back the following:

- If your SAP system is up and running

     - if it is down, have you checked with your OS Admins if there is an issue with storage

     - if it is up, are you executing all these commands on the correct system, my hunch is that you are logged into a passive node in a cluster environment. On the server can you find the Directory K:\db2\P01\sapdata4 ?

Further,

If you think you are on the correct server and system is up and running you can pack your SQL statements in a text file called test.sql

find the executable db2cli.exe on your system, copy/move test.sql in the same directory as db2cli.exe

And execute the command

db2cli execsql -dsn <Database> -inputsql test.sql

in your case it might be:

db2cli execsql -dsn P01 -inputsql test.sql


Regards,

Siddhesh

jerryhien
Explorer
0 Kudos

Dear Siddhesh,

Directory K:\db2\P01\sapdata4 is exactly i can access it via my computer. The db2 Database is running for SAP users.


The problem was done. I was restart Database Servers (we have 2 not running in clustering), after we do restart, it change the active node to another server and we can run db2 command successful. But we don't know how it done, could anyone give me some advice ?


Best Regards,

Hien

former_member185954
Active Contributor
0 Kudos

Hello Hien,

So your original issue is resolved ?

You are now asking, how to switch the server from Node 2 -> Node 1 ?

Regards,

Siddhesh

jerryhien
Explorer
0 Kudos

Hello Siddhesh,

Our original issue is resolved, we just shut down all nodes and start the node 2 (we want to become the active node) first, then it become the active node.

Thanks you very much for your help!

Best Regards,

Hien nguyen

former_member185954
Active Contributor
0 Kudos

Hello Nguyen,

Nice to know, you should close this thread.

Regards,

Siddhesh

jerryhien
Explorer
0 Kudos

Hello Siddhesh,

I don't see the close function, could you help me a directions !

Thanks you very much!

Best Regards,

Hien Nguyen

Answers (3)

Answers (3)

maria_shen
Contributor
0 Kudos

Hello Hien,

Could you please check the result of following command?
>> db2 list db2 directory on /db2/P01/

If it fails, then it might not be solved in a straight foward way.

Kind regards
Maria

jerryhien
Explorer
0 Kudos

Hello Maria Shen,

I just run the command as your recommend, it failed, please view the error:

Could you help me some advice ?

Thansk and Best Regards,

Hien Nguyen

maria_shen
Contributor
0 Kudos

Hello Hien,


Sorry for the typo.

It should be "db2 list db directory on /db2/P01/"

Kind regards
Maria

jerryhien
Explorer
0 Kudos

Hello Maria Shen,

I just try again the command: "db2 list db directory on /db2/P01/" , it show the error: "SQL1002N  "db2/dp2p01" is not a valid drive."

Could you please continue helps .

Thanks you & Best Regards,

Hien Nguyen

maria_shen
Contributor
0 Kudos

Hello Nien,

The result seems not as expected.
Could you please try "db2 list db directory on \db2\P01"? Same result?

Maria

Former Member
0 Kudos

Hi Hien,

The correct command after you connect to DB using db2<sid> user is as below...

db2 "list db directory on /db2/<SID>"


db2 "select tabschema from syscat.tables where tabname = 'SVERS'" (Ends with ' and ")

The command should not work for /db2/db2<sid> path as far as I know.

Regards,

Prithviraj.

jerryhien
Explorer
0 Kudos

Hello Maria Shen,

i was try try "db2 list db directory on \db2\P01" and it show same result.

Thanks & Best regards,

Hien Nguyen

martin_mikala
Participant
0 Kudos

Hi,

You can test windows path.

db2 list db directory on K:\db2\P01

B.R.
Martin

jerryhien
Explorer
0 Kudos

Hi Martin Mikala,

It show the same error

Best Regards,

Hien Nguyen

martin_mikala
Participant
0 Kudos

And is this disk K: mounted on this server?
Are you on DB server or on SAP AS?

B.R.
Martin

maria_shen
Contributor
0 Kudos

Hello Hien,

"db2 list db directory" gives the result, while "db2 list db directory on K:\db2\P01" returns same SQL1031N error. It seems to be some issues with database files under local database directory

You have to firstly check where the database directory exactly resides. The first result gives "K:\db2\P01\sapdata4". Is it really there? Does it have subfolder like NODE0000\SQL00001?

In any case, the repair is not straight forward, and may need to have SAP incident created.


Kind regards
Maria

former_member185954
Active Contributor
0 Kudos

Hello Hien,

With Any Database you first need to connect to it. Looks like you are executing the sql statement when you are not connected to the DB, hence you get an error.

Please read the following document before proceeding to execute sql statements.

DB2 Basics: Getting to know the DB2 UDB command line processor

Regards,

Siddhesh

jerryhien
Explorer
0 Kudos

Hello Siddhesh Ghag,

I just try to connect Database , but it show the same error message, could you please help me, i do very amateur about DB2 command.

former_member185954
Active Contributor
0 Kudos

Hello Hien,

Check if the directory K:\db2\P01\sapdata4 exists and its not empty. Looks like the command can't find the DB, this could happen if there is a problem accessing storage or the directory is offline.

Speak to your OS admins to check if the node (cluster node) is offline etc.

Regards,

Siddhesh

former_member185954
Active Contributor
0 Kudos

Hello Hien,

Can I also ask if everything is working at the moment ? Is SAP application up, it would be stupid of me to ask this after I have given you suggestions to check the DB is offline,  but I thought i'll check.

Since, If SAP is up and you are attempting to reset password at DB level, are you sure you are on the correct node ?

Regards,

Siddhesh

manumohandas82
Active Contributor
0 Kudos

Hi Hien ,

Have you logged on as db2<sid> user  ? also log into the database server

If not login as db2<sid> user /server   and try once again

also before  executing any commands on the db , execute the following

db2 connect to <SID >

Thanks ,

Manu

jerryhien
Explorer
0 Kudos

Thanks you for your answer. how can i find the <sid> Manu Mohandas ?

manumohandas82
Active Contributor
0 Kudos

Hi  Nguyen ,

SID is your SAP System Name   .   You could find it from your logon pad , profile directory , environment file etc .

Thanks ,

Manu