alter session set "_ORACLE_SCRIPT"=true -> insufficient privileges [message #675306] |
Thu, 21 March 2019 13:17 |
|
a100
Messages: 34 Registered: March 2019
|
Member |
|
|
Hello,
forgive my ignorance - I am total noob with Oracle ...
I have just created Oracle 12.2 in AWS for dev/testing purposes and connected to it using the admin account.
I am trying to run the following:
alter session set "_ORACLE_SCRIPT"=TRUE
create user ...
but gets the following error - does anybody know why ?
Reason:
SQL Error [2097] [42000]: ORA-02097: parameter cannot be modified because specified value is invalid
ORA-01031: insufficient privileges
|
|
|
|
|
|
Re: alter session set "_ORACLE_SCRIPT"=true -> insufficient privileges [message #675310 is a reply to message #675308] |
Thu, 21 March 2019 15:28 |
John Watson
Messages: 8960 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
a100 wrote on Thu, 21 March 2019 20:05I couldn't create any account on 12.2 and after googling I found this solution.
I need to have a consistent way (Python script) to create database accounts for both Oracle 11.* and 12.*.
Is there any another way ? You cannot have a "consistent" way because your 12.x database is a multitenant database, which did not exist in 11.x.
|
|
|
|
|
|
|
|
|
|
Re: alter session set "_ORACLE_SCRIPT"=true -> insufficient privileges [message #675324 is a reply to message #675320] |
Fri, 22 March 2019 03:52 |
|
a100
Messages: 34 Registered: March 2019
|
Member |
|
|
if dsn and sid and not service_name:
dsn = cx_Oracle.makedsn(dsn, conn.port, sid)
conn = cx_Oracle.connect(conn.login, conn.password, dsn=dsn)
elif dsn and service_name and not sid:
dsn = cx_Oracle.makedsn(dsn, conn.port, service_name=service_name)
conn = cx_Oracle.connect(conn.login, conn.password, dsn=dsn)
else:
conn = cx_Oracle.connect(conn.login, conn.password, conn.host)
This code presents many ways to connect to Oracle. Which one is the connection to PDB ?
|
|
|
|
|
|
|
|
|
|
Re: alter session set "_ORACLE_SCRIPT"=true -> insufficient privileges [message #675343 is a reply to message #675340] |
Fri, 22 March 2019 06:12 |
|
a100
Messages: 34 Registered: March 2019
|
Member |
|
|
Hi John,
I used AWS GUI to create this DB and I really don't remember I was asked any PDB-related question. I would say I am 100% sure I wasn't but ... you know.
The `PDB` word would trigger some bell in my mind but when you and Michel asked me about it I was lost ...
Thank you for the select:
I remember I was asked for this "ORCL" but it was kind of default name for DB and I didn't know about any PDB ...
Believe me if we had Oracle DBA I wouldn't ask you those questions - our software just supports Oracle as one of the databases but we don't really use it in production.
[Updated on: Fri, 22 March 2019 06:12] Report message to a moderator
|
|
|
|
|
|
Re: alter session set "_ORACLE_SCRIPT"=true -> insufficient privileges [message #675347 is a reply to message #675346] |
Fri, 22 March 2019 07:39 |
|
a100
Messages: 34 Registered: March 2019
|
Member |
|
|
import cx_Oracle
...
dsn = cx_Oracle.makedsn(args['--server'], args['--port'], args['--dbname'], service_name=args['--dbname'])
print('dsn: {}'.format(dsn))
...
connection = cx_Oracle.connect(args['--dbadmin'], args['--dbadminpass'], dsn)
...
It does work for AWS (RDS) and doesn't for Oracle in Azure:
dsn: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521))(CONNECT_DATA=(SID=ORCLCDB)(SERVICE_NAME=ORCLCDB)))
Traceback (most recent call last):
File "/db.py", line 105, in <module>
main(args)
File "/db.py", line 68, in main
connection = cx_Oracle.connect(args['--dbadmin'], args['--dbadminpass'], dsn)
cx_Oracle.DatabaseError: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
|
|
|
|
Re: alter session set "_ORACLE_SCRIPT"=true -> insufficient privileges [message #675349 is a reply to message #675348] |
Fri, 22 March 2019 08:10 |
|
a100
Messages: 34 Registered: March 2019
|
Member |
|
|
This is Oracle running in Docker container (the official Oracle docker image):
$ lsnrctl service
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 22-MAR-2019 13:06:51
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=0.0.0.0)(PORT=1521)))
Services Summary...
Service "83e7c9a565ff015be0530400000a92a7.localdomain" has 1 instance(s).
Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:47317 refused:0 state:ready
LOCAL SERVER
Service "ORCLCDB.localdomain" has 1 instance(s).
Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:47317 refused:0 state:ready
LOCAL SERVER
Service "ORCLCDBXDB.localdomain" has 1 instance(s).
Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: myhost, pid: 141>
(ADDRESS=(PROTOCOL=tcp)(HOST=myhost.fqdn)(PORT=45017))
Service "orclpdb1.localdomain" has 1 instance(s).
Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:47317 refused:0 state:ready
LOCAL SERVER
The command completed successfully
|
|
|
|
|
|
|