I am trying to build Olap. While building an error has been occurred. First of all, I downloaded olaptrain schema, then I opened a command prompt on the olaptrain folder, then I logged on sqlplus with sysdba. After that, when I Write "#Install_olaptrain", I got an error "ORA-01919 role Olap_User Not Exist". What is the source of error? How can we create that role? Error
Well, creating a role is a simple task:
create role olap_user;
but I'm not sure it is the way to go. I'd expect the script to contain all info it needs to complete successfully (which includes the abovementioned create role). Anyway: create it, it won't do any harm, but might help.
Related
I am trying to create a new user from Oracle SQL Developer. I made a connection with the user Sys and the password that I entered in the installation of Oracle Database XE 18c.
When creating the user I get the error ORA-65096, I have searched the internet and the solution I found is to write the following:
alter session set "_ORACLE_SCRIPT" = true;
However, I want to know if it is possible to create the new user without using any SQL statement or script and do it from the Oracle SQL Developer interface, do I have to login with a different user than Sys to create a new user? or what do I have to do? Could someone give me a detailed explanation please. I am learning how to use this database and I want to try to understand what I am doing.
oerr ora 65096
65096, 00000, "invalid common user or role name"
// *Cause: An attempt was made to create a common user or role with a name
// that was not valid for common users or roles. In addition to >the
// usual rules for user and role names, common user and role names
// must consist only of ASCII characters, and must contain the >prefix
// specified in common_user_prefix parameter.
// *Action: Specify a valid common user or role name.
This implies that you are connected to the root container instead of to a regular plug in database (pdb) where applications should be built. The solution for you is not to overrule setting to enable building an application in the root container but to connect to the pdb that has been made to host your application.
you can check the available pdb's by viewing v$pdbs. The special pdb cdb$root is as the name already tries to tell, the root container. show PDBS will give similar output.
Using alter session set container = [pdb_name]; can be used to switch to your container of choice where regular rules apply.
Even better is to directly connect to that pdb using sqlnet.
I've been fighting against oracle sql developer for about two days and I just can't get the thing to work.
I would like to learn more about data mining and take a look at their examples and work threw their tutorials, but I cant even get the thing setup.
What I did:
Installed Oracle 12_1 database + oracle_examples.
I then created an administrator account via the oracle sql developer.
connection name: admin
username: sys
password: password
Role: sysdba
SID: orcl
Everything else was left as it is.
I then had to install all the example .sql files manually.
I followed the guide from here: Oracle Install Example Schemas
I did everything exactly the same as the guide told me to do, except I had to do this "hack" command which allowed me to create users. Else I would always get the
ORA-65096: invalid common user or role name
alter session set "_oracle_script"=true;
The new users now show up in every connection that I create in my SQL Developer under "other users". (HR, OE, etc..)
Now I created a new user "dmuser" like the guide told me to do here: (yes - with sql plus)
Oracle create a datamining user
Now I wanted to install the data miner repo. Which should be very easy:
Tools, data miner, make visible. And the data miner window showed up. I then added my dmuser connection, double click dmuser to install the data miner repository. I then press start to install the repo and then it says "Task Failed" with the MOST useless error message I have ever seen:
anonymous block completed
anonymous block completed
Drop public synonyms created by ODMRSYS.
anonymous block completed
anonymous block completed Total Number of Objects: 0
Total Number of Objects Dropped: 0
Total Number of Objects Failed to Drop: 0
Can anyone help me resolve this issue? My guess would be that the "hack" command which I used to create all the users messed something up, but I'm not sure. I'm very new to Oracle, so I have no idea what I'm actually doing here, so please have some mercy on me.
Thanks in advance.
Hope someone can fix this mess.
Aight, be prepared for a complicated answer...
Sql developer exectues a .sql file to install the data miner repo.
The sql is named "installodmr.sql". Found the info here:
Install repo by script
I had a look at the script and what it does. It opens more scripts which insert tables, and users and grant privileges etc...
The problem why the script would not execute correctly was due to a couple of reasons.
1) As mentioned in my question, I can't just create a user, I have to type the command:
alter session set "_oracle_script"=true
The script calls other scripts that then want to create user, which in my case was not allowed and caused the ORA-65096 error.
So I had to insert the alter ... command before the script called another .sql file.
2) The path to the .sql files was not correctly set and it could not find the files which caused problems. They where referenced like this:
##file.sql
I changed it to the direct path:
#C:\Oracle\product\12.1.0\home\sqldeveloper\dataminer\scripts\file.sql
I let the script run and it worked.
Now data miner repo is installed.
Wuhey! :)
My questions is as follows:
I am trying to create a script which will execute in sqlplus and what this script will do is that i will have a file in which you can write inside 1 name on every line. So i wanted to use an Associative Array in which i will read the contents of the file line by line (1 name on every line) and store every name in the array.
My problem is that i cannot use the UTL_FILE package which has a ready GET_LINE procedure to get the name of every line because it has to take as argument a "Logical Directory" of Oracle.
My issue is that i cannot make changes to the database like to create a new directory or use one of the default directories for the in file. I have to come to a solution in which i will read the contents of the file from a physical location.
I am kindly asking for some assistance in 2 fields. If you can please help me if you know any other package which can work on a physical location or if know any other way in which maybe i can call sqlplus (sqlplus username/pass #myscript) and give there as an argument the input file or like initialize the array from there.
Thank you in advance.
Any help would be highly appreciated
George
Clearly the best solution is to use UTL_FILE or external tables. So not being able to change the database is a major problem. If you don't have the permission to create a directory object and you cannot persuade a privileged user to do so on your behalf, then your question basically becomes
"How can I circumvent the security restrictions imposed on the database?"
Well, there are two possibilities.
If the DBAs have been careless enough to enable the UTL_FILE_DIR parameter in the init.ora file you may still be able to use UTL_FILE, by passing an absolute file path to FOPEN().
Alternatively, you can write a Java Stored Procedure to interact with files on the OS. This requires privileges to be granted through the Java security model. Find out more. Again, you will only have this without asking if you have lax DBAs.
Let me make it clear, both these "solutions" are grey hat. You really should try to get the necessary privileges through the proper channels. If the DBA team won't create a directory are you can use you need to escalate it to your boss.
If you cannot make any change to the database and the existing database does not provide you the privileges you need, you're out of luck.
UTL_FILE either requires the presence of an Oracle directory object that points to a physical directory on the database server that you have privileges on or that you are using a physical directory that you have been given access to via the deprecated UTL_FILE_DIR parameter. It appears that you are stating that neither of these is a viable option. If that is the case, you cannot use UTL_FILE.
You could also create an external table that would read data from a file. That would require that you could create the Oracle directory object and the external table. Again, it sounds like you are saying that is not an option so external tables are out.
You could write a Java (or .Net if you're on Windows) stored procedure that would read from the file. That would require that you create the procedure and that you grant the owner the necessary file system privileges. It sounds like you're saying this is also not an option so Java stored procedures are out.
If you move the file to the client machine, you could use SQL*Loader on the client machine to load the data into a table in the database. That would require that you create a physical table in the database, though, which it sounds like you are saying is not possible. So SQL*Loader is out.
If you can move the file to the client, you could obviously write a program in whatever language you would like to read the file and build whatever PL/SQL block you'd like. But that won't work for files stored on the database server barring some sort of very odd permissions grants where your client machine can somehow mount a directory on the server.
So we're back to where we started. Reading a file from the server's operating system requires privileges to be able to read that file. You seem to be saying that you do not have and cannot get those privileges. Therefore, you're saying that you can't do what you want. Whoever in your organization is asking you to implement this change needs to talk with whoever is preventing you from getting the privileges you need to do your job. One of them needs to give ground.
I am trying to get over with DBMS_PROFILER, but I face a problem, that I can't get through.
I followed the tutorial on this page:
http://www.oracleflash.com/44/Write-fast-and-efficient-PLSQL---DBMS_PROFILER.html
and everything was fine till I did not change the user. When I run the profiler as the owner of the code, all the statistics are fine, but when I run those procedures as a different user (that of course has EXECUTE permissions) I can see only "ANONYMOUS" in profiler tables.
I found something looking around in the internet, and performed these actions:
I granted execute permissions for user calling procedures,
I also granted DEBUG permissions,
I compiled procedures for DEBUG,
I have checked that code is "INTERPRETED" and not "NATIVE",
finally, calling user also have CREATE PROCEDURE privilege.
Nevertheless, it still doesn't work. The problem is I want to profile application, that is running code as a different user, so I cannot change that. Any ideas what should I do, and why it is not working?
Problem solved. The doc says (in security section) that you need to have privileges to create objects that you want to monitor. I wanted to monitor package in other schemas, so at first I thought I need CREATE PROCEDURE privilege which didn't help. In fact, you need to have privileges to create specifically object you want to monitor, so you simply need to have CREATE ANY PROCEDURE for user from which you are running other shema packages.
You have tagged this question as Oracle 11g, in which case you are in luck. Oracle added a new profiler package, DBMS_HPROF. This is a hierarchical profiler, which means it can drill down into different schemas. Find out more.
I want to create the user and the database within that user. But when I tried to create database its giving the warning message as
ERROR at line 1:
ORA-01501: CREATE DATABASE failed
ORA-01100: database already mounted
Then I tried
STARTUP NOMOUNT;
Its giving the warning message for insufficient privileges even I have given all the permission to that particular user.
Can any one please help in finding the solution for this?
You don't create a database under a user in Oracle; I believe you're using terminology from another database poduct. The equivalent is a schema, which is a logical container for a group of objects. User and schema are essenentially synonymous in Oracle - when you create a user is automatically has its own schema.
You create the database once (which you already seem to have done, or had done for you), then create as many schemas/users as your application needs. You don't ever rerun the create database under normal circumstances - you certainly wouldn't as a normal user.
If you connect as that user you will be able to create tables, views, packages etc., assuming it has really been granted all the necessary privileges.