0

I am new to creating an Oracle database using the command line. I am logged in as superuser; now I would like to create a new blank database, "mynewdatabase".

$ . oraenv

ORACLE_SID = [oracle] ? mynewdatabase

Is there a step-by-step example of how I can create a new database instance. Most of the examples I have found on the Internet show examples with a Windows environment and not Linux. Once I know how to create the new database environment, I can use ...

sqlplus / as sysdba

and begin working some database magic. Any assistance would be greatly appreciated!

4
  • 1
    use the documentation supplied by Oracle. Here is a tutorial. Start with dbca and not with sqlplus. – miracle173 Jan 18 '18 at 16:31
  • I am wanting to become familiar with using sqlplus and the command line to create databases. That was the purposes of me asking the question. – John Edward Law Jan 18 '18 at 16:37
  • if you want to learn how to use a screwdriver you should not start with assembling a car but try out simpler things. But anyway, here is the document: docs.oracle.com/en/database/oracle/oracle-database/12.2/admin/… – miracle173 Jan 18 '18 at 16:47
  • I echo the others. Start with the dbca gui as your first step. You want to learn to do it with sqlplus? I'll tell you what. I've been building oracle databases for over 20 years and cannot remember the last time I used sqlplus to do it. The details on how to get any GUI app (including dbca) on *nix will depend on how you are accessing the host. I always use an ssh client (putty) from my Windows desktop, so I have to have an xserver (xming) running on my desktop, and run my ssh with x11 port forwarding. Sounds more complex than it is. – EdStevens Jan 19 '18 at 12:15
0

I have not manually created a database since 7.3.4. You can use dbca in silent mode without x-windows.

Installing and Configuring Oracle Database Using Response Files

0

Please read https://oracle-base.com/articles/misc/database-configuration-assistant-dbca-silent-mode. oracle-base.com is one of the best Oracle database sites with a lot of examples for Oracle 10, 11, 12, 18, 19 in command line mode or with GUI tools.

0

I create my databases with this bash function:


    if ( ! su oracle -c "dbca -silent                        \
            -createDatabase                                  \
            -templateName ${template}.dbc                    \
            -gdbname $gdbname                                \
            -sid $gdbname                                    \
            -sysPassword sysman                              \
            -systemPassword sysman                           \
            -emConfiguration none                            \
            -redoLogFileSize $redologsize                    \
            -storageType FS                                  \
            -characterSet AL32UTF8                           \
            -nationalCharacterSet AL16UTF16                  \
            -memoryPercentage 60                             \
            -automaticMemoryManagement false                 \
            -databaseType MULTIPURPOSE"
        )
           then
              echo ""
              echo ""
              echo "${RED}===================================================================================="
              echo "ERROR !!! dbca silent createdabase                                                  "
              echo "====================================================================================${RESTORE}"
              echo ""
              echo ""
              exit -1
      fi

You could to build a dbca template using the dba and then you can use this template to create all databases in all servers that you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.