Reputation: 1
How can I create a new database in oracle12c? I started the oracle using the command sqlplus "/as sysdba".then i tried to create a new database.For that use the command create database.When I give that query and press enter then a number 2 is displayed and nothing happens.I don't know what to do next?
Upvotes: 0
Views: 434
Reputation: 2098
Actually, you can create a database via SQLPlus; I do it all the time; what is happening to the user with the question, is he is entering just part of the create database command, hitting ENTER, and then SQL*Plus displays a "2" meaning it is ready to accept line 2 of the command. SQLPlus will not run the commands until you enter a ";" at the end of a line and press ENTER, or a "/" and press ENTER as the first character on last line.
What you can do is to create an initialization file, say /u01/app/oracle/product/12.1.0/dbs/initbadint1.ora, that might look something like this:
control_files = (/u02/oradata/badint1/badint1control01.ctl,
/u03/oradata/badint1/badint1control02.ctl,
/u04/oradata/badint1/badint1control03.ctl)
diagnostic_dest = /u01/app/oracle/admin/badint1/ddump
db_block_size = 8192
db_name = badint1
and then look at
http://docs.oracle.com/database/121/SQLRF/statements_5005.htm#SQLRF01204
for the full syntax of the create database command.
Then invoke the following in SQL*Plus:
startup nomount pfile=/u01/app/oracle/product/12.1.0/dbs/initbadint1.ora
create database "badint1"
controlfile reuse
maxlogfiles 32
maxdatafiles 1000
-- rest of commands go here ...
;
Once you enter the semicolon and press enter, then Oracle will create the database.
Once that is done, then invoke the following, one at a time, to set up the data dictionary:
@/u01/app/oracle/product/12.1.0/rdbms/admin/catalog
@/u01/app/oracle/product/12.1.0/rdbms/admin/catproc
Upvotes: 1
Reputation: 6486
All the databases have to be created with Database Configuration Assistant, it is possible to create in both command line and GUI interfaces. Also Oracle Corp. strongly recommends to use this tool to create databases.
PS: try to google next time you have a question, its is really easy, I found this after 5 sec I started the search
Upvotes: 0