Create new database in SQL Plus or PowerShell [message #628771] |
Fri, 28 November 2014 05:37 |
|
pturner87
Messages: 3 Registered: November 2014 Location: United Kingdom
|
Junior Member |
|
|
Hi guys, I'm very new to Oracle and I have a question about creating a new database.
I'm investigating this at work because our software relies on a database which can be either SQL Server or Oracle, and we have set up provisioning for the whole system using PowerShell. The provisioning only supports SQL Server at the moment hence my question.
I've installed Oracle 12c Enterprise and chose the "install database software only" option. I've spent some time googling how to create a new database from this starting point, using SQL Plus or anything else that can run through PowerShell but I haven't figured it out yet. Can anyone please point me in the right direction?
I think I'll try setting up a database using Universal Installer just to see what files it creates; I think this is one of my problems i.e. the lack of a tnsnames.ora, and I can't even log into SQL Plus because I don't think a user name and password was set up in the Oracle installation.
Sorry if I seem completely clueless about this. Any help would be greatly appreciated.
|
|
|
Re: Create new database in SQL Plus or PowerShell [message #628779 is a reply to message #628771] |
Fri, 28 November 2014 06:57 |
|
EdStevens
Messages: 1376 Registered: September 2013
|
Senior Member |
|
|
Oracle provides a couple of other utilities to do what you want.
First, Oraclue Universal Installer (OUI) only installs the software. It does not create a database. Some people THINK it does because if make a selection to let it do so, it will (after installing the software) invoke the next utility ...
'dbca' (Database Configuration Assistant) is a GUI tool that will create a database after the software is installed.
You can configure your tnsnames.ora with another GUI tool, 'netca'.
None of what you want to achieve will be as simple as copying some files (implied by your statement "I think I'll try setting up a database using Universal Installer just to see what files it creates;".
If you need to script everything so as to not need to rely on an interactive process, you can make one run of dbca. At the end it will give you the option to simply generate the necessary scripts for creating the database. If you then need for those script to not have hard-coded database names, you can replace the hard-coded values with some identifiable tag, and work out a method of global search and replace on those tags.
In fact, make two trial runs. Once, selecting a 'generic' template (you'll see what I mean when you get there) and the other with a 'custom' template. Compare the scripts put out by the two.
For tnsnames.ora, use netca. Again, if you need a 'generic', replace the hard-coded values in the generated file will identifieable tags and proceed accordingly.
|
|
|
|
|
|
|
|
|
|
|