{"id":8539,"date":"2026-04-03T11:24:55","date_gmt":"2026-04-03T14:24:55","guid":{"rendered":"https:\/\/executestep.com\/?p=8539"},"modified":"2026-04-03T11:27:28","modified_gmt":"2026-04-03T14:27:28","slug":"ora-01031-identity-create-sequence","status":"publish","type":"post","link":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/","title":{"rendered":"ORA-01031 \u2014 Privil\u00e9gio Insuficiente ao Criar Coluna IDENTITY"},"content":{"rendered":"\n<p>Voc\u00ea tenta criar uma tabela com coluna de identidade e o Oracle responde com erro de privil\u00e9gio \u2014 mesmo que voc\u00ea tenha <code>CREATE TABLE<\/code>. Veja por que isso acontece e como resolver.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SQL> CREATE TABLE pedidos (\n  2    id   INT GENERATED BY DEFAULT AS IDENTITY,\n  3    desc VARCHAR2(100)\n  4  );\n  id   INT GENERATED BY DEFAULT AS IDENTITY,\n*\nERROR at line 2:\nORA-01031: insufficient privileges<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">SQL&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">CREATE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TABLE<\/span><span style=\"color: #D8DEE9FF\"> pedidos (<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\">    id   <\/span><span style=\"color: #81A1C1\">INT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">GENERATED<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">BY<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">DEFAULT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">AS<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">IDENTITY<\/span><span style=\"color: #D8DEE9FF\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">desc<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">VARCHAR2<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">100<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #B48EAD\">4<\/span><span style=\"color: #D8DEE9FF\">  );<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  id   <\/span><span style=\"color: #81A1C1\">INT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">GENERATED<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">BY<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">DEFAULT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">AS<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">IDENTITY<\/span><span style=\"color: #D8DEE9FF\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">*<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">ERROR <\/span><span style=\"color: #81A1C1\">at<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">line<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">ORA<\/span><span style=\"color: #81A1C1\">-<\/span><span style=\"color: #B48EAD\">01031<\/span><span style=\"color: #D8DEE9FF\">: insufficient privileges<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>O erro aparece mesmo com <code>CREATE TABLE<\/code> concedido. O problema est\u00e1 em outro privil\u00e9gio que passa despercebido.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Por Que Acontece<\/h2>\n\n\n\n<p>Colunas <code>IDENTITY<\/code> foram introduzidas no Oracle 12c como um atalho para o padr\u00e3o sequence + default. Internamente, ao criar uma coluna identity, <strong>o Oracle cria uma sequence impl\u00edcita<\/strong> associada \u00e0quela coluna. Essa sequence \u00e9 gerenciada pelo banco, mas continua sendo uma sequence \u2014 e criar uma sequence exige o privil\u00e9gio <code>CREATE SEQUENCE<\/code>.<\/p>\n\n\n\n<p>Sem ele, o <code>CREATE TABLE<\/code> falha com <code>ORA-01031<\/code> antes mesmo de tocar na tabela em si.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Diagn\u00f3stico<\/h2>\n\n\n\n<p>Verifique os privil\u00e9gios do usu\u00e1rio atual:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>-- Privil\u00e9gios de sistema da sess\u00e3o atual\nSELECT privilege\nFROM   session_privs\nORDER BY privilege;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #616E88\">-- Privil\u00e9gios de sistema da sess\u00e3o atual<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">SELECT<\/span><span style=\"color: #D8DEE9FF\"> privilege<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">FROM<\/span><span style=\"color: #D8DEE9FF\">   session_privs<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">ORDER BY<\/span><span style=\"color: #D8DEE9FF\"> privilege;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Se <code>CREATE SEQUENCE<\/code> n\u00e3o aparecer na lista, esse \u00e9 o problema.<\/p>\n\n\n\n<p>Para verificar um usu\u00e1rio espec\u00edfico (como DBA):<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SELECT privilege\nFROM   dba_sys_privs\nWHERE  grantee = 'MEU_USUARIO'\nORDER BY privilege;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">SELECT<\/span><span style=\"color: #D8DEE9FF\"> privilege<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">FROM<\/span><span style=\"color: #D8DEE9FF\">   dba_sys_privs<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">WHERE<\/span><span style=\"color: #D8DEE9FF\">  grantee <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">MEU_USUARIO<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">ORDER BY<\/span><span style=\"color: #D8DEE9FF\"> privilege;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Solu\u00e7\u00e3o<\/h2>\n\n\n\n<p>Conceda o privil\u00e9gio <code>CREATE SEQUENCE<\/code> ao usu\u00e1rio:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>-- Conectado como DBA\nGRANT CREATE SEQUENCE TO meu_usuario;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #616E88\">-- Conectado como DBA<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">GRANT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">CREATE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">SEQUENCE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TO<\/span><span style=\"color: #D8DEE9FF\"> meu_usuario;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Ap\u00f3s a concess\u00e3o, a cria\u00e7\u00e3o da tabela funciona normalmente:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * 1rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>SQL> CREATE TABLE pedidos (\n  2    id   INT GENERATED BY DEFAULT AS IDENTITY,\n  3    desc VARCHAR2(100)\n  4  );\n\nTable created.<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">SQL&gt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">CREATE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TABLE<\/span><span style=\"color: #D8DEE9FF\"> pedidos (<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\">    id   <\/span><span style=\"color: #81A1C1\">INT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">GENERATED<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">BY<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">DEFAULT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">AS<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">IDENTITY<\/span><span style=\"color: #D8DEE9FF\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">desc<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">VARCHAR2<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">100<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #B48EAD\">4<\/span><span style=\"color: #D8DEE9FF\">  );<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">Table<\/span><span style=\"color: #D8DEE9FF\"> created.<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">As Tr\u00eas Variantes de IDENTITY \u2014 Todas Exigem CREATE SEQUENCE<\/h2>\n\n\n\n<p>O comportamento \u00e9 o mesmo para as tr\u00eas formas de coluna identity dispon\u00edveis no Oracle 12c+:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Variante<\/th><th>Comportamento<\/th><th>Tamb\u00e9m falha sem CREATE SEQUENCE?<\/th><\/tr><\/thead><tbody><tr><td><code>GENERATED ALWAYS AS IDENTITY<\/code><\/td><td>Oracle sempre gera o valor; INSERT expl\u00edcito na coluna \u00e9 bloqueado<\/td><td>\u2705 Sim<\/td><\/tr><tr><td><code>GENERATED BY DEFAULT AS IDENTITY<\/code><\/td><td>Oracle gera o valor por padr\u00e3o; INSERT expl\u00edcito \u00e9 permitido<\/td><td>\u2705 Sim<\/td><\/tr><tr><td><code>GENERATED BY DEFAULT ON NULL AS IDENTITY<\/code><\/td><td>Oracle gera o valor quando o INSERT passa NULL na coluna<\/td><td>\u2705 Sim<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Independente da variante escolhida, a sequence impl\u00edcita \u00e9 sempre criada \u2014 e o <code>CREATE SEQUENCE<\/code> \u00e9 sempre exigido.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Como Reproduzir em Lab<\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * 1rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>-- 1. Criar usu\u00e1rio de teste (conectado como DBA)\nCREATE USER lab_identity IDENTIFIED BY lab123;\nGRANT CREATE SESSION TO lab_identity;\nGRANT CREATE TABLE TO lab_identity;\n-- Intencionalmente SEM CREATE SEQUENCE\n\n-- 2. Conectar como lab_identity e reproduzir o erro\nsqlplus lab_identity\/lab123@ORCLPDB1\n\nCREATE TABLE t_identidade (\n  id   INT GENERATED BY DEFAULT AS IDENTITY,\n  nome VARCHAR2(50)\n);\n-- Esperado: ORA-01031: insufficient privileges\n\n-- 3. Voltar como DBA e conceder CREATE SEQUENCE\nCONNECT \/ AS SYSDBA\nGRANT CREATE SEQUENCE TO lab_identity;\n\n-- 4. Reconectar como lab_identity e confirmar a corre\u00e7\u00e3o\nsqlplus lab_identity\/lab123@ORCLPDB1\n\nCREATE TABLE t_identidade (\n  id   INT GENERATED BY DEFAULT AS IDENTITY,\n  nome VARCHAR2(50)\n);\n-- Esperado: Table created.\n\n-- 5. Confirmar a sequence impl\u00edcita criada pelo Oracle\nSELECT sequence_name, min_value, max_value, increment_by, cache_size\nFROM   user_sequences;\n\n-- Limpeza\nDROP TABLE t_identidade;<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #616E88\">-- 1. Criar usu\u00e1rio de teste (conectado como DBA)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">CREATE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">USER<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">lab_identity<\/span><span style=\"color: #D8DEE9FF\"> IDENTIFIED <\/span><span style=\"color: #81A1C1\">BY<\/span><span style=\"color: #D8DEE9FF\"> lab123;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">GRANT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">CREATE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">SESSION<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TO<\/span><span style=\"color: #D8DEE9FF\"> lab_identity;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">GRANT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">CREATE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TABLE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TO<\/span><span style=\"color: #D8DEE9FF\"> lab_identity;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">-- Intencionalmente SEM CREATE SEQUENCE<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">-- 2. Conectar como lab_identity e reproduzir o erro<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">sqlplus lab_identity<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9FF\">lab123@ORCLPDB1<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">CREATE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TABLE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">t_identidade<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  id   <\/span><span style=\"color: #81A1C1\">INT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">GENERATED<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">BY<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">DEFAULT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">AS<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">IDENTITY<\/span><span style=\"color: #D8DEE9FF\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  nome <\/span><span style=\"color: #81A1C1\">VARCHAR2<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">50<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">-- Esperado: ORA-01031: insufficient privileges<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">-- 3. Voltar como DBA e conceder CREATE SEQUENCE<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">CONNECT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">AS<\/span><span style=\"color: #D8DEE9FF\"> SYSDBA<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">GRANT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">CREATE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">SEQUENCE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TO<\/span><span style=\"color: #D8DEE9FF\"> lab_identity;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">-- 4. Reconectar como lab_identity e confirmar a corre\u00e7\u00e3o<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">sqlplus lab_identity<\/span><span style=\"color: #81A1C1\">\/<\/span><span style=\"color: #D8DEE9FF\">lab123@ORCLPDB1<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">CREATE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TABLE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">t_identidade<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  id   <\/span><span style=\"color: #81A1C1\">INT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">GENERATED<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">BY<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">DEFAULT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">AS<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">IDENTITY<\/span><span style=\"color: #D8DEE9FF\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  nome <\/span><span style=\"color: #81A1C1\">VARCHAR2<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">50<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">-- Esperado: Table created.<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">-- 5. Confirmar a sequence impl\u00edcita criada pelo Oracle<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">SELECT<\/span><span style=\"color: #D8DEE9FF\"> sequence_name, min_value, max_value, increment_by, cache_size<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">FROM<\/span><span style=\"color: #D8DEE9FF\">   user_sequences;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">-- Limpeza<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">DROP<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TABLE<\/span><span style=\"color: #D8DEE9FF\"> t_identidade;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Checklist R\u00e1pido<\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * 1rem);line-height:1.5rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>-- 1. Verificar privil\u00e9gios da sess\u00e3o\nSELECT privilege FROM session_privs ORDER BY privilege;\n\n-- 2. Conceder CREATE SEQUENCE (como DBA)\nGRANT CREATE SEQUENCE TO meu_usuario;\n\n-- 3. Recriar a tabela\nCREATE TABLE minha_tabela (\n  id INT GENERATED BY DEFAULT AS IDENTITY,\n  ...\n);<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #616E88\">-- 1. Verificar privil\u00e9gios da sess\u00e3o<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">SELECT<\/span><span style=\"color: #D8DEE9FF\"> privilege <\/span><span style=\"color: #81A1C1\">FROM<\/span><span style=\"color: #D8DEE9FF\"> session_privs <\/span><span style=\"color: #81A1C1\">ORDER BY<\/span><span style=\"color: #D8DEE9FF\"> privilege;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">-- 2. Conceder CREATE SEQUENCE (como DBA)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">GRANT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">CREATE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">SEQUENCE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TO<\/span><span style=\"color: #D8DEE9FF\"> meu_usuario;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\">-- 3. Recriar a tabela<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">CREATE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">TABLE<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">minha_tabela<\/span><span style=\"color: #D8DEE9FF\"> (<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  id <\/span><span style=\"color: #81A1C1\">INT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">GENERATED<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">BY<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">DEFAULT<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">AS<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">IDENTITY<\/span><span style=\"color: #D8DEE9FF\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  ...<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Refer\u00eancias<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-database\/19\/sqlrf\/CREATE-TABLE.html\">Oracle Database SQL Language Reference \u2014 Identity Columns<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.oracle.com\/en\/database\/oracle\/oracle-database\/19\/dbseg\/configuring-privilege-and-role-authorization.html\">Oracle Database Security Guide \u2014 System Privileges<\/a><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n","protected":false},"excerpt":{"rendered":"<p>Voc\u00ea tenta criar uma tabela com coluna de identidade e o Oracle responde com erro de privil\u00e9gio \u2014 mesmo que voc\u00ea tenha CREATE TABLE. Veja por que isso acontece e como resolver. O erro aparece mesmo com CREATE TABLE concedido. O problema est\u00e1 em outro privil\u00e9gio que passa despercebido. Por Que Acontece Colunas IDENTITY foram<\/p>\n","protected":false},"author":1,"featured_media":8512,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"ORA-01031","_yoast_wpseo_title":"ORA-01031 \u2014 Coluna IDENTITY Sem CREATE SEQUENCE %%sep%% %%sitename%%","_yoast_wpseo_metadesc":"ORA-01031 ao criar tabela com GENERATED AS IDENTITY? O Oracle exige CREATE SEQUENCE para criar a sequence impl\u00edcita da coluna. Veja como corrigir.","footnotes":""},"categories":[34,174],"tags":[325,324,313,323,190],"class_list":{"0":"post-8539","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-oracle","9":"tag-create-sequence","10":"tag-identity-column-2","11":"tag-lab","12":"tag-ora-01031","13":"tag-troubleshooting"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ORA-01031 \u2014 Coluna IDENTITY Sem CREATE SEQUENCE | Execute Step<\/title>\n<meta name=\"description\" content=\"ORA-01031 ao criar tabela com GENERATED AS IDENTITY? O Oracle exige CREATE SEQUENCE para criar a sequence impl\u00edcita da coluna. Veja como corrigir.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ORA-01031 \u2014 Coluna IDENTITY Sem CREATE SEQUENCE | Execute Step\" \/>\n<meta property=\"og:description\" content=\"ORA-01031 ao criar tabela com GENERATED AS IDENTITY? O Oracle exige CREATE SEQUENCE para criar a sequence impl\u00edcita da coluna. Veja como corrigir.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/\" \/>\n<meta property=\"og:site_name\" content=\"Execute Step\" \/>\n<meta property=\"article:published_time\" content=\"2026-04-03T14:24:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-03T14:27:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/executestep.com\/wp-content\/uploads\/2026\/03\/default_lab.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1380\" \/>\n\t<meta property=\"og:image:height\" content=\"752\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Henrique\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Henrique\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/\"},\"author\":{\"name\":\"Henrique\",\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/#\\\/schema\\\/person\\\/7e854882e27693a21f607693465d95aa\"},\"headline\":\"ORA-01031 \u2014 Privil\u00e9gio Insuficiente ao Criar Coluna IDENTITY\",\"datePublished\":\"2026-04-03T14:24:55+00:00\",\"dateModified\":\"2026-04-03T14:27:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/\"},\"wordCount\":275,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/#\\\/schema\\\/person\\\/7e854882e27693a21f607693465d95aa\"},\"image\":{\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/executestep.com\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/default_lab.png\",\"keywords\":[\"create sequence\",\"identity column\",\"lab\",\"ora-01031\",\"troubleshooting\"],\"articleSection\":[\"Oracle\",\"Oracle\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/\",\"url\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/\",\"name\":\"ORA-01031 \u2014 Coluna IDENTITY Sem CREATE SEQUENCE | Execute Step\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/executestep.com\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/default_lab.png\",\"datePublished\":\"2026-04-03T14:24:55+00:00\",\"dateModified\":\"2026-04-03T14:27:28+00:00\",\"description\":\"ORA-01031 ao criar tabela com GENERATED AS IDENTITY? O Oracle exige CREATE SEQUENCE para criar a sequence impl\u00edcita da coluna. Veja como corrigir.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/#primaryimage\",\"url\":\"https:\\\/\\\/executestep.com\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/default_lab.png\",\"contentUrl\":\"https:\\\/\\\/executestep.com\\\/wp-content\\\/uploads\\\/2026\\\/03\\\/default_lab.png\",\"width\":1380,\"height\":752,\"caption\":\"Default Lab\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/oracle\\\/ora-01031-identity-create-sequence\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ORA-01031 \u2014 Privil\u00e9gio Insuficiente ao Criar Coluna IDENTITY\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/#website\",\"url\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/\",\"name\":\"Execute Step\",\"description\":\"Execute with precision. Step by step.\",\"publisher\":{\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/#\\\/schema\\\/person\\\/7e854882e27693a21f607693465d95aa\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/#\\\/schema\\\/person\\\/7e854882e27693a21f607693465d95aa\",\"name\":\"Henrique\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\\\/\\\/executestep.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/logo_autor.png\",\"url\":\"https:\\\/\\\/executestep.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/logo_autor.png\",\"contentUrl\":\"https:\\\/\\\/executestep.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/logo_autor.png\",\"width\":182,\"height\":173,\"caption\":\"Henrique\"},\"logo\":{\"@id\":\"https:\\\/\\\/executestep.com\\\/wp-content\\\/uploads\\\/2026\\\/02\\\/logo_autor.png\"},\"sameAs\":[\"https:\\\/\\\/executestep.com\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/henrique-soares-da-silva\\\/\",\"#\"],\"url\":\"https:\\\/\\\/executestep.com\\\/pt-br\\\/author\\\/ricuxo\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ORA-01031 \u2014 Coluna IDENTITY Sem CREATE SEQUENCE | Execute Step","description":"ORA-01031 ao criar tabela com GENERATED AS IDENTITY? O Oracle exige CREATE SEQUENCE para criar a sequence impl\u00edcita da coluna. Veja como corrigir.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/","og_locale":"pt_BR","og_type":"article","og_title":"ORA-01031 \u2014 Coluna IDENTITY Sem CREATE SEQUENCE | Execute Step","og_description":"ORA-01031 ao criar tabela com GENERATED AS IDENTITY? O Oracle exige CREATE SEQUENCE para criar a sequence impl\u00edcita da coluna. Veja como corrigir.","og_url":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/","og_site_name":"Execute Step","article_published_time":"2026-04-03T14:24:55+00:00","article_modified_time":"2026-04-03T14:27:28+00:00","og_image":[{"width":1380,"height":752,"url":"https:\/\/executestep.com\/wp-content\/uploads\/2026\/03\/default_lab.png","type":"image\/png"}],"author":"Henrique","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Henrique","Est. tempo de leitura":"2 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/#article","isPartOf":{"@id":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/"},"author":{"name":"Henrique","@id":"https:\/\/executestep.com\/pt-br\/#\/schema\/person\/7e854882e27693a21f607693465d95aa"},"headline":"ORA-01031 \u2014 Privil\u00e9gio Insuficiente ao Criar Coluna IDENTITY","datePublished":"2026-04-03T14:24:55+00:00","dateModified":"2026-04-03T14:27:28+00:00","mainEntityOfPage":{"@id":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/"},"wordCount":275,"commentCount":0,"publisher":{"@id":"https:\/\/executestep.com\/pt-br\/#\/schema\/person\/7e854882e27693a21f607693465d95aa"},"image":{"@id":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/#primaryimage"},"thumbnailUrl":"https:\/\/executestep.com\/wp-content\/uploads\/2026\/03\/default_lab.png","keywords":["create sequence","identity column","lab","ora-01031","troubleshooting"],"articleSection":["Oracle","Oracle"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/","url":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/","name":"ORA-01031 \u2014 Coluna IDENTITY Sem CREATE SEQUENCE | Execute Step","isPartOf":{"@id":"https:\/\/executestep.com\/pt-br\/#website"},"primaryImageOfPage":{"@id":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/#primaryimage"},"image":{"@id":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/#primaryimage"},"thumbnailUrl":"https:\/\/executestep.com\/wp-content\/uploads\/2026\/03\/default_lab.png","datePublished":"2026-04-03T14:24:55+00:00","dateModified":"2026-04-03T14:27:28+00:00","description":"ORA-01031 ao criar tabela com GENERATED AS IDENTITY? O Oracle exige CREATE SEQUENCE para criar a sequence impl\u00edcita da coluna. Veja como corrigir.","breadcrumb":{"@id":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/#primaryimage","url":"https:\/\/executestep.com\/wp-content\/uploads\/2026\/03\/default_lab.png","contentUrl":"https:\/\/executestep.com\/wp-content\/uploads\/2026\/03\/default_lab.png","width":1380,"height":752,"caption":"Default Lab"},{"@type":"BreadcrumbList","@id":"https:\/\/executestep.com\/pt-br\/oracle\/ora-01031-identity-create-sequence\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/executestep.com\/pt-br\/"},{"@type":"ListItem","position":2,"name":"ORA-01031 \u2014 Privil\u00e9gio Insuficiente ao Criar Coluna IDENTITY"}]},{"@type":"WebSite","@id":"https:\/\/executestep.com\/pt-br\/#website","url":"https:\/\/executestep.com\/pt-br\/","name":"Execute Step","description":"Execute with precision. Step by step.","publisher":{"@id":"https:\/\/executestep.com\/pt-br\/#\/schema\/person\/7e854882e27693a21f607693465d95aa"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/executestep.com\/pt-br\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":["Person","Organization"],"@id":"https:\/\/executestep.com\/pt-br\/#\/schema\/person\/7e854882e27693a21f607693465d95aa","name":"Henrique","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/executestep.com\/wp-content\/uploads\/2026\/02\/logo_autor.png","url":"https:\/\/executestep.com\/wp-content\/uploads\/2026\/02\/logo_autor.png","contentUrl":"https:\/\/executestep.com\/wp-content\/uploads\/2026\/02\/logo_autor.png","width":182,"height":173,"caption":"Henrique"},"logo":{"@id":"https:\/\/executestep.com\/wp-content\/uploads\/2026\/02\/logo_autor.png"},"sameAs":["https:\/\/executestep.com","https:\/\/www.linkedin.com\/in\/henrique-soares-da-silva\/","#"],"url":"https:\/\/executestep.com\/pt-br\/author\/ricuxo\/"}]}},"_links":{"self":[{"href":"https:\/\/executestep.com\/pt-br\/wp-json\/wp\/v2\/posts\/8539","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/executestep.com\/pt-br\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/executestep.com\/pt-br\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/executestep.com\/pt-br\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/executestep.com\/pt-br\/wp-json\/wp\/v2\/comments?post=8539"}],"version-history":[{"count":0,"href":"https:\/\/executestep.com\/pt-br\/wp-json\/wp\/v2\/posts\/8539\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/executestep.com\/pt-br\/wp-json\/wp\/v2\/media\/8512"}],"wp:attachment":[{"href":"https:\/\/executestep.com\/pt-br\/wp-json\/wp\/v2\/media?parent=8539"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/executestep.com\/pt-br\/wp-json\/wp\/v2\/categories?post=8539"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/executestep.com\/pt-br\/wp-json\/wp\/v2\/tags?post=8539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}