{"id":2291,"date":"2021-06-01T11:15:02","date_gmt":"2021-06-01T09:15:02","guid":{"rendered":"http:\/\/clemente.pamplona.name\/dba\/?p=2291"},"modified":"2021-06-01T11:16:36","modified_gmt":"2021-06-01T09:16:36","slug":"uso-de-variables-de-entorno-en-script-sde-rman","status":"publish","type":"post","link":"http:\/\/clemente.pamplona.name\/dba\/uso-de-variables-de-entorno-en-script-sde-rman\/","title":{"rendered":"Uso de variables de entorno en script sde rman"},"content":{"rendered":"<p>Hoy vamos a ver una entrada muy rapida para dummies.<\/p>\n<p>Muchas veces queremos hacer que el log de rman tenga una variable de entorno ( usualmente a fecha),haciendo algo similar a <\/p>\n<pre>\r\n#!\/bin\/bash\r\nHORA=`date +%Y%m%d_%H:%M:%S`\r\nrman  cmdfile restore_${ORACLE_SID}.cmd  log logs\/${HORA}_restore_${ORACLE_SID}.log\r\n<\/pre>\n<p>Pero cuando vamos al subdirecorio de logs nos encontramos con que nos ha creado un fichero llamado <b>${HORA}_restore_${ORACLE_SID}.log<\/b><\/p>\n<h1>Como solucionamos esto?<\/h1>\n<p>La solucion no pasa por jugar con las comillas sino con el uso del parametro <b>MSGLOG<\/b><br \/>\nSimplemente tendremos que cambiar nuestro script por <\/p>\n<pre>\r\n#!\/bin\/bash\r\nHORA=`date +%Y%m%d_%H:%M:%S`\r\nrman  cmdfile restore_${ORACLE_SID}.cmd  MSGLOG logs\/${HORA}_restore_${ORACLE_SID}.log\r\n<\/pre>\n<p>Y funcionara tal y como queremos <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hoy vamos a ver una entrada muy rapida para dummies. Muchas veces queremos hacer que el log de rman tenga una variable de entorno ( usualmente a fecha),haciendo algo similar a #!\/bin\/bash HORA=`date +%Y%m%d_%H:%M:%S` rman cmdfile restore_${ORACLE_SID}.cmd log logs\/${HORA}_restore_${ORACLE_SID}.log Pero &hellip; <a href=\"http:\/\/clemente.pamplona.name\/dba\/uso-de-variables-de-entorno-en-script-sde-rman\/\">Sigue leyendo <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":[11,565,60,567,921,975,6,13],"tags":[158,23],"class_list":["post-2291","post","type-post","status-publish","format-standard","hentry","category-11g","category-11g-en","category-12c","category-12c-en","category-18c","category-19c","category-backup","category-scripting","tag-log","tag-rman"],"_links":{"self":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/2291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/comments?post=2291"}],"version-history":[{"count":5,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/2291\/revisions"}],"predecessor-version":[{"id":2296,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/posts\/2291\/revisions\/2296"}],"wp:attachment":[{"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/media?parent=2291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/categories?post=2291"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/clemente.pamplona.name\/dba\/wp-json\/wp\/v2\/tags?post=2291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}