Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setPassword oracle-19c does not compute container name #361

Closed
vecin2 opened this issue Apr 8, 2021 · 3 comments
Closed

setPassword oracle-19c does not compute container name #361

vecin2 opened this issue Apr 8, 2021 · 3 comments
Assignees
Labels

Comments

@vecin2
Copy link

vecin2 commented Apr 8, 2021

I have to make the folloing change in the setPasword.sh for my container name to be picked up:
ORACLE_PDB="ls -dl $ORACLE_BASE/oradata/$ORACLE_SID/*/ | grep -v pdbseed | awk '{print $10}' | cut -d/ -f6"
Changed to:
ORACLE_PDB="ls -dl $ORACLE_BASE/oradata/$ORACLE_SID/*/ | grep -v pdbseed | awk '{print $9}' | cut -d/ -f6"
This is because the path is the 9th column not the 10th:

[oracle@oracle-19c-vagrant ~]$ ls -dl $ORACLE_BASE/oradata/$ORACLE_SID/*/ | grep -v pdbseed
drwxr-x---. 2 oracle oinstall 104 Apr 6 12:44 /opt/oracle/oradata/ORCLCDB/ORCLPDB1/

This was my ./setPassword.sh output:

[oracle@oracle-19c-vagrant ~]$ ./setPassword.sh system
ORACLE_SID=ORCLCDB
ORACE_PDB=
The Oracle base remains unchanged with value /opt/oracle

SQL*Plus: Release 19.0.0.0.0 - Production on Thu Apr 8 10:04:04 2021
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL>
User altered.

SQL>
User altered.

SQL> ALTER SESSION SET CONTAINER=
*
ERROR at line 1:
ORA-65015: missing or invalid container name

SQL> ALTER USER PDBADMIN IDENTIFIED BY "system"
*
ERROR at line 1:
ORA-01918: user 'PDBADMIN' does not exist

@gvenzl gvenzl self-assigned this Apr 8, 2021
@gvenzl gvenzl added the database label Apr 8, 2021
@gvenzl
Copy link
Member

gvenzl commented Apr 8, 2021

Hey @PaulNeumann, do you wanna take that one on?

@PaulNeumann
Copy link
Contributor

PaulNeumann commented Apr 8, 2021

@gvenzl I'm happy to, but I'm confused. The setPassword.sh script in this repo already uses {print $9}, so it gets the 9th column, and the script works correctly. I'm not sure where {print $10} came from.

That said, I think there's a more robust solution that doesn't rely on parsing the directory names under $ORACLE_BASE/oradata/$ORACLE_SID. See my comment on #295. What do you think?

@vecin2
Copy link
Author

vecin2 commented Apr 8, 2021

@PaulNeumann good point, why was my setPassword.sh using {print $10} - I haven't made any change.

I'll rebuild the machine again just to be sure. I can close this issue for now.

Regarding your comment in #295, its not applying to me as I currently have only one PDB, but it's good to know.

@vecin2 vecin2 changed the title setPassword oracle-19c does not computes container name setPassword oracle-19c does not compute container name Apr 8, 2021
@gvenzl gvenzl closed this as completed Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants