Pular para o conteúdo
Visualizando 12 posts - 1 até 12 (de 12 do total)
  • Autor
    Posts
  • #94900
    jspaulonci
    Participante

      Bom dia pessoal, estou com um dúvida.

      Alguem tem base com datafiles separados em vários diskgroups ?

      Eu tenho bancos assim, ontem fazendo um teste de restore full algo diferente do que eu esperava aconteceu.
      Eu fiz um backup com o RMAN e beleza.
      Baixei o banco e fui na ASM e dropei o banco com “rm”
      Depois tentei fazer um restore full, normal, (arroz com feijão)
      O Oracle então, pegou todos os datafiles que estavam no diskgroup dados2 e restaurou todos os datafiles para o diskgroup dados.
      Ele obedecu o que estava setado no parametro db_create_file_dest que era dados +DADOS.

      Alguem já passou por isso ?

      Alguem tem idéia do que fazer para contornar isso ?

      Estou usando RAC na versão 10.2.0.3.0.

      Obrigado

      João Paulo Spaulonci

      #94901
      VitorLeandro
      Participante

        João Paulo,

        Não sei como restaurar um banco para mais de um Diskgroup com o RMAN, mas você pode mover os datafiles depois de importados para o outro diskgorup…

        http://download.oracle.com/docs/cd/E140 … m#CHDBDJJG

        #94902
        jspaulonci
        Participante

          Oi Vitor, correto isso é uma medida de contorno, mas imagina a seguinte situação, você tem uma base de 1000TB , com 10 diskgroups cada um com 100TB, como seria o restore disso ?

          Você teria que voltar 1000TB em um diskgroup só , e depois mover os que você gostaria que fosse para os outros diskgroups, acredito que tenha outra solução.

          Abraços

          #94910
          vieri
          Participante

            Paulo,

            para restaurar datafiles em path’s diferentes,
            seja no asm ou em filesystem o RMAN possui as
            claúsulas. SET NEW NAME e SWITH.

            ex:

            SET NEWNAME FOR DATAFILE ‘+dados2/oracle/oradata/db01/users.dbf’ TO
            ‘+dados1/oracle/oradata/db01/users.dbf’;
            RESTORE DATAFILE ‘+dados2/app/oracle/oradata/db01/users.dbf`;
            SWITCH DATAFILE ‘+dados1/app/oracle/oradata/db01/users.dbf’ TO DATAFILE COPY
            ‘+dados2/app/oracle/oradata/db01/users_index.dbf’;

            ex2: Se for varios datafiles usa o claúsula
            switch datafile all:

            RUN {
            set newname for datafile 1 to ‘/u03/wis/system01.dbf’;
            set newname for datafile 2 to ‘/u03/wis/undotbs1.dbf’;
            set newname for datafile 3 to ‘/u03/wis/sysauy01.dbf’;
            set newname for datafile 4 to ‘/u03/wis/data_entrega.dbf’;
            set newname for datafile 5 to ‘/u03/wis/data_entrega_small.dbf’;
            set newname for datafile 6 to ‘/u03/wis/gkoscf_dtau.dbf’;
            set newname for datafile 7 to ‘/u03/wis/gkoscf_inau.dbf’;
            set newname for datafile 8 to ‘/u03/wis/gkoscf_indy.dbf’;
            set newname for datafile 9 to ‘/u03/wis/indy_entrega.dbf’;
            set newname for datafile 10 to ‘/u03/wis/tbs_data_asstec.dbf’;
            set newname for datafile 11 to ‘/u03/wis/tbs_data_cestqhist_32m.dbf’;
            SQL “ALTER DATABASE RENAME FILE ”/u02/oracle/oradata/wis/redo01.log”
            TO ”/u03/wis/redo01.log” “;
            SQL “ALTER DATABASE RENAME FILE ”/u02/oracle/oradata/wis/redo02.log”
            TO ”/u03/wis/redo02.log” “;
            SQL “ALTER DATABASE RENAME FILE ”/u02/oracle/oradata/wis/redo03.log”
            TO ”/u03/wis/redo03.log” “;
            SQL “ALTER DATABASE RENAME FILE ”/u02/oracle/oradata/wis/redo04.log”
            TO ”/u03/wis/redo04.log” “;
            RESTORE DATABASE;
            switch datafile all;
            RECOVER DATABASE ;
            ALTER DATABASE OPEN RESETLOGS;
            }

            Ele basicamente irá dizer pro control-file os novos
            caminhos a serem restaurados.

            Rman é foda né!! rsrs

            #94912
            jspaulonci
            Participante

              Bom dia Vieri, essa é outra opção de contorno.

              #94913
              vieri
              Participante

                conhece outra ? rs

                #94914
                vieri
                Participante

                  Documentação oficial:

                  http://download.oracle.com/docs/cd/B193 … cov004.htm

                  6.4.3.1 Restoring Datafiles from Backup to a New Location
                  The important step in restoring datafiles from backup to a new location is to update the control file to reflect the new locations of the datafiles. The following example shows the use of the RMAN SET NEWNAME command to specify the new names, and the SWITCH command to update the control file to start referring to the datafiles by their new names.

                  As with restoring datafiles from backup to their original locations, you should take the affected tablespaces offline at the start of restoring datafiles from backup to a new location.

                  Then, create a RUN block to encompass your RESTORE and RECOVER commands. For each file to be moved to a new location, use the SET NEWNAME command to specify the new location for that file.

                  Then, still within the RUN block, run the RESTORE TABLESPACE or RESTORE DATAFILE as normal. RMAN restores each datafile to the location specified with SET NEWNAME, rather than its original location.

                  After the RESTORE command but before the RECOVER command in your RUN block, use a SWITCH command to update the control file with the new filenames of the datafiles. The SWITCH command is equivalent to the SQL statement ALTER DATABASE RENAME FILE. SWITCH DATAFILE ALL updates the control file to reflect the new names for all datafiles for which a SET NEWNAME has been issued in the RUN block.

                  This example restores the datafiles in tablespaces users and tools to a new location, then performs recovery. Assume that the old datafiles were stored in directory /olddisk and the new ones will be stored in /newdisk.

                  RUN
                  {
                  SQL ‘ALTER TABLESPACE users OFFLINE IMMEDIATE’;
                  SQL ‘ALTER TABLESPACE tools OFFLINE IMMEDIATE’;
                  # specify the new location for each datafile
                  SET NEWNAME FOR DATAFILE ‘/olddisk/users01.dbf’ TO
                  ‘/newdisk/users01.dbf’;
                  SET NEWNAME FOR DATAFILE ‘/olddisk/tools01.dbf’ TO
                  ‘/newdisk/tools01.dbf’;
                  # to restore to an ASM disk group named dgroup, use:
                  # SET NEWNAME FOR DATAFILE ‘/olddisk/trgt/tools01.dbf’
                  # TO ‘+dgroup’;
                  RESTORE TABLESPACE users, tools;
                  SWITCH DATAFILE ALL; # update control file with new filenames
                  RECOVER TABLESPACE users, tools;
                  }

                  If recovery is successful, then bring the tablespaces online:

                  SQL ‘ALTER TABLESPACE users ONLINE’;
                  SQL ‘ALTER TABLESPACE tools ONLINE’;

                  #94920
                  CleitonHanzen
                  Participante

                    Opá…

                    Bom…Contra documentação oficial, não tem muito o que ficar pesquisando/pensando…hehehe…

                    Mas numa recente conversão pra RAC que fizemos, tivemos que dar o set newname de todos os DBF’s pra conseguir fazer o restore… 🙂

                    #94921
                    jspaulonci
                    Participante

                      Caros amigos, o setnewname é uma alternativa sim, mas imagine um banco com muitos e muitos datafiles, fica muito fácil pro DBA errar, ele é humano né, não é verdade, então…..

                      Fiz mais alguns testes e descobri a solução, basta deixar o parametro db_create_file_dest com valor nulo, aí resolve, o restaurou corretamente.

                      Abaixo segue o log, um abraço a todos

                      RMAN> restore database;

                      Starting restore at 01-JUL-10
                      using channel ORA_DISK_1
                      using channel ORA_DISK_2

                      channel ORA_DISK_1: starting datafile backupset restore
                      channel ORA_DISK_1: specifying datafile(s) to restore from backup set
                      restoring datafile 00002 to +DADOS2/db1/datafile/undotbs1.259.720826329
                      restoring datafile 00003 to +DADOS2/db1/datafile/sysaux.260.720826561
                      restoring datafile 00007 to +DADOS/db1/datafile/tbs_contas.277.720652969
                      channel ORA_DISK_1: reading from backup piece /u01/rman/backup_db_DB1_S_65_P_1_T_723053832
                      channel ORA_DISK_2: starting datafile backupset restore
                      channel ORA_DISK_2: specifying datafile(s) to restore from backup set
                      restoring datafile 00001 to +DADOS2/db1/datafile/system.258.720825469
                      restoring datafile 00004 to +DADOS2/db1/datafile/undotbs2.261.720826607
                      restoring datafile 00005 to +DADOS/db1/datafile/users.267.718915873
                      restoring datafile 00006 to +DADOS/db1/datafile/tbs_contas.279.720652791
                      channel ORA_DISK_2: reading from backup piece /u01/rman/backup_db_DB1_S_64_P_1_T_723053832
                      channel ORA_DISK_1: restored backup piece 1
                      piece handle=/u01/rman/backup_db_DB1_S_65_P_1_T_723053832 tag=TAG20100630T161711
                      channel ORA_DISK_1: restore complete, elapsed time: 00:01:05
                      channel ORA_DISK_2: restored backup piece 1
                      piece handle=/u01/rman/backup_db_DB1_S_64_P_1_T_723053832 tag=TAG20100630T161711
                      channel ORA_DISK_2: restore complete, elapsed time: 00:01:05
                      Finished restore at 01-JUL-10

                      RMAN> recover database;

                      Starting recover at 01-JUL-10
                      using channel ORA_DISK_1
                      using channel ORA_DISK_2

                      starting media recovery

                      channel ORA_DISK_1: starting archive log restore to default destination
                      channel ORA_DISK_2: starting archive log restore to default destination
                      channel ORA_DISK_1: restoring archive log
                      archive log thread=1 sequence=53
                      channel ORA_DISK_1: reading from backup piece /u01/rman/backup_db_DB1_S_66_P_1_T_723053858
                      channel ORA_DISK_2: restoring archive log
                      archive log thread=2 sequence=28
                      channel ORA_DISK_2: reading from backup piece /u01/rman/backup_db_DB1_S_67_P_1_T_723053858
                      channel ORA_DISK_1: restored backup piece 1
                      piece handle=/u01/rman/backup_db_DB1_S_66_P_1_T_723053858 tag=TAG20100630T161737
                      channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
                      archive log filename=+DADOS/db1/1_53_718915831.dbf thread=1 sequence=53
                      channel ORA_DISK_2: restored backup piece 1
                      piece handle=/u01/rman/backup_db_DB1_S_67_P_1_T_723053858 tag=TAG20100630T161737
                      channel ORA_DISK_2: restore complete, elapsed time: 00:00:01
                      archive log filename=+DADOS/db1/2_28_718915831.dbf thread=2 sequence=28
                      unable to find archive log
                      archive log thread=2 sequence=29
                      RMAN-00571: ===========================================================
                      RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
                      RMAN-00571: ===========================================================
                      RMAN-03002: failure of recover command at 07/01/2010 16:44:17
                      RMAN-06054: media recovery requesting unknown log: thread 2 seq 29 lowscn 816995

                      RMAN> alter database open resetlogs;

                      database opened

                      RMAN> exit

                      #94924
                      vieri
                      Participante

                        há sim,
                        porque realmente o normal é ele restaurar no local que está no control_file. Se no seu control tivesse tudo ém um diskgroup
                        ia td pra lá, sequisesse espalhar babou… rs
                        Caso vc queira que seja diferente disso tem que usar o set new name
                        para alterar o control antes dele começa a restaurar.

                        DBA errar script é brabo
                        hein.. rsrs SCRIPT DINÂMICO!!!! rsrrs

                        #94928
                        jspaulonci
                        Participante

                          cara, pense assim, quanto mais manual as coisas forem , mais chance de dar pau.

                          #94937
                          vieri
                          Participante

                            No seu caso, vc fez o correto, pois vc queria a mesma estrutura
                            de diretórios/DG’s que ja existia, se a base a ser restaurada fosse oriundo de um servidor diferente ai não teria escolha.

                          Visualizando 12 posts - 1 até 12 (de 12 do total)
                          • Você deve fazer login para responder a este tópico.