Copiando Arquivo de Dados pelo ASMCMD no Banco de Dados Oracle 11g

source site Este artigo tem como objetivo demonstrar como copiar um arquivo de dados (datafile) de um Disco de Grupo para outro no Banco de Dados Oracle 11g.

source link Segue a demonstração abaixo.

Cheap Valium Canada Vamos entrar no banco de dados.

https://www.parolacce.org/2024/09/18/8z6oqf4lg [oracle@linux11gasmdi ~]$ sqlplus sys/******** as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 2 17:09:57 2013 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options

Buy Diazepam Eu

go to site Vamos verificar as tablespaces.

Buy Diazepam Cheap SQL> select * from v$tablespace; TS# NAME INC BIG FLA ENC ---------- ------------------------------ --- --- --- --- 0 SYSTEM YES NO YES 1 SYSAUX YES NO YES 2 UNDOTBS1 YES NO YES 4 USERS YES NO YES 3 TEMP NO NO YES 6 EXAMPLE YES NO YES 6 rows selected. SQL>

see url Vamos verificar os datafiles.

https://everitte.org/zdjmspnmmj SQL> col file_name for a45 SQL> set lines 500 SQL> select file_name from dba_data_files; FILE_NAME --------------------------------------------- +DGDATA/orcl/users01.dbf +DGDATA/orcl/undotbs01.dbf +DGDATA/orcl/sysaux01.dbf +DGDATA/orcl/system01.dbf +DGDATA/orcl/example01.dbf SQL>

watch Vamos verificar os Discos de Grupos.

https://ragadamed.com.br/2024/09/18/tv8bg969zsg SQL> select name from v$asm_diskgroup; NAME ------------------------------ DGARCH DGDATA DGREDOA DGREDOB SQL>

go to site Vamos copiar um datafile da Tablespace EXAMPLE.
Vamos colocar a tablespace neste momento em offline.

go site SQL> alter tablespace EXAMPLE offline; Tablespace altered. SQL> ! [oracle@linux11gasmdi ~]$

Cheap Msj Diazepam Vamos carregar as variáveis de ambiente do Grid. Pode-se exportar o ORACLE_HOME que está no arquivo oratab “/etc/oratab” do Grid (+ASM) ou se for RAC (+ASMn) aonde “n” é o número do node ou carregar um arquivo que já está com as variáveis de ambiente para o Grid.
Vou mostrar primeiramente com o oratab.

source [oracle@linux11gasmdi ~]$ cat /etc/oratab #Backup file is /u01/app/oracle/product/11.2.0/grid/srvm/admin/oratab.bak.linux11gasmdi line added by Agent # # This file is used by ORACLE utilities. It is created by root.sh # and updated by either Database Configuration Assistant while creating # a database or ASM Configuration Assistant while creating ASM instance. # A colon, ':', is used as the field terminator. A new line terminates # the entry. Lines beginning with a pound sign, '#', are comments. # # Entries are of the form: # $ORACLE_SID:$ORACLE_HOME:<N|Y>: # # The first and second fields are the system identifier and home # directory of the database respectively. The third filed indicates # to the dbstart utility that the database should , "Y", or should not, # "N", be brought up at system boot time. # # Multiple entries with the same $ORACLE_SID are not allowed. # # +ASM:/u01/app/oracle/product/11.2.0/grid:N orcl:/u01/app/oracle/product/11.2.0/db_1:N # line added by Agent [oracle@linux11gasmdi ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/grid [oracle@linux11gasmdi ~]$ export ORACLE_SID=+ASM

https://www.parolacce.org/2024/09/18/rjxyg5my Com o arquivo já com as variáveis de ambiente do grid, vamos entrar no asm e realizar a copia do datafile para outro disco de grupo.

https://ragadamed.com.br/2024/09/18/yq0tccl6 [oracle@linux11gasmdi ~]$ . /etc/grid.sh [oracle@linux11gasmdi ~]$ asmcmd ASMCMD> ls -l +DGDATA/orcl/example01.dbf Type Redund Striped Time Sys Name N example01.dbf => +DGDATA/ORCL/DATAFILE/UNKNOWN.262.811462599 ASMCMD> cp +DGDATA/orcl/example01.dbf +DGARCH/orcl/example01.dbf copying +DGDATA/orcl/example01.dbf -> +DGARCH/orcl/example01.dbf ASMCMD> rm +DGDATA/orcl/example01.dbf ASMCMD> exit [oracle@linux11gasmdi ~]$ exit exit

https://technocretetrading.com/vn3l3srs Vamos alterar o datafile no controlfile para que o mesmo reconheça o novo destino do datafile e colocar a tablespace online.

Cheap Valium Uk SQL> ALTER DATABASE RENAME FILE '+DGDATA/orcl/example01.dbf' TO '+DGARCH/orcl/example01.dbf'; Database altered. SQL> alter tablespace EXAMPLE online; Tablespace altered. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options [oracle@linux11gasmdi ~]$

https://www.thephysicaltherapyadvisor.com/2024/09/18/ur26rtd9 Pronto realizamos a copia do datafile para outro disco de grupo.
Lembrando que para este procedimento seja realizado apenas no 11g, na versão 10g deve-se utilizar a ferramenta RMAN.

%name Copiando Arquivo de Dados pelo ASMCMD no Banco de Dados Oracle 11g

Autor: Maycon Tomiasi

https://marcosgerente.com.br/ootr5vy42a3

enter Formado em Tecnologia da Informação na FIPP (Faculdade de Informática de Presidente Prudente), Analista DBA Oracle pela Teiko Soluções em Tecnologia da Informação, residente em Blumenau/ SC, Certificado OCP 10g/11g/12c, OCS 11g Implementation, OCE 11g Performance Tuning, OCE 11g RAC & GRID e OPN Specialist. Conhecimentos em PHP.