{"id":73,"date":"2015-04-06T20:44:00","date_gmt":"2015-04-06T23:44:00","guid":{"rendered":"http:\/\/maxoracle.com\/2015\/04\/06\/criando-um-banco-atraves-do-dbca-via-linha-de-comando-countdown-to-ocm\/"},"modified":"2015-04-06T20:44:00","modified_gmt":"2015-04-06T23:44:00","slug":"criando-um-banco-atraves-do-dbca-via-linha-de-comando-countdown-to-ocm","status":"publish","type":"post","link":"https:\/\/www.soudba.com.br\/?p=73","title":{"rendered":"Criando um banco atraves do DBCA via linha de comando &#8211; Countdown to OCM"},"content":{"rendered":"<p>   Neste documento estarei mostrando como criar um banco de dados via dbca, na linha de comando.<br \/>O interessante e que o comando abaixo demora em torno de 10 minutos com o enteprise manager database control ja criado.<\/p>\n<p>Primeiro, va ate o arquivo \/etc\/oratab e incluia a linha com um nome de um banco, pode ser algum somente de teste ou o que vai ser criado. Rodaremos o . oraenv para configurar as variaveis de ambiente.<\/p>\n<blockquote><p><\/p><\/blockquote>\n<p><code>-bash-3.2$ cat \/etc\/oratab<\/p>\n<p><\/code><\/p>\n<div><code><span># This file is used by ORACLE utilities.&nbsp; It is created by root.sh<\/span><\/code><\/div>\n<p><code><\/code><\/p>\n<div><code><span># and updated by either Database Configuration Assistant while creating<\/span><\/code><\/div>\n<p><code><\/code><\/p>\n<div><code><span># a database or ASM Configuration Assistant while creating ASM instance.<\/span><\/code><\/div>\n<p><code><\/p>\n<div><span><\/span><\/div>\n<div><span># A colon, ':', is used as the field terminator.&nbsp; A new line terminates<\/span><\/div>\n<div><span># the entry.&nbsp; Lines beginning with a pound sign, '#', are comments.<\/span><\/div>\n<div><span>#<\/span><\/div>\n<div><span># Entries are of the form:<\/span><\/div>\n<div><span># &nbsp; $ORACLE_SID:$ORACLE_HOME:&lt;N|Y&gt;:<\/span><\/div>\n<div><span>#<\/span><\/div>\n<div><span># The first and second fields are the system identifier and home<\/span><\/div>\n<div><span># directory of the database respectively.&nbsp; The third filed indicates<\/span><\/div>\n<div><span># to the dbstart utility that the database should , \"Y\", or should not,<\/span><\/div>\n<div><span># \"N\", be brought up at system boot time.<\/span><\/div>\n<div><span>#<\/span><\/div>\n<div><span># Multiple entries with the same $ORACLE_SID are not allowed.<\/span><\/div>\n<div><span>#<\/span><\/div>\n<div><span>#<\/span><\/div>\n<div><span>+ASM:\/u01\/app\/oracle\/product\/11.2.0\/grid:N<\/span><\/div>\n<p><\/p>\n<div><span>*:\/u01\/app\/oracle\/agent11g:N<\/span><\/div>\n<div><span><br \/><\/span><span><br \/><\/span><\/div>\n<p>dbca -silent &gt; criadb.sh<\/p>\n<p>Conteudo do Arquivo criadb.sh<\/p>\n<div><span>dbca&nbsp; <\/span><span>-silent<\/span><span> <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-createDatabase<\/span><span> <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-templateName<\/span><span> General_Purpose.dbc <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-gdbName<\/span><span> PROD1 <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-sysPassword<\/span><span> oracle <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-systemPassword<\/span><span> oracle <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-emConfiguration<\/span><span> LOCAL <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-dbsnmpPassword<\/span><span> oracle <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-sysmanPassword<\/span><span> oracle <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-datafileDestination<\/span><span> <\/span><span>'<\/span><span>\/u01\/app\/oracle\/oradata<\/span><span>'<\/span><span> <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-recoveryAreaDestination<\/span><span> <\/span><span>'<\/span><span>\/u01\/app\/oracle\/fast<\/span><span>'<\/span><span> <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-storageType<\/span><span> FS <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/span><span>-characterSet<\/span><span> AL32UTF8 <\/span><span><\/span><\/div>\n<div><span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<\/span><span>-sampleSchema<\/span><span> true<\/span><br \/><span><br \/><\/span><span>Removendo algumas linhas e fazendo ajustes o arquivo ficara pronto.<\/span><br \/><span><br \/><\/span><span>Dai o proximo passo executa-lo:<\/span><br \/><span><br \/><\/span><span>sh criadb.sh<\/span><br \/><span><br \/><\/span><\/p>\n<div><span>-bash-3.2$ sh criadb.sh&nbsp;<\/span><\/div>\n<div><span>Falha ao limpar as etapas<\/span><\/div>\n<div><span>5% conclu\u00eddo<\/span><\/div>\n<div><span>Copiando arquivos de banco de dados<\/span><\/div>\n<div><span>7% conclu\u00eddo<\/span><\/div>\n<div><span>8% conclu\u00eddo<\/span><\/div>\n<div><span>38% conclu\u00eddo<\/span><\/div>\n<div><span>Criando e iniciando a inst\u00e2ncia Oracle<\/span><\/div>\n<div><span>39% conclu\u00eddo<\/span><\/div>\n<div><span>41% conclu\u00eddo<\/span><\/div>\n<div><span>45% conclu\u00eddo<\/span><\/div>\n<div><span>46% conclu\u00eddo<\/span><\/div>\n<div><span>50% conclu\u00eddo<\/span><\/div>\n<div><span>54% conclu\u00eddo<\/span><\/div>\n<div><span>55% conclu\u00eddo<\/span><\/div>\n<div><span>56% conclu\u00eddo<\/span><\/div>\n<div><span>59% conclu\u00eddo<\/span><\/div>\n<div><span>61% conclu\u00eddo<\/span><\/div>\n<div><span>Registrando o banco de dados no Oracle Restart<\/span><\/div>\n<div><span>66% conclu\u00eddo<\/span><\/div>\n<div><span>Concluindo Cria\u00e7\u00e3o de Banco de Dados<\/span><\/div>\n<div><span>70% conclu\u00eddo<\/span><\/div>\n<div><span>73% conclu\u00eddo<\/span><\/div>\n<div><span>76% conclu\u00eddo<\/span><\/div>\n<div><span>86% conclu\u00eddo<\/span><\/div>\n<div><span>96% conclu\u00eddo<\/span><\/div>\n<div><span>100% conclu\u00eddo<\/span><\/div>\n<p><span><\/span><\/p>\n<div><span>Verifique o arquivo de log \"\/u01\/app\/oracle\/cfgtoollogs\/dbca\/PROD1\/PROD10.log\" para obter mais detalhes.<\/span><\/div>\n<div><span><br \/><\/span><\/p>\n<div><span>-bash-3.2$ . oraenv<\/span><\/div>\n<div><span>ORACLE_SID = [PROD1] ? PROD1<\/span><\/div>\n<div><span>The Oracle base remains unchanged with value \/u01\/app\/oracle<\/span><\/div>\n<div><span>-bash-3.2$ emctl status dbconsole<\/span><\/div>\n<div><span>Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0&nbsp;<\/span><\/div>\n<div><span>Copyright (c) 1996, 2011 Oracle Corporation.&nbsp; All rights reserved.<\/span><\/div>\n<div><span>https:\/\/srv01:1158\/em\/console\/aboutApplication<\/span><\/div>\n<p><span><\/span><\/p>\n<div><span>Oracle Enterprise Manager 11g is not running.<\/span><\/div>\n<div><span><br \/><\/span><\/div>\n<div><span><br \/><\/span><\/div>\n<\/div>\n<div><span>Dessa forma seu banco ja esta criado com o modelo e exemplos de esquema, de forma com que voce nao gastou 10 minutos para completar a operacao.<\/span><\/div>\n<\/div>\n<div><\/div>\n<p><\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Neste documento estarei mostrando como criar um banco de dados via dbca, na linha de comando.O interessante e que o comando abaixo demora em torno de 10 minutos com o enteprise manager database control ja criado. Primeiro, va ate o &hellip; <a href=\"https:\/\/www.soudba.com.br\/?p=73\">Continue lendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56,70,146,180,189],"tags":[],"class_list":["post-73","post","type-post","status-publish","format-standard","hentry","category-create-database-oracle","category-dbca","category-linha-de-comando-dbca","category-ocm","category-oracle"],"_links":{"self":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=73"}],"version-history":[{"count":0,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=\/wp\/v2\/posts\/73\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.soudba.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}