Northwind Database Installation Error: Msg 2812, Level 16, State 62, Line 1 Could not find stored procedure 'U' - northwind

I am trying to install the sample Northwind Database from the file Northwind.sql. When I run the script on SQL Server Express Management Studio I get an error message that says:
Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'U'.
I have searched the net but cannot find an easy to follow means of resolving it. Any ideas, please? I am using Windows 8/SQL Server 2012 Express.

Based on the answer by Microsoft here it need to use alter database instead.
open the script and comment following 2 lines.
exec sp_dboption 'Northwind','trunc. log on chkpt.','true'
exec sp_dboption 'Northwind','select into/bulkcopy','true'
and then add the following line below that
alter database Northwind set recovery simple
so that it will look like this:
-- exec sp_dboption 'Northwind','trunc. log on chkpt.','true'
-- exec sp_dboption 'Northwind','select into/bulkcopy','true'
alter database Northwind set recovery simple

SOLVED!
I Created a Database with the name Northwind (CREATE Database Northwind)
Opened the northwind.sql in Notepad
Copied it unto the SQL Server Management Studio
Executed the query (ie 3 above)
And that's it...
I hope that other users will find this entry useful. I have searched/spent over 6 hours trying to figure this out.

To second Sylva's solved answer above, you have to execute "CREATE" first then if you want to update, then you'll have to execute "ALTER".

Related

ora-65090: operation only allowed in a container database

I am not able to run any query to change to CDB or PDB in SQL plus it shows the above error.
For instance I tried running the query
Alter pluggable database open
and got this error.
ERROR at line 1:
ORA-65090: operation only allowed in a container database
The correct command to change Container is
ALTER SESSION SET CONTAINER = containername;
If you are getting error then you must not be a privileged user
follow up this link for more information
https://docs.oracle.com/database/121/ADMIN/cdb_pdb_admin.htm#GUID-E73BCAED-FF57-474A-A8C5-207D3F465413
I solved it. Though the solution is not a preferable one but it worked for me as of now. I used Database configuration assistant and deleted the pdb in which I getting connected to when logging using sqlplus. I would appreciate some proper solution to this.

Oracle SQL Developer - Data Miner Repo - Task failed

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! :)

Oracle SqlDeveloper - Translate TSQL to PLSQL

Oracle documentation for SqlDeveloper talks about a command line interface to perform different operations. I am interested in migration utility and translate action.
https://docs.oracle.com/cd/E39885_01/appdev.40/e38414/intro.htm#RPTUG46002
When I try to run the below command to translate a MS SqlServer (TSQL) to Oracle (PLSQL). I always get an error. However, I am able to translate just fine using Tools > Migration > Scratch Editor.
Command:
sdcli migration -actions=translate -file=D:\Sdcli\Input\One.sql
-translator=sqlserver -output=D:\Sdcli
One.sql file contains
select * from someTable
Output:
Error:null
capture, convert, datamove, delcaptured, delconn, delconverted, driver, generate, guide, idmap, info, init, lscaptured, lsconn, lsconverted, mkconn, qm, runsql, scan and translate
Note: I have tested with various permission levels so lack of permission is not the issue.
Please Help !!
Can you check the report_translator.txt and the log files in the log folder under your output directory? Can you provide the content of them?
If you don't find the output directory then it is a permission problem so the sdcli doesn't have the right to create the output folder.

Out of Memory Error : when executing Very Large Scripts in toad

I am using
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod &
Toad for oracle 10.6.1.3
when i try to run insert statement which is having around 84,000 + records, it is showing Out of Memory error. Here is the error image.
Any of you please suggest me, how i should execute this insert script in toad.
P.S : since toad is connecting to remote machine I'm not able to run it with SQLPLUS. If any one knows option to do that, please let me know.
If you need any more information, Please raise your hands in comment box i will provide you.
I got the same error when i want to execute sql script 70k rows.
But i solved it just like this.
Firstly
You should run it with sqlplus commands. Log in the sqlplus and run
this command
#scriptName.sql
Secondly (this is alternative)
You can use DBLINK in oracle.
As bpgergo suggested copy the sql file into remote machine using FTP, then open your SQLPLUS.
Follow this steps in SQLPLUS.
step 1 : change your current session using following query.
alter session set current_schema = Schema_Name;
Here, SCHEMA_NAME is schema name of your insert query table.
step 2 : Execute the sql script file using following query.
#{PATH}/FILE_NAME.SQL
Eg : #D:/oracle/script/FILE_NAME.SQL
Here, D:/oracle/script/ is the file available location and FILE_NAME is your sql script file name.
Now, It will work as expected.

Oracle XE 11g (windows 8) I can't connect to the Database (idle instance)

Hi I have problem with idle instance
When I trying:
sqlplus / as sysdba
I get result: Connected to an idle instance.
And when I try startup I get:
ORA-01078: failure in processing system parameters
ORA-01565 error in identifying file 'C:\oraclexe\app\oracle\product\11.2.0\server\dbs/spfileXE.ora
ORA-27041: unable to open file
ORA-04002: unable to open file
O/S-Error: (OS 2) File not found;
My system is Windows 8. Do you any idea how to solve it?
SOLUTION:
I have to startup using command:
startup pfile='<path to file>/init.ora'
and change all paths in init.ora where was
<ORACLE_BASE>
Thx for help
I've got that pain too.
To install Oracle XE you should login as local admin - NOT domain account.
This https://community.oracle.com/thread/2361291 made me happy :)
I just had the same problem.
You just have to start the setup to install the database as administrator.
After this and a reboot everything works fine.
I highly recommend reading the Oracle® Database 2 Day DBA manual, or hire a dba.
You are missing the init{ORACLE_SID}.ora, the parameter file which contains things like database name, controlfile locations. the init{ORACLE_SID}.ora is a text file that is edited with a regular text editor. This file can be converted to a spfile{ORACLE_SID}.ora that can be edited using a database instance. This is also a dynamic parameter file meaning that when you change parameters in an instance, the parameters can also be recorded in the spfile for later reuse.
For now add the db_name and control_files. Make sure that the contol_files parameter points to an existing controlfile[s]. If there are no existing control_file[s], just trash the initXE.ora, spfileXE.ora and start dbca, the Database Configuration Assistant and using that create a new database.

Resources