Para melhor visualização, recomendo resolução de no mínimo 1024 x 768 e navegador Mozilla Firefox


segunda-feira, 4 de janeiro de 2016

RMAN - Restaurando o backup de um banco de dados Physical Standby para uso no modo READ/WRITE

Por Eduardo Legatti

Olá,

Nos artigos de Novembro/2011, Janeiro/2012 e Outubro/2012 eu abordei alguns cenários usando o RMAN (Recovery Manager) envolvendo clonagem de bancos de dados através do comando DUPLICATE, restauração e recuperação de um banco de dados em uma outra máquina e até mesmo a criação de um banco de dados standby pelo RMAN. No artigo deste mês irei abordar também a restauração e recuperação de um banco de dados pelo RMAN, mas a diferença é que o backup utilizado será um backup frio (Cold Backup) feito um banco de dados Physical Standby. Dentre alguns motivos para se realizar o backup de um banco de dados standby, imagine que o banco de dados primário (Primary) esteja em um servidor remoto em algum serviço na nuvem e o banco de dados standby esteja em um servidor local usando a infraestrutura da sua própria empresa. Imaginando que o banco de dados tenha centenas de giga bytes de tamanho, qual seria a melhor alternativa no que se refere a custo e tempo para restaurar uma cópia desse banco em um servidor local da empresa?

Uma alternativa seria fazer o download de um monstruoso backup físico  que está localizado remotamente na nuvem, o que consumiria um tráfego de dados imenso e, dependendo da velocidade do download, poderia levar dias para concluir, e isso se o download não falhar. A outra alternativa seria fazer um backup do banco de dados standby que já é replicado em um servidor que está na empresa, restaurá-lo, abri-lo como como de leitura/escrita e usá-lo. Neste caso a alternativa 2, na minha opinião, seria a mais adequada.

No mais, segue abaixo os procedimentos que usarei para restaurar um banco de dados standby em um outro servidor e abri-lo como leitura/escrita. Vale a pena salientar que podemos abrir diretamente um banco de dados standby para leitura/escrita através do recurso SNAPSHOT STANDBY database à partir do Oracle 11g, mas o que eu quero mostrar nesse artigo é a possibilidade que temos de fazer o backup de um backup standby e restaurá-lo como se fosse um banco de dados comum.

Em relação ao backup do banco de dados standby BD01 que usarei como exemplo, segue abaixo os comandos que executei. Vale a pensa salientar que alguns comandos podem ser executados tanto pelo SQL*Plus quanto pelo RMAN.

RMAN> sql "alter database recover managed standby database cancel";
RMAN> configure controlfile autobackup off;
RMAN> backup as compressed backupset format '/backup/standby/BD01/BKP_%d_FULL_COLD_%T_%s.bkp' database;
RMAN> backup current controlfile format '/backup/standby/BD01/BKP_%d_CONTROLFILE_%T_%s.bkp';
RMAN> backup spfile format '/backup/standby/BD01/BKP_%d_SPFILE_%T_%s.bkp';
RMAN> sql "alter database recover managed standby database using current logfile disconnect from session";

Após a execução do cold backup pelo RMAN, poderemos ver abaixo que os seguintes arquivos foram criados.

$ ls -lh /backup/flash_recovery_area/BD01
total 1.6G
-rw-r----- 1 oracle oinstall 1.5M Jan 1 10:00 BKP_BD01_CONTROLFILE_20160101_4547.bkp
-rw-r----- 1 oracle oinstall 1.6G Jan 1 10:00 BKP_BD01_FULL_COLD_20160101_4545.bkp
-rw-r----- 1 oracle oinstall 1.5M Jan 1 10:00 BKP_BD01_FULL_COLD_20160101_4546.bkp
-rw-r----- 1 oracle oinstall  96K Jan 1 10:00 BKP_BD01_SPFILE_20160101_4548.bkp

Como irei realizar a restauração deste backup em um outro servidor diferente do servidor aonde está configurado o banco standby, irei criar as estruturas de diretórios conforme demonstrado abaixo.
  • Copiar ou criar o arquivo de senha orapwBD01 para o servidor de destino no diretório $ORACLE_HOME/dbs
  • Criar as estruturas de diretórios em $ORACLE_BASE/ADMIN
  • Copiar o backup para a flash_recovery_area no servidor de destino (utilizarei o mesmo caminho do servidor de origem)
  • Criar a estrutura de diretório que será o destino dos datafiles restaurados (/recovery/oradata/BD01)
Já que a restauração dos arquivos de dados será realizada em uma localização diferente, não precisarei criar os diretórios referentes às localizações dos datafiles iguais ao banco de dados de origem. Após a criação das estruturas acima, irei realizar a restauração do spfile, controlfile e remover as configurações no spfile relacionadas ao Data Guard. Após abrir o banco de dados no modo MOUNT, irei catalogar os arquivos de backup através do RMAN usando o comando CATALOG conforme roteiro abaixo. O destino dos arquivos de dados restaurados será /recovery/oradata/BD01.

$ export ORA_RMAN_SGA_TARGET=512
$ export ORACLE_SID=BD01
$ rman target /
RMAN> startup nomount;
RMAN> restore spfile from '/backup/flash_recovery_area/BD01/BKP_BD01_SPFILE_20160101_4548.bkp';
RMAN> startup nomount force;
RMAN> sql "alter system set control_files=''/recovery/oradata/BD01/control01.ctl'',''/recovery/oradata/BD01/control02.ctl'',''/recovery/oradata/BD01/control03.ctl'' scope=spfile";
RMAN> sql "alter system set log_archive_dest_2=''''";
RMAN> sql "alter system set log_archive_config=''''";
RMAN> sql "alter system set fal_client=''''";
RMAN> startup nomount force;
RMAN> restore controlfile from '/backup/flash_recovery_area/BD01/BKP_BD01_CONTROLFILE_20160101_4547.bkp';
RMAN> alter database mount;
RMAN> catalog start with '/backup/flash_recovery_area/BD01' noprompt;

Após executar os comandos acima, irei executar o comando SET NEW NAME de forma que os arquivos de dados sejam restaurados em /recovery/oradata/BD01. Vale a pena salientar que à partir do Oracle 11g podemos utilizar o comando SET NEWNAME FOR DATABASE que fará esse trabalho para todos os datafiles.

RMAN> run {
2> set newname for database to '/recovery/oradata/BD01/%b';
3> restore database;
4> switch datafile all;}

Uma outra forma seria usar a opção disponível nas versões anteriores, ou seja, executar o comando para cada datafile conforme demonstrado abaixo.

RMAN> run {
 2> set newname for datafile 1 to '/recovery/oradata/BD01/system01.dbf';
 3> set newname for datafile 2 to '/recovery/oradata/BD01/sysaux01.dbf';
 4> set newname for datafile 4 to '/recovery/oradata/BD01/users01.dbf';
 5> set newname for datafile 5 to '/recovery/oradata/BD01/DATA_ORCL_01_001.dbf';
 6> set newname for datafile 6 to '/recovery/oradata/BD01/undotbs01.dbf';
 7> set newname for datafile 7 to '/recovery/oradata/BD01/LOB_ORCL_01_001.dbf';
 8> set newname for datafile 8 to '/recovery/oradata/BD01/DATA_PAT_01_001.dbf';
 9> set newname for datafile 9 to '/recovery/oradata/BD01/DATA_RH_01_001.dbf';
10> set newname for datafile 10 to '/recovery/oradata/BD01/DATA_SIG_01_001.dbf';
11> set newname for datafile 14 to '/recovery/oradata/BD01/LOB_PAT_01_001.dbf';
12> set newname for datafile 15 to '/recovery/oradata/BD01/LOB_RH_01_001.dbf';
13> set newname for datafile 16 to '/recovery/oradata/BD01/LOB_SIG_01_001.dbf';
14> set newname for datafile 17 to '/recovery/oradata/BD01/INDX_PAT_01_001.dbf';
15> set newname for datafile 18 to '/recovery/oradata/BD01/INDX_RH_01_001.dbf';
16> set newname for datafile 19 to '/recovery/oradata/BD01/INDX_ORCL_01_001.dbf';
17> set newname for datafile 20 to '/recovery/oradata/BD01/INDX_SIG_01_001.dbf';
18> restore database;
19> switch datafile all;}

Por fim, após a restauração realizada, bastará apenas abrir o banco de dados com a opção RESETLOGS e alterar a tablespace TEMP para o novo destino.

SQL> alter database open resetlogs;
SQL> alter database tempfile 1 drop;
SQL> alter tablespace temp add tempfile '/recovery/oradata/BD01/temp01.dbf' size 100M;

Segue abaixo a simulação completa dos procedimentos que que foram realizados.

[oracle@serv01 ~]$ ls -lh /backup/flash_recovery_area/BD01
total 1.6G
-rw-r----- 1 oracle oinstall 1.5M Jan 1 10:00 BKP_BD01_CONTROLFILE_20160101_4547.bkp
-rw-r----- 1 oracle oinstall 1.6G Jan 1 10:00 BKP_BD01_FULL_COLD_20160101_4545.bkp
-rw-r----- 1 oracle oinstall 1.5M Jan 1 10:00 BKP_BD01_FULL_COLD_20160101_4546.bkp
-rw-r----- 1 oracle oinstall  96K Jan 1 10:00 BKP_BD01_SPFILE_20160101_4548.bkp


[oracle@serv01 ~]$ export ORA_RMAN_SGA_TARGET=512
[oracle@serv01 ~]$ export ORACLE_SID=BD01
[oracle@serv01 ~]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Jan 1 10:02:30 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> startup nomount;

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initBD01.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area     534462464 bytes

Fixed Size                     2230072 bytes
Variable Size                192940232 bytes
Database Buffers             331350016 bytes
Redo Buffers                   7942144 bytes

RMAN> restore spfile from '/backup/flash_recovery_area/BD01/BKP_BD01_SPFILE_20160101_4548.bkp';

Starting restore at 01/01/2016
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=396 device type=DISK

channel ORA_DISK_1: restoring spfile from AUTOBACKUP /backup/flash_recovery_area/BD01/BKP_BD01_SPFILE_20160101_4548.bkp
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 01/01/2016

RMAN> startup nomount force;

Oracle instance started

Total System Global Area     313159680 bytes

Fixed Size                     2227944 bytes
Variable Size                130023704 bytes
Database Buffers             176160768 bytes
Redo Buffers                   4747264 bytes

RMAN> sql "alter system set control_files=''/recovery/oradata/BD01/control01.ctl'',''/recovery/oradata/BD01/control02.ctl'',''/recovery/oradata/BD01/control03.ctl'' scope=spfile";

sql statement: alter system set control_files=''/recovery/oradata/BD01/control01.ctl'',''/recovery/oradata/BD01/control02.ctl'',''/recovery/oradata/BD01/control03.ctl'' scope=spfile

RMAN> sql "alter system set log_archive_dest_2=''''";

sql statement: alter system set log_archive_dest_2=''''

RMAN> sql "alter system set log_archive_config=''''";

sql statement: alter system set log_archive_config=''''

RMAN> sql "alter system set fal_client=''''";

sql statement: alter system set fal_client=''''

RMAN> startup nomount force;

Oracle instance started

Total System Global Area     313159680 bytes

Fixed Size                     2227944 bytes
Variable Size                130023704 bytes
Database Buffers             176160768 bytes
Redo Buffers                   4747264 bytes

RMAN> restore controlfile from '/backup/flash_recovery_area/BD01/BKP_BD01_CONTROLFILE_20160101_4547.bkp';

Starting restore at 01/01/2016
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=96 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:07
output file name=/recovery/oradata/BD01/control01.ctl
output file name=/recovery/oradata/BD01/control02.ctl
output file name=/recovery/oradata/BD01/control03.ctl
Finished restore at 01/01/2016

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

RMAN> catalog start with '/backup/flash_recovery_area/BD01' noprompt;

Starting implicit crosscheck backup at 01/01/2016
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=96 device type=DISK
Crosschecked 75 objects
Finished implicit crosscheck backup at 01/01/2016

Starting implicit crosscheck copy at 01/01/2016
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 01/01/2016

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /backup/flash_recovery_area/BD01_STBY/archivelog/2015_11_16/o1_mf_1_1_c4n0kxrj_.arc

searching for all files that match the pattern /backup/flash_recovery_area/BD01

List of Files Unknown to the Database
=====================================
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_5_c4mpoood_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_7_c4mpoq1w_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_6_c4mpopbz_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_6_c4n012cg_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_3_c4mw8xf6_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_2_c4mpmotd_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_3_c4mzz2fn_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_2_c4mw8wmv_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_1_c4mpmo59_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_3_c4mpmpjf_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_1_c4mw8vsj_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_7_c4n0132l_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_5_c4n011nv_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_2_c4mzz1o5_.log
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_1_c4mzz0tn_.log
File Name: /backup/flash_recovery_area/BD01/BKP_BD01_FULL_COLD_20160101_4545.bkp
File Name: /backup/flash_recovery_area/BD01/BKP_BD01_SPFILE_20160101_4548.bkp
File Name: /backup/flash_recovery_area/BD01/BKP_BD01_FULL_COLD_20160101_4546.bkp
File Name: /backup/flash_recovery_area/BD01/BKP_BD01_CONTROLFILE_20160101_4547.bkp
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /backup/flash_recovery_area/BD01/BKP_BD01_FULL_COLD_20160101_4545.bkp
File Name: /backup/flash_recovery_area/BD01/BKP_BD01_SPFILE_20160101_4548.bkp
File Name: /backup/flash_recovery_area/BD01/BKP_BD01_FULL_COLD_20160101_4546.bkp
File Name: /backup/flash_recovery_area/BD01/BKP_BD01_CONTROLFILE_20160101_4547.bkp

List of Files Which Where Not Cataloged
=======================================
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_5_c4mpoood_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_7_c4mpoq1w_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_6_c4mpopbz_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_6_c4n012cg_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_3_c4mw8xf6_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_2_c4mpmotd_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_3_c4mzz2fn_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_2_c4mw8wmv_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_1_c4mpmo59_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_3_c4mpmpjf_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_1_c4mw8vsj_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_7_c4n0132l_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_5_c4n011nv_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_2_c4mzz1o5_.log
  RMAN-07529: Reason: catalog is not supported for this file type
File Name: /backup/flash_recovery_area/BD01_STBY/onlinelog/o1_mf_1_c4mzz0tn_.log
  RMAN-07529: Reason: catalog is not supported for this file type

RMAN> run {
2> set newname for database to '/recovery/oradata/BD01/%b';
3> restore database;
4> switch datafile all;}

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 01/01/2016
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /recovery/oradata/BD01/system01.dbf
channel ORA_DISK_1: restoring datafile 00002 to /recovery/oradata/BD01/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /recovery/oradata/BD01/users01.dbf
channel ORA_DISK_1: restoring datafile 00005 to /recovery/oradata/BD01/DATA_ORCL_01_001.dbf
channel ORA_DISK_1: restoring datafile 00006 to /recovery/oradata/BD01/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00007 to /recovery/oradata/BD01/LOB_ORCL_01_001.dbf
channel ORA_DISK_1: restoring datafile 00008 to /recovery/oradata/BD01/DATA_PAT_01_001.dbf
channel ORA_DISK_1: restoring datafile 00009 to /recovery/oradata/BD01/DATA_RH_01_001.dbf
channel ORA_DISK_1: restoring datafile 00010 to /recovery/oradata/BD01/DATA_SIG_01_001.dbf
channel ORA_DISK_1: restoring datafile 00014 to /recovery/oradata/BD01/LOB_PAT_01_001.dbf
channel ORA_DISK_1: restoring datafile 00015 to /recovery/oradata/BD01/LOB_RH_01_001.dbf
channel ORA_DISK_1: restoring datafile 00016 to /recovery/oradata/BD01/LOB_SIG_01_001.dbf
channel ORA_DISK_1: restoring datafile 00017 to /recovery/oradata/BD01/INDX_PAT_01_001.dbf
channel ORA_DISK_1: restoring datafile 00018 to /recovery/oradata/BD01/INDX_RH_01_001.dbf
channel ORA_DISK_1: restoring datafile 00019 to /recovery/oradata/BD01/INDX_ORCL_01_001.dbf
channel ORA_DISK_1: restoring datafile 00020 to /recovery/oradata/BD01/INDX_SIG_01_001.dbf
channel ORA_DISK_1: reading from backup piece /backup/flash_recovery_area/BD01/BKP_BD01_FULL_COLD_20160101_4545.bkp
channel ORA_DISK_1: piece handle=/backup/flash_recovery_area/BD01/BKP_BD01_FULL_COLD_20160101_4545.bkp tag=TAG20160101T090038
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:32:26
Finished restore at 01/01/2016

datafile 1 switched to datafile copy
input datafile copy RECID=34 STAMP=895946013 file name=/recovery/oradata/BD01/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=35 STAMP=895946013 file name=/recovery/oradata/BD01/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=36 STAMP=895946013 file name=/recovery/oradata/BD01/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=37 STAMP=895946013 file name=/recovery/oradata/BD01/DATA_ORCL_01_001.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=38 STAMP=895946013 file name=/recovery/oradata/BD01/undotbs01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=39 STAMP=895946013 file name=/recovery/oradata/BD01/LOB_ORCL_01_001.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=40 STAMP=895946014 file name=/recovery/oradata/BD01/DATA_PAT_01_001.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=41 STAMP=895946014 file name=/recovery/oradata/BD01/DATA_RH_01_001.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=42 STAMP=895946014 file name=/recovery/oradata/BD01/DATA_SIG_01_001.dbf
datafile 14 switched to datafile copy
input datafile copy RECID=43 STAMP=895946014 file name=/recovery/oradata/BD01/LOB_PAT_01_001.dbf
datafile 15 switched to datafile copy
input datafile copy RECID=44 STAMP=895946014 file name=/recovery/oradata/BD01/LOB_RH_01_001.dbf
datafile 16 switched to datafile copy
input datafile copy RECID=45 STAMP=895946014 file name=/recovery/oradata/BD01/LOB_SIG_01_001.dbf
datafile 17 switched to datafile copy
input datafile copy RECID=46 STAMP=895946014 file name=/recovery/oradata/BD01/INDX_PAT_01_001.dbf
datafile 18 switched to datafile copy
input datafile copy RECID=47 STAMP=895946014 file name=/recovery/oradata/BD01/INDX_RH_01_001.dbf
datafile 19 switched to datafile copy
input datafile copy RECID=48 STAMP=895946014 file name=/recovery/oradata/BD01/INDX_ORCL_01_001.dbf
datafile 20 switched to datafile copy
input datafile copy RECID=49 STAMP=895946014 file name=/recovery/oradata/BD01/INDX_SIG_01_001.dbf

RMAN> alter database open resetlogs;

database opened

RMAN> exit

Recovery Manager complete.

[oracle@serv01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jan 1 10:45:32 2015

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Conectado a:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select file#,name from v$tempfile;

     FILE# NAME
---------- ----------------------------------------
         1 /data/oradata/BD01/temp01.dbf

SQL> alter database tempfile 1 drop;

Banco de dados alterado.

SQL> alter tablespace temp add tempfile '/recovery/oradata/BD01/temp01.dbf' size 100M;

Tablespace alterado.

Google+

Nenhum comentário:

Postagens populares