How to create the database using the command line?

Hi all

Win7
10g or 11g

I want to create a new database using a script.

I set up my new SID and oracle_home.

Then sqlplus / DBA.

then I execute a common script...
startup nomount;
create database PRODB
       logfile group 1 ('z:\oradata\PRODB\redo01.log',
                        'z:\oradata\PRODB\redo01b.log') size 50M,
               group 2 ('z:\oradata\PRODB\redo02.log',
                        'z:\oradata\PRODB\redo02b.log') size 50M,
               group 3 ('z:\oradata\PRODB\redo03.log',
                        'z:\oradata\PRODB\redo03b.log') size 50M,
               group 4 ('z:\oradata\PRODB\redo04.log',
                        'z:\oradata\PRODB\redo04b.log') size 50M
       character set AL32UTF8
       datafile 'z:\oradata\PRODB\sysPRODB.dbf' size 500M
       sysaux datafile 'z:\oradata\PRODB\auxPRODB.dbf' size 300M
       undo tablespace undo
               datafile 'z:\oradata\PRODB\undoPRODB.dbf' size 100M
       default temporary tablespace temp
               tempfile 'z:\oradata\PRODB\tempPRODB.dbf' size 150M;
@/opt/app/oracle/product/10.2.0/db_1/rdbms/admin/catalog.sql;
@/opt/app/oracle/product/10.2.0/db_1/rdbms/admin/catproc.sql;
connect system/manager;
@/opt/app/oracle/product/10.2.0/db_1/sqlplus/admin/pupbld.sql;
exit;



SQL> startup nomount;
ORA-12560: TNS:protocol adapter error
SQL> create database PRODB
  2         logfile group 1 ('z:\oradata\PRODB\redo01.log',
  3                          'z:\oradata\PRODB\redo01b.log') size 50M,
  4                 group 2 ('z:\oradata\PRODB\redo02.log',
  5                          'z:\oradata\PRODB\redo02b.log') size 50M,
  6                 group 3 ('z:\oradata\PRODB\redo03.log',
  7                          'z:\oradata\PRODB\redo03b.log') size 50M,
  8                 group 4 ('z:\oradata\PRODB\redo04.log',
  9                          'z:\oradata\PRODB\redo04b.log') size 50M
 10         character set AL32UTF8
 11         datafile 'z:\oradata\PRODB\sysPRODB.dbf' size 500M
 12         sysaux datafile 'z:\oradata\PRODB\auxPRODB.dbf' size 300M
 13         undo tablespace undo
 14                 datafile 'z:\oradata\PRODB\undoPRODB.dbf' size 100M
 15         default temporary tablespace temp
 16                 tempfile 'z:\oradata\PRODB\tempPRODB.dbf' size 150M;
I always hit it

SQL > startup nomount;
ORA-12560: TNS:protocol adapter error

But if I run it on Linux is good.


Help, please...


Thank you very much

zxy

yxes2013 wrote:

I want to create a new database using a script.

Suggestion. DBCA allows to generate the database model and use the option "+ Save as scripts + ' (no need to create the database).

In the scripts directory, there will be a couple of shell and SQL scripts to create the database. Use them as your CLI model for the creation of a custom database. (I guess that DBCA works the same on Windows as it does on Linux).

Another option, if you are using Oracle XE, is to copy ORACLE_HOME/bin/createdb.sh (probably a + .cmd on Windows) script and change for use. If you manually add non-XE features to the script (such as the installation of the Java virtual machine) If you want a database of SE or EE. (whereby DBCA scripts are a better answer).

Tags: Database

Similar Questions

  • How to run the command-line IDC services

    Hey guys,.
    is it possible that we can run IDC Services from the command prompt.
    all your pointers will be greatly appreciated.

    Kind regards
    Sicard

    Published by: stephane on March 9, 2009 07:26

    Hey sapan,.

    You can use IdcCommand to perform the services from the command line. The procedure is the following:

    1 create a text file with service calls, you want to do, the definitions are had in format:

    LocalData @Properties
    IdcService = UPDATE_DOCINFO
    dID = 1
    dDocName = 000001
    dDocType = MyType
    dSecurityGroup = Public
    dRevLabel = 1
    dDocAuthor = sysadmin
    dDocTitle = my title
    @end
    >

    (Note: for multiple entries in the file > is very important)

    2. run IdcCommand from the directory "/ bin" of :

    IdcCommand f image_update.hda u-l c:\idccommand.log sysadmin

    Options:
    f = with service definitions
    u = user to run as
    -l (lowercase L) = location for execution log

    There is more detailed documentation in the presentation of the Idc (idc_command_reference_10en.pdf) commands.

    Hope that helps,

    Andy Weaver - Software Consultant
    Fishbowl Solutions< http://www.fishbowlsolutions.com?wt.mc_id="L_Oracle_Consulting_amw">

  • How to create a database using Labview7.1, as library management system?

    I want to use labview7.1 to create a database as the system.but management library I don't know how to do it.could you show me how to make it happen?

    To run database queries, OR sell the database connectivity Kit. However, given that your version of LabVIEW is no longer supported, I don't know if you could buy it. Your other option is to use LabSQL. Two of them are based on ADO. The Toolbox mask some SQL commands low level but you can find plenty of tutorials SQL and should be able to get updated quickly enough. LabSQL is what I use in my LabVIEW applications.

    The effective creation of a database is usually done in the database environment itself (for example, you use Access to create a Jet database). It is not really related to LabVIEW at all and appropriate database design is a long topic. If you know the system database that you want to use, someone might be able to point to specific aid.

  • How to create the new line in actionscript 3

    I have this simple script that is supposed to take a comma to separate values from xml and transform into something similar to an unordered list if only I could get a '\n' to work. Here is my script.

    var dont_forget:Array = myXML... dont_forget [n]. Split(",");

    var d: Number = dont_forget.length;

    While (d-) {}

    detailsMovieClip_mc.dont_forget.text = ">" + dont_forget [i] + "\n\r";

    trace (dont_forget [d]);

    }

    When the trace is running it shows me the values so I know they are there. However, I see that the last value. How to create a new line as a 3?

    Use the appendText method.  By assigning the text using "=" you're crushing on each pass through the loop.

    detailsMovieClip_mc.dont_forget.appendText (' > '+ dont_forget [d] + "\n\r" ');

  • How to stop the command line defragmentation Vista 64?

    I started "defrag - v w" command line 15 hours ago and I think she's still going because I do not have a command line prompt and the hard drive light flashes quickly (and somewhat randomly).  Anyone know how to stop the defrag process command line without altering anything?

    Key does nothing and the Task Manager shows that defragmentation is running.

    The f

    CTRL-c should stop.

  • Create the command line for the Dump file without having to install additional tools

    I should automate the creation of dump files. It must to be command line and without installing tools such as ProcDumpTechNet.Microsoft.com/Sysinternals/dd996900, minidump or similar. I think that it is not a solution but if someone can help me.

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *
  • How to hide the command-line on the scrreen Vista Boot start?

    Equipped with Windows Vista.  Some had work done on my PC, and they ran a Vista repair to the problems.  Now when the computer starts, a few command lines appear on the screen until it dark.  Prefer not to see.

    In the old days, I would simply move the Echo Off before these lines in the autoexec.bat file.  Understand that Vista works differently in what concerns the autoexec.bat file.

    Hello

    This means that your computer is configured to boot from CD/DVD. There are 2 ways to avoid this screen.

    1. make sure that you start the computer with no CD/DVD in the drive.

    2. you will need to boot the computer into the BIOS and change the first boot of CD/DVD to hard drive device. To do this, you can contact the computer manufacturer and check.

    Warning: modification of the BIOS / semiconductor (CMOS) to complementary metal oxide settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk.

  • How to list the command line NETWORK card info

    All,

    What is the command that corresponds to ifcfg?  I need to clear all addresses MAC and stats for guys my network and I can't find a command to do so.

    Adam

    Looking just for ifconfig?

  • How to close the command line Simulator?

    Hello

    I need to automate the startup procedure and closing of the Simulator.

    At the present time, I am able to start, but do not know how to close it.

    Can anyone help on this? Thank you!

    I find a way to do it:

    fledgecontroller/session for partner = * / run = leave

  • Create shortcuts with the command line switches

    I have three versions of Word on my computer. (I know, I'm a masochist).

    There are times when I want to run one of them in safe mode. Those who get me if I run winword.exe /a in the run window let you guess.

    I know I can get it by including all the way, but it's a pain.

    I would like to make a few shortcuts in Windows that would do this for me. However, I don't know how to add the command line switches. I used to be able to properties (similar to editing a .pif file) but it doesn't seem to be an option.

    You * need to locate executable files and create each shortcut via right click on the executable file.  Shortcuts Microsoft Office may not be "real" classical shortcuts

    Right click and change the shortcut.  In the 'Target' box, add at the end command line switch.

    For example... I found the 64-bit Microsoft Office 2010 Word executable here:
    «"C:\Program Files\Microsoft Office\Office14\WINWORD."» EXE ".

    and created a shortcut on my desktop.  The "target", said:
    «"C:\Program Files\Microsoft Office\Office14\WINWORD."» EXE ".

    I added the / a that you pointed at the end, the target is now:

    «"C:\Program Files\Microsoft Office\Office14\WINWORD."» "EXE" /a

    In fact - the after typing all that above, I realized that there is a Microsoft Knowledgebase Article... Google worked and I do not use it.  Heh

    How to use the line switches of start command to start Word 2010, Word 2007, Word 2003, Word 2002, and Word 2000 (Method 2).

  • create the user from the command line

    I use Windows 7, I don't have a password reset disk and don't remember the password. How to create a user account from the comand prompt I can change the passwords?

    This has not answered my question. I could not connect. I found the answer and was able to activiate the account administrator hidden and solved the problem in this way.

    Thank you

    I'm intrigued by your answer, and here's why:

    • The subject of your message is 'create the command line user '. The answer I gave you will certainly do so.
    • If you had stated that you were unable to connect while I gave you a method to solve this problem.
    • Find your own solution, but you chose to keep it to yourself, depriving other people who might read this thread for your answer.

    If this happens again, then I recommend using a topic as "you forgot my password, can not connect" as this could summarize your situation in a sentence. Create an account from a command prompt has no relevance in your case.

  • Windows 7 does not recognize 'change' in the command line

    When you use the command line I try to go to edit to create and edit files, but windows 7 is not recongize edit as a command internal or external, why and how do to the command line editing window.

    The 64 bit version of Windows 7 is not the editprogram (but the 32-bit version only).

    You can run Notepad from the command line.

    Boulder computer Maven
    Most Microsoft Valuable Professional

  • 'For' the command line in the file Tab does not work in Task Scheduler

    I am able to do my work of script .bat with 'echo' and 'set' command in the file lines beats using raykor suggestion to put the .bat file in program/script and put the path in the field "start in". However, 'for' command line stops all other lines in order to run.  Please see the below script. Please help how to do the command line 'for' to work. I need to add the date and time for the name of the file/folder to keep track of a copy of the file on each day. This script works perfectly when I run a line by line at a time on the CMD command prompt. He copied the files and folders and gave me the date and time and concatenated to the name of the file/folder. The first 2 lines do not work. If I delete the first 2 lines, it works fine.

    for /f "Tokens = 1, 2, 3, 4 * Delims = /" %i IN ('date/t'), set dt = %i %k %%j
    for /f "Tokens = 1, 2 *" %i in (' / time t ") set tm = - %i %j
    Set tm = % tm: =-%
    set the TNT = % dt % % tm
    echo copy backup set: % of DTT.
    ECHO please wait...
    Robocopy s:\data2 d:\testBackup\data2 /e /mir /np /tee /log:"c:\users\myusername\desktop\backup_log.txt.
    echo of finishing.

    Hello

    I apologize for the delay in responding to this post.

    The query is better suited in the following TechNet Forum, asking to view the query to get a solution to this problem.

    http://social.technet.Microsoft.com/forums/en-us/home?Forum=iTCG

  • How to add the new line 'Total' to a report?

    Hello

    I built a report within the region. I can get the total by checking the 'sum', but I need the word 'total' showing on the same vintage with the total amount. How can I achieve that? or in any different way how to create the new line to show total?

    Source debit credit

    A 45 44

    45 56 B

    90 100

    Thank you

    Victor

    Hello

    For the classic report show the sum.

    Go to the report attributes and click the box check the amount that you want to total.

    If you still face any problem-

    Please go to the

    http://Apex.Oracle.com/

    Workspace - WS_SUNITI

    User name: Test

    Password: 1234

    82863 application ID.

    Name of the tab - PSVANS3

    Page no 5

    Kind regards

    Director

  • How to create the user account using the command?

    How to create the user account using the command?

    Open cmd as administrator, and then type the following commands one after the other

    NET user / add program mypassword
    net localgroup administrators program / add
    net share concfg * C:------/ grant: program, complete
    This will create a user account with the name "Program" and the password "MonMotpasse".

    You can create the user name and password of your choice.
  • Hello, how is it possible to create the FAT32 BOOTCAMP on CoreStorage partition via the command line interface?

    Hello, how is it possible to create the FAT32 BOOTCAMP on CoreStorage partition via the command line interface?

    I mean ' diskutil cs * " and so on..."

    Yes, you must use the resizeStack command. Please see Re: how to repair fsck "your drive could not be partitioned..." Bootcamp does not as an example.

Maybe you are looking for

  • How can I stop my list of exceptions of the cookie to be changed programmatically?

    I never accept cookies from Firefox, and I have a list of exceptions specifically allowing cookies from sites of my choice. Problem is this exception list is somehow expanded with sites that I didn't understand, and in some cases, the sites that I've

  • Tecra M9 - no power orange light error code sequence

    Hello I have a Tecra m9 laptop and when I try to turn it on, it blinks with a light orange in this sequence: 6 short flashes, short 1 long blink, 1 blink, a ditch, and then it repeats. Does anyone know what is the problem?Any advice would be greatly

  • SW3 return does not

    My wife was in a talkshow viewers and got one of them (more some other stuff) as a prize. She gave it to me and I think it worked for about three weeks before he started acting glitch.  I had connected it to my computer to charge and when I took it I

  • BlackBerry smartphones can not connect BlackBerry Pearl 9105 for PC

    Hello world I have the following problem: After using my BB Pearl 9105 for almost 3 years, I can not connect to PC more (I still menu with choice of 3 options on my smartphone when I connect, but when I click on that option "usb" or "charge", the men

  • Cannot add prices with decimals in BCC with the language of the user in Swedish

    HelloWe use the ATG 10.2In BCC-> access control, I changed the local preference for Swedish adminNow, if I want to add the price for any SKU as 10.2, I am unable to do so. It does not enter the dot characterI created the price list with the locale as