|
Re: Create DB Script [message #647575 is a reply to message #647574] |
Wed, 03 February 2016 02:23 |
John Watson
Messages: 8964 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
THis sounds like a shell scripting problem, rather than an Oracle problem. You might want to go to a Windows forum instead of here.
However, to get any help you need to show what actually happens when you run the script. Use copy/paste from a cmd prompt window, and please enclose the text in [code] tags, as described here, How to use [code] tags and make your code easier to read What you have posted so far does not make it clear what command line arguments you are passing to the script.
[Updated on: Wed, 03 February 2016 02:24] Report message to a moderator
|
|
|
|
|
|
|
Re: Create DB Script [message #647580 is a reply to message #647579] |
Wed, 03 February 2016 02:53 |
gazzag
Messages: 1119 Registered: November 2010 Location: Bedwas, UK
|
Senior Member |
|
|
gazzag wrote on Wed, 03 February 2016 08:24What does the following yield?
C:\> dir C:\oracle\admin\DB_name\scripts
|
|
|
|
|
|
Re: Create DB Script [message #647587 is a reply to message #647585] |
Wed, 03 February 2016 04:45 |
gazzag
Messages: 1119 Registered: November 2010 Location: Bedwas, UK
|
Senior Member |
|
|
So is your database name intsaas4 or "DB_Name". Your posts are not consistent. You have to show us a complete session from start to finish by Copying & Pasting it here.
|
|
|
Re: Create DB Script [message #647589 is a reply to message #647574] |
Wed, 03 February 2016 06:35 |
|
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
Yud_m wrote on Wed, 03 February 2016 02:11Hello,
I am trying to make a script to add Databases.
Each time the Database name should come from a parameter.
I generated a script but it it is not working.
Attached is the batch and the errors:
C:\ora>C:\oracle\product\12.1.0\dbhome_1\bin\oradim.exe -edit -sid DB_name
rtmode auto -srvcstart system
C:\ora>C:\oracle\product\12.1.0\dbhome_1\bin\sqlplus /nolog @C:\oracle\admin
saas4\scripts\intsaas4.sql
In the last line above, you appear to be telling sqlplus to execute a script named 'intsaas4.sql', located in directory C:\oracle\admin\saas4\scripts.
It also appears you did not copy and paste, but transcribed, as - even allowing for autoatic line wrap, you are missing the '\' between 'admin' and 'saas4'. Therefore the above, as you've presented it is not even a valid sqlplus command line.
Quote:
SQL*Plus: Release 12.1.0.2.0 Production on Mon Feb 1 12:18:15 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
SP2-0310: unable to open file "C:\oracle\admin\DB_name\scripts\intsaas4.sql
SQL>
but the error message indicates you told sqlplus to execute intsaas4.sql, located at 'C:\oracle\admin\DB_name\scripts\'
This is not the same location you indicated at the supposed command line you showed us. So from that we know without a doubt that you are not using copy and paste to show us exactly what you did and exactly what resulted. Therefore, we can't really trust anything you showed us.
Also, if you have installed Oracle, then the directory "C:\oracle\product\12.1.0\dbhome_1\bin" should already be in your PATH and it is not necessary to fully qualify the names of your executables.
For example, instead of
C:\ora>C:\oracle\product\12.1.0\dbhome_1\bin\oradim.exe -edit -sid DB_name
rtmode auto -srvcstart system
C:\ora>C:\oracle\product\12.1.0\dbhome_1\bin\sqlplus /nolog @C:\oracle\admin
saas4\scripts\intsaas4.sql
you can specify simply
C:\ora>oradim.exe -edit -sid DB_name
rtmode auto -srvcstart system
C:\ora>sqlplus /nolog @C:\oracle\admin\saas4\scripts\intsaas4.sql
And none of this has anything to do with knowing Oracle. It is all fundamental pc knowledge ....
|
|
|