{"id":2608,"date":"2019-03-12T12:55:59","date_gmt":"2019-03-12T09:55:59","guid":{"rendered":"https:\/\/sysdba.org\/?p=2608"},"modified":"2025-07-02T06:01:07","modified_gmt":"2025-07-02T06:01:07","slug":"manually-create-a-database-with-the-command-prompt","status":"publish","type":"post","link":"https:\/\/sysdba.org\/en\/manually-create-a-database-with-the-command-prompt\/","title":{"rendered":"Manually create a database with the command prompt"},"content":{"rendered":"<p>With an instance of Oracle currently running on the server, we can manually create a database.<\/p>\n<p>&nbsp;<\/p>\n<p>In this scenario we are connected to the system as an Oracle user with the first instance active. The first step is to decide on a name for the instance to be created.<br \/>\n[crayon]$set ORACLE_SID=cargo<\/p>\n<p>$export ORACLE_SID=cargo<\/p>\n<p>[\/crayon]<br \/>\nCreate a pfile called initcargo.orcl in the &#8220;\/u01\/app\/oracle\/product\/10.2.0\/db_1\/dbs&#8221; path.<\/p>\n<p>Configure the paths according to your requirements.<br \/>\n[crayon]*.db_name=&#8217;cargo&#8217;<\/p>\n<p>*.db_block_size=8192<\/p>\n<p>*.sga_target=231735296<\/p>\n<p>*.undo_management=&#8217;AUTO&#8217;<\/p>\n<p>*.control_files=&#8217;\/u01\/app\/oracle\/oradata\/cargo\/control01.ctl&#8217;<\/p>\n<p>*.user_dump_dest=&#8217;\/u01\/app\/oracle\/admin\/cargo\/udump&#8217;<\/p>\n<p>*.background_dump_dest=&#8217;\/u01\/app\/oracle\/admin\/cargo\/bdump&#8217;<\/p>\n<p>*.core_dump_dest=&#8217;\/u01\/app\/oracle\/admin\/cargo\/cdump'[\/crayon]<br \/>\nIt&#8217;s necessary to create all of these folders and grant them the needed rights. If you haven&#8217;t already created an Oracle user:<br \/>\n[crayon]chown oracle:oinstall initcargo.ora this command changes the ownership<\/p>\n<p>chmod g+w initcargo.ora giving write rights to the oinstall group<\/p>\n<p>CREATE SPFILE FROM PFILE=&#8217;\/u01\/app\/oracle\/product\/10.2.0\/db_1\/dbs\/initcargo.ora&#8217;;<\/p>\n<p>[\/crayon]<br \/>\nOpening the database in nomount mode and creating an spfile.<br \/>\n[crayon]startup nomount;<\/p>\n<p>[\/crayon]<\/p>\n<p>[crayon]ORA-09925: Unable to create audit trail file Linux Error: 2: No such file or directory Additional information: 9925<\/p>\n<p>[\/crayon]<br \/>\nIf you get an error such as this one, there may be a problem with rights and\/or paths.<\/p>\n<p>&nbsp;<\/p>\n<p>By using the create database command we create the listed files:<\/p>\n<p>&#8211; Redo Log files<\/p>\n<p>&#8211; system.dbf and sysaux.dbf (files for SYSTEM tablespace)<\/p>\n<p>&#8211; undo01.dbf file (for UNDO tablespace)<\/p>\n<p>&#8211; temp_tbs.dbf file (for TEMPORARY tablespace)<\/p>\n<p>&#8211; users.dbf (for DEFAULT PERMANENT tablespace)<br \/>\n[crayon]CREATE DATABASE cargo<\/p>\n<p>USER SYS IDENTIFIED BY cargo<\/p>\n<p>USER SYSTEM IDENTIFIED BY cargo<\/p>\n<p>LOGFILE GROUP 1 (&#8216;\/u01\/app\/oracle\/oradata\/cargo\/redo01.log&#8217;) SIZE 50 m,<\/p>\n<p>GROUP 2 (&#8216;\/u01\/app\/oracle\/oradata\/kargo\/redo02.log&#8217;) SIZE 50 m,<\/p>\n<p>GROUP 3 (&#8216;\/u01\/app\/oracle\/oradata\/kargo\/redo03.log&#8217;) SIZE 50 m<\/p>\n<p>MAXLOGFILES 5<\/p>\n<p>MAXLOGMEMBERS 5<\/p>\n<p>MAXLOGHISTORY 1<\/p>\n<p>MAXDATAFILES 100<\/p>\n<p>MAXINSTANCES 1<\/p>\n<p>CHARACTER SET us7ascii<\/p>\n<p>NATIONAL CHARACTER SET al16utf16<\/p>\n<p>DATAFILE &#8216;\/u01\/app\/oracle\/oradata\/cargo\/system01.dbf&#8217; SIZE 325 m REUSE EXTENT MANAGEMENT LOCAL<\/p>\n<p>SYSAUX DATAFILE &#8216;\/u01\/app\/oracle\/oradata\/cargo\/sysaux.dbf&#8217;SIZE 400 m REUSE<\/p>\n<p>DEFAULT TABLESPACE tbs_1 DATAFILE &#8216;\/u01\/app\/oracle\/oradata\/cargo\/users.dbf&#8217; SIZE 200m REUSE AUTOEXTEND ON MAXSIZE UNLIMITED<\/p>\n<p>DEFAULT TEMPORARY TABLESPACE tempts1 TEMPFILE &#8216;\/u01\/app\/oracle\/oradata\/cargo\/temp_tbs.dbf&#8217; SIZE 20m REUSE<\/p>\n<p>undo TABLESPACE undotbs DATAFILE &#8216;\/u01\/app\/oracle\/oradata\/cargo\/undo01.dbf&#8217; SIZE 200m REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;[\/crayon]<\/p>\n<p>The following scripts create views, synonyms and pl\/sql packages.<br \/>\n[crayon]CONNECT \/ AS SYSDBA<\/p>\n<p>@$ORACLE_HOME\/rdbms\/admin\/catalog.sql<\/p>\n<p>@$ORACLE_HOME\/rdbms\/admin\/catproc.sql<\/p>\n<p>[\/crayon]<\/p>\n<p>After getting a &#8220;PL\/SQL procedure successfully completed&#8221; message.<br \/>\n[crayon] shutdown immediate<\/p>\n<p>startup[\/crayon]<br \/>\nUse the following commands to restart the database.<br \/>\n[crayon] show parameters<\/p>\n<p>NAME TYPE VALUE<\/p>\n<p>O7_DICTIONARY_ACCESSIBILITY boolean FALSE<\/p>\n<p>active_instance_count integer<\/p>\n<p>aq_tm_processes integer 0<\/p>\n<p>archive_lag_target integer 0<\/p>\n<p>asm_diskgroups string<\/p>\n<p>asm_diskstring string<\/p>\n<p>asm_power_limit integer 1<\/p>\n<p>audit_file_dest string \/u01\/app\/oracle\/product\/10.2.0<\/p>\n<p>\/db_1\/rdbms\/audit<\/p>\n<p>audit_sys_operations boolean FALSE<\/p>\n<p>audit_syslog_level string<\/p>\n<p>NAME TYPE VALUE<\/p>\n<p>audit_trail string NONE<\/p>\n<p>background_core_dump string partial<\/p>\n<p>background_dump_dest string \/u01\/app\/oracle\/admin\/cargo\/bdump<\/p>\n<p>backup_tape_io_slaves boolean FALSE<\/p>\n<p>bitmap_merge_area_size integer 1048576<\/p>\n<p>blank_trimming boolean FALSE<\/p>\n<p>buffer_pool_keep string<\/p>\n<p>buffer_pool_recycle string<\/p>\n<p>circuits integer<\/p>\n<p>cluster_database boolean FALSE<\/p>\n<p>NAME TYPE VALUE<\/p>\n<p>cluster_database_instances integer 1<\/p>\n<p>cluster_interconnects string<\/p>\n<p>commit_point_strength integer 1<\/p>\n<p>commit_write string<\/p>\n<p>compatible string 10.2.0<\/p>\n<p>control_file_record_keep_time integer 7<\/p>\n<p>control_files string \/u01\/app\/oracle\/oradata\/cargo\/control01.ctl<\/p>\n<p>[\/crayon]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With an instance of Oracle currently running on the server, we can manually create a database.<\/p>\n","protected":false},"author":1,"featured_media":3434,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[383,338],"tags":[345],"class_list":["post-2608","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dba_i","category-oracle-tr","tag-oracle"],"_links":{"self":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/posts\/2608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/comments?post=2608"}],"version-history":[{"count":1,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/posts\/2608\/revisions"}],"predecessor-version":[{"id":4822,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/posts\/2608\/revisions\/4822"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/media?parent=2608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/categories?post=2608"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sysdba.org\/en\/wp-json\/wp\/v2\/tags?post=2608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}