HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

file owner change after restore oracle files

 
Fauziah Mahdan
Super Advisor

file owner change after restore oracle files

HI all,
I have backup filesystem belongs to oracle.
At DR site I create this oracle user and then u01 folder.
After restore the u01 contents I found out the owner was sshd and group remain oinstall.
Can inform me why this happend?
I have manually change the owner but when bring up db, internal error appear.
12 REPLIES
R.O.
Esteemed Contributor

Re: file owner change after restore oracle files

Do you backuped the FS in a system and restored in another system?. If so, the oracle user in the destination system might have a different uid than the uid in the source system. The uid in source system might be the same than the sshd user in destination system.
Remember the system works with uid-gid, not with user-group names.

Regards,
"When you look into an abyss, the abyss also looks into you"
Fauziah Mahdan
Super Advisor

Re: file owner change after restore oracle files

Yes I backup using FS it is only oracle binary file I did cold backup to be save.
Ok yes the server is totally diff server that is why I have to create oracle id.
I will check the uid now.
But how to get the same uid? Can it be changed?
R.O.
Esteemed Contributor

Re: file owner change after restore oracle files

Hi,

Well, you can specify the uid when creating the new user with "useradd". If it is already crreated, you can modify it when "usermod". See "man usermod":

"Change otto's user ID to 333 and change the login name to bob.

usermod -u 333 -l bob otto"

In yor case, I think you have to change the uid for user "sshd" first, to release the uid you want for "oracle" user and then change the uid for "oracle" user.

Regards,
"When you look into an abyss, the abyss also looks into you"
Fauziah Mahdan
Super Advisor

Re: file owner change after restore oracle files

ok let me try first.
Thanks
R.O.
Esteemed Contributor

Re: file owner change after restore oracle files

Hi,

You can do it also with SAM. I think "usermod" change the files owned for the uid changed and SAM do it for sure. This is what it says when you change a user id:
------------------------------------------
You are changing the UID for user "userX" from "111" to "222". The
password file will be updated to reflect this change.

The UID is used to determine user file ownership. Would you like to
run a background task on this system to update all files owned by
this user to the new UID?
------------------------------------------

Regards,
"When you look into an abyss, the abyss also looks into you"
Fauziah Mahdan
Super Advisor

Re: file owner change after restore oracle files

I have check in DR oracle in prod and DR are same uid =106.

But why it chnage to sshd?
Confuse
Steven Schweda
Honored Contributor

Re: file owner change after restore oracle files

> I have backup filesystem belongs to oracle.

Backup HOW, exactly?

> After restore [...]

Restore HOW, exactly?


> Can inform me why this happend?

I don't even know _what_ happened yet.

> But why it chnage to sshd?

That might depend on what you did (which is
a mystery).
Bill Hassell
Honored Contributor

Re: file owner change after restore oracle files

The name oracle is nothing more than an alias to the user ID number and the only location where oracle and the UID are connected is in the /etc/passwd file. When you build a DR center, one of the first things to do is to duplicate user ID's so the names will match up. Your backup program (tar, cpio, fbackup...) save the files as they are stored on disk -- the user name is only shown when you use a translator such as ll which takes the UID number on disk and gives it a name from the passwd file.

You will find that your passwd file on production is quite different than the one at DR. That will have to be fixed before you restore additional files and directories.


Bill Hassell, sysadmin
Fauziah Mahdan
Super Advisor

Re: file owner change after restore oracle files

Ok the OS at DR not restore via make tape recovery from prod server.
It was installed using CD.
Then I create oracle user, install patch required, create lvol for oracle like u01, u02.
Restore FS from Data Protetor (backup also using DP).

Bill should I copy the etc/passwd from pord to DR?
Horia Chirculescu
Honored Contributor

Re: file owner change after restore oracle files

>should I copy the etc/passwd from pord to DR?

If you want to keep the same UIDs for the owners of the files from your filesystems, then yes, you must restore also /etc/passwd or at least you must keep the same UIDs for the same user names (edit /etc/passwd from the new - restored system to actually have the same UIDs as the old one - of course and to have all the relevant users from the previous system)

Do not forget to restore also the /etc/group file!

You must also have the same groups...

Best regards,
Horia.
Best regards from Romania,
Horia.
Fauziah Mahdan
Super Advisor

Re: file owner change after restore oracle files

Hi all,
OK update from the case.
At first when I check the oracle at Prod and DR same uid 106.
After restore from Data protector all oracle file owner appear as owned by sshd but the group remain as oinstall.
DB failed to start

Then I change sshd uid make it diff uid and make sure oracle is 106. Restore oracle and db files the owner now remain as oracle and group as oinstall db can't up.

Then I run another round of cold filesystem backup for oracle and Database from prod.
Restore to DR and make sure owner remain as oracle and then only db can UP.

Conclusion
1) uid and gid is important from backup server into restore server -2 diff servers(in this case prod & DR server)
2) backup file might be corrupted or retention expired even though we have set it to expired for 2 months. Thanks all
Horia Chirculescu
Honored Contributor

Re: file owner change after restore oracle files

>uid and gid is important from backup server into restore server

Of course they are important.
This information is kept together with the backup.

>backup file might be corrupted or retention expired even though we have set it to expired for 2 months.

What will be the link between corruption and expiration ? Of course a backup file can be corrupted even it is expired (if it is still on disk and was not deleted)

Horia.
Best regards from Romania,
Horia.