RAC & ASM how to procedimentos ORACLE

CRS Start Stop procedimentos.

1
2
crsctl stop crs
crsctl start crs

Habilitar auto startup para o crs durante o processo de boot.

1
crsctl enable crs

Verificando o status dos serviços utilizando o comando crs_stat

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ crs_stat -v -tName Type R/RA F/FT Target State Host
ora....C1.inst application 0/5 0/0 ONLINE ONLINE node1
ora....C2.inst application 0/5 0/0 ONLINE ONLINE node2
ora.PRODDB.db application 0/1 0/1 ONLINE ONLINE node1
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE node1
ora....1.lsnr application 0/5 0/0 ONLINE ONLINE node1
ora.node1.gsd application 0/5 0/0 ONLINE ONLINE node1
ora.node1.ons application 0/3 0/0 ONLINE ONLINE node1
ora.node1.vip application 0/0 0/0 ONLINE ONLINE node1
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE node2
ora....2.lsnr application 0/5 0/0 ONLINE OFFLINE
ora.node2.gsd application 0/5 0/0 ONLINE ONLINE node2
ora.node2.ons application 0/3 0/0 ONLINE ONLINE node2
ora.node2.vip application 0/0 0/0 ONLINE ONLINE node2

Checando e Validando o cluster registry
$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 762628
Used space (kbytes) : 3848
Available space (kbytes) : 758780
ID : 1551687088
Device/File Name : /dev/rdsk/c3t500A09832D81B9Cd20s3
Device/File integrity check succeeded
Device/File Name : /dev/rdsk/c3t500A09832D81B9Cd21s3
Device/File integrity check succeededCluster registry integrity check succeeded

Sequência de startup para cada nó
srvctl start nodeapps -n node1
srvctl start asm -n node1
srvctl start instance -d PRODDB -i “PRODDB1” -c “system/welcome as sysdba”
srvctl start nodeapps -n node2
srvctl start asm -n node2
srvctl start instance -d PRODDB -i “PRODDB2” -c “system/welcome as sysdba”

Sequência de shutdown para cada nó
srvctl stop instance -d PRODDB -i “PRODDB2” –o immediate –c “system/welcome as sysdba”
srvctl stop asm –n dlel8
srvctl stop nodeapps –n node2srvctl stop instance –d PRODDB –i “PRODDB1” –o immediate –c “system/welcome as sysdba”
srvctl stop asm –n node1
srvctl stop nodeapps –n node1

Checando o status para todas as instancias utilizando o comando srvctl $ srvctl status database -d PRODDB
Instance PRODDB1 is running on node node1
Instance PRODDB2 is running on node node2

Checando uma Instância especifica do RAC

$ srvctl status instance –d PRODDB –I PRODDB2
Instance PRODDB2 is running on node node2

Checando o status das aplicações para um nó especifico
$ srvctl status nodeapps -n node1
VIP is running on node: node1
GSD is running on node: node1
Listener is running on node: node1
ONS daemon is running on node: node1
$ srvctl status nodeapps -n node2
VIP is running on node: node2
GSD is running on node: node2
Listener is running on node: node2
ONS daemon is running on node: node2

Checanco o status do ASM utilizando o comando srvctl
$ srvctl status asm -n node1
ASM instance +ASM1 is running on node node1.
$ srvctl status asm -n node2
ASM instance +ASM2 is running on node node2.

Sintaxe para identificar o nome da base do RAC
Como temos varios nós cria-se um alias único
$ srvctl config database
PRODDBMostra a configuração para o Banco de Dados do RAC
$ srvctl config database -d PRODDB
node1 PRODDB1 /u01/10gRAC/10gdb
node2 PRODDB2 /u01/10gRAC/10gdb

Mostra a disponibilidade dos nós para o banco de dados especificado
$ srvctl config service -d PRODDB
PRODDB_taf PREF: PRODDB2 PRODDB1 AVAIL:
 

Mostra a configuração as aplicações para o nó – (VIP, GSD, ONS, Listener)

$ srvctl config nodeapps -n node1 -a -g -s -l
VIP exists.: /node1-vip/157.170.142.129/255.255.255.0/eri0:ce2
GSD exists.
ONS daemon exists.
Listener exists.

Mostra a configuração do ASM para a(s) instância(s)
$ srvctl config asm -n node1
+ASM1 /u01/10gRAC/10gdb

Start das instâncias configuradas no RAC utilizando o comando srvctl.
srvctl start database –d PRODDB -c “system/welcome as sysdba”

Stop das instâncias configuradas no RAC utilizando o comando srvctl.

srvctl stop database –d PRODDB -c “system/welcome as sysdba”

Verificando quantas instâncias do ASM estão rodando no momento utilizando comandos SQL.
$ . ./ASMDB.env
$ sqlplus “/as sysdba”SQL>
SELECT * FROM V$ACTIVE_INSTANCES;
SQL>INST_NUMBER INST_NAME
———– ————————————————————
1 node1:+ASM1
2 node2:+ASM2

Agora instâncias do Banco de Dados.
$ . ./RACDB.env
$ sqlplus “/as sysdba”SQL>
SELECT * FROM V$ACTIVE_INSTANCES;
SQL>INST_NUMBER INST_NAME
———– ————————————————————
1 node1:PRODDB1
3 node2:PRODDB2
set linesize 300
SELECT
inst_id
, instance_number inst_no
, instance_name inst_name
, parallel
, status
, database_status db_status
, active_state state
, host_name host
FROM gv$instance
ORDER BY inst_id;INST_ID INST_NO INST_NAME PAR STATUS DB_STATUS STATE HOST
———- ———- —————- — ———— —————– ——— —————————————————————-
1 1 PRODDB1 YES OPEN ACTIVE NORMAL node1
2 2 PRODDB2 YES OPEN ACTIVE NORMAL node2

Valores do arquivo de parâmetros (init*.ora) que devem ter o mesmo valor para as instâncias configuradas.
Ex:
SQL> select distinct name,value from gv$parameter where upper(name) in(
2 ‘ACTIVE_INSTANCE_COUNT’,
3 ‘ARCHIVE_LAG_TARGET’,
4 ‘CLUSTER_DATABASE’,
5 ‘CLUSTER_DATABASE_INSTANCES’,
6 ‘CONTROL_FILES’,
7 ‘DB_BLOCK_SIZE’,
8 ‘DB_DOMAIN’,
9 ‘DB_FILES’,
10 ‘DB_NAME’,
11 ‘DB_RECOVERY_FILE_DEST’,
12 ‘DB_RECOVERY_FILE_DEST_SIZE’,
13 ‘DB_UNIQUE_NAME’,
14 ‘UNDO_MANAGEMENT’,
15 ‘CLUSTER_INTERCONNECTS’,
16 ‘SERVICE_NAMES’,
17 ‘LOCAL_LISTENER’,
18 ‘REMOTE_LISTENER’);
control_files +DG_DATA/PRODDB/controlfile/current.260.
636137965cluster_database TRUE
cluster_database_instances 2
undo_management AUTO
db_name PRODDB
active_instance_count
db_files 200
cluster_interconnects
db_recovery_file_dest_size 0
db_block_size 8192
local_listener
remote_listener LISTENERS_PRODDB
db_recovery_file_dest
db_domain
service_names PRODDB
db_unique_name PRODDB
archive_lag_target 017 rows selected.

Valores do arquivo de parâmetros (init*.ora) que devem ter os valores diferentes para as instâncias configuradas.
SQL>
SQL> select name,value from gv$parameter where upper(name) in(
‘INSTANCE_NUMBER’,
‘THREAD’,
‘UNDO_TABLESPACE’,
‘INSTANCE_NAME’);
thread 3
instance_number 3
undo_tablespace UNDOTBS3
instance_name PRODDB2
thread 1
instance_number 1
undo_tablespace UNDOTBS1
instance_name PRODDB18 rows selected.

crsd log files (Arquivos de log)
$ pwd
/u01/10gRAC/10gcrs/log/node1/crsd
$ ls -ltr
total 5200
-rw-r–r– 1 root root 2650250 Oct 30 16:14 crsd.log

Oracle Cluster Registry (OCR) log files & Cluster Synchronization Services (CSS) log files
$ pwd
/u01/10gRAC/10gcrs/log/node1/client
$ ls -lt more
total 224
-rw-r–r– 1 oracle dba 12516 Oct 30 16:14 clsc.log
-rw-r–r– 1 root root 718 Oct 30 15:23 css.log
-rw-r–r– 1 oracle dba 17415 Oct 22 05:11 oifcfg.log
-rw-r—– 1 oracle dba 168 Oct 16 17:41 ocr_11947_3.log

Event Manager (EVM) log files
$ pwd
/u01/10gRAC/10gcrs/log/node1/evmd
$ ls -ltr
total 544
-rw-r–r– 1 oracle dba 23997 Oct 30 15:29 evmd.log
-rw-r–r– 1 oracle dba 239194 Oct 30 16:16 evmdOUT.log

RAC arquivos de trace
$ pwd
/u01/10gRAC/10gcrs/log/node1/racg
$ ls -ltr
total 26
drwxrwxrwt 2 oracle dba 512 Oct 16 13:50 racgmain
drwxrwxrwt 2 oracle dba 512 Oct 16 13:50 racgeut
drwxrwxrwt 2 oracle dba 512 Oct 16 13:50 racgevtf
-rw-r–r– 1 root root 1142 Oct 29 15:46 ora.node2.vip.log
-rw-r–r– 1 root root 1715 Oct 29 16:26 ora.node1.vip.log
-rw-r–r– 1 oracle dba 32 Oct 29 16:26 evtf.log
-rw-r–r– 1 oracle dba 928 Oct 29 16:26 ora.PRODDB.db.log
-rw-r–r– 1 oracle dba 3372 Oct 30 15:26 ora.node1.ons.log

Query mais utilizadas no ASM disk groups, disks & clients instances
$ pwd
/u01/10gRAC
$
$ . ./ASM1.env
$ sqlplus “/as sysdba”SQL*Plus: Release 10.2.0.1.0 – Production on Tue Nov 20 12:32:49 2007Copyright (c) 1982, 2005, Oracle. All rights reserved.Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
(Query para verificar o espaço utilizado e o espaço livre)
SQL> SELECT NAME,TYPE,TOTAL_MB,FREE_MB FROM V$ASM_DISKGROUP;NAME TYPE     TOTAL_MB                   FREE_MB
—————————— —— ———- ———-
DG_DATA NORMAL 42976                     39432
DG_ARCH EXTERN 21488                     21393SQL> SELECT INSTANCE_NAME FROM V$ASM_CLIENT;PRODDB1SQL>
SQL>
1* SELECT NAME,PATH FROM V$ASM_DISK
SQL> /NAME PATH
—————————— ——————————————————————————–
/dev/rdsk/c12t60A9800042E54716434453530707569d0s3
/dev/rdsk/c12t60A9800042E5471643444757A554167d0s3
/dev/rdsk/c12t60A9800042E5471643444757A547451d0s3
/dev/rdsk/c12t60A9800042E5471643444757A545879d0s3
DG_ARCH_0000 /dev/rdsk/c12t60A9800042E5471643444757A594441d0s3
DG_DATA_0001 /dev/rdsk/c12t60A9800042E5471643444757A58726Ed0s3
DG_DATA_0000 /dev/rdsk/c12t60A9800042E5471643444757A584B76d0s37 rows selected.SELECT gname,sum(space) used_mb
FROM
(
SELECT space,gname
FROM (
SELECT g.name gname, a.parent_index pindex, a.name aname, vf.space,
a.reference_index rindex, a.ALIAS_DIRECTORY dir, a.SYSTEM_CREATED sys
FROM v$asm_alias a, v$asm_diskgroup g, v$asm_file vf
WHERE a.group_number = g.group_number
and a.file_number=vf.file_number(+)
and a.group_number=vf.group_number(+)
)
START WITH (MOD(pindex, POWER(2,24))) = 0
CONNECT BY PRIOR rindex = pindex
) GROUP BY gname;GNAME                        USED_MB
—————————— ———-
DG_ARCH                     2097152
DG_DATA                     3546284032SELECT CONCAT(‘+’gname, SYS_CONNECT_BY_PATH(aname,’/’)) full_path,
dir, sys FROM (SELECT g.name gname, a.parent_index pindex, a.name aname,
a.reference_index rindex, a.ALIAS_DIRECTORY dir, a.SYSTEM_CREATED sys
FROM v$asm_alias a, v$asm_diskgroup g
WHERE a.group_number = g.group_number)
START WITH (MOD(pindex, POWER(2, 24))) = 0
CONNECT BY PRIOR rindex = pindex
ORDER BY dir desc, full_path ascFULL_PATH D S
———————————————————————- – –
+DG_ARCH/PRODDB Y Y
+DG_ARCH/PRODDB/PARAMETERFILE Y Y
+DG_DATA/PRODDB Y Y
+DG_DATA/PRODDB/CONTROLFILE Y Y
+DG_DATA/PRODDB/DATAFILE Y Y
+DG_DATA/PRODDB/ONLINELOG Y Y
+DG_DATA/PRODDB/TEMPFILE Y Y
+DG_ARCH/PRODDB/PARAMETERFILE/spfile.256.639080871 N Y
+DG_ARCH/PRODDB/spfilePRODDB.ora N N
+DG_DATA/PRODDB/CONTROLFILE/Current.260.639080591 N Y
+DG_DATA/PRODDB/DATAFILE/EXAMPLE.264.639080611 N YFULL_PATH D S
———————————————————————- – –
+DG_DATA/PRODDB/DATAFILE/SYSAUX.257.639080475 N Y
+DG_DATA/PRODDB/DATAFILE/SYSTEM.256.639080475 N Y
+DG_DATA/PRODDB/DATAFILE/UNDOTBS1.258.639080477 N Y
+DG_DATA/PRODDB/DATAFILE/UNDOTBS2.265.639080809 N Y
+DG_DATA/PRODDB/DATAFILE/USERS.259.639080477 N Y
+DG_DATA/PRODDB/DATAFILE/USERS.268.639139571 N Y
+DG_DATA/PRODDB/ONLINELOG/group_1.261.639080593 N Y
+DG_DATA/PRODDB/ONLINELOG/group_2.262.639080595 N Y
+DG_DATA/PRODDB/ONLINELOG/group_3.266.63908027 N Y
+DG_DATA/PRODDB/ONLINELOG/group_4.267.63908029 N Y
+DG_DATA/PRODDB/TEMPFILE/TEMP.263.639080603 N Y

Removendo arquivos no ambiente ASM ( fora do asmcmd)

select ‘alter diskgroup DSKGRP1 drop file
”//ARCHIVELOG/’ to_char(b.creation_date,’YYYY_MM_DD’) ‘/’ a.name”’;’
from v$asm_alias a, v$asm_file b
where a.group_number = b.group_number
and a.file_number = b.file_number
and b.type=’ARCHIVELOG’
order by a.name;
‘ALTERDISKGROUPDSKGRP1DROPFILE”//ARCHIVELOG/’TO_CHAR(B.CRE
——————————————————————————–
alter diskgroup DSKGRP1 drop file
‘//ARCHIVELOG/2007_12_05/thread_1_seq_96.257.64051781’;alter diskgroup DSKGRP1 drop file
‘//ARCHIVELOG/2007_12_05/thread_1_seq_97.259.640517899’;alter diskgroup DSKGRP1 drop file
‘//ARCHIVELOG/2007_12_05/thread_2_seq_29.258.640517897’;SQL> select distinct type from v$asm_file;TYPE
—————————————————————-
ARCHIVELOG
CONTROLFILE
DATAFILE
ONLINELOG
PARAMETERFILE
TEMPFILE6 rows selected.

Visões importantes do dicionário de dados para o ASMv$asm_diskgroup
v$asm_disk
v$asm_file
v$asm_template
v$asm_alias
v$asm_operation

Lista de  tablespaces no RAC ASM

select tablespace_name, file_name,bytes/(1024*1024)
from dba_data_files
union
select tablespace_name, file_name,bytes/(1024*1024)
from dba_temp_files;

TABLESPACE_NAME FILE_NAME BYTES/(1024*1024)
—————————— ————————————————– —————–
EXAMPLE +DG_DATA/PRODDB/datafile/example.264.639080611 100
SYSAUX +DG_DATA/PRODDB/datafile/sysaux.257.639080475 260
SYSTEM +DG_DATA/PRODDB/datafile/system.256.639080475 480
TEMP +DG_DATA/PRODDB/tempfile/temp.263.639080603 20
UNDOTBS1 +DG_DATA/PRODDB/datafile/undotbs1.258.639080477 50
UNDOTBS2 +DG_DATA/PRODDB/datafile/undotbs2.265.639080809 25
USERS +DG_DATA/PRODDB/datafile/users.259.639080477 5
Resize the datafile in ASM environment alter database datafile ‘+DG_DATA/PRODDB/datafile/example.264.639080611’ resize 150m;
Add a datafile to a tablespace in ASM environment alter tablespace users add datafile ‘+DG_DATA’ size 50m autoextend off;
Resize the tempfile in ASM environment alter database tempfile ‘+DG_DATA/PRODDB/tempfile/temp.263.639080603’ resize 400m;
 

Verificando se o TAF esta configurado e funcionando

Step 1: no nó 1 verifique o TNS PRODDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PRODDB)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD =BASIC)
(RETRIES =180)
(DELAY = 5)
)
)
) No nó 1 connect no database PRODDB1 e verifiquecolumn name format a30
column value format a30
select name,value from v$parameter where name in(‘service_names’,’local_listener’,’remote_listener’,’db_name’,’instance_name’);
SQL> SQL> SQL>
NAME VALUE
—————————— ——————————
instance_name PRODDB1
service_names PRODDB
local_listener LISTENER_node1
remote_listener LISTENERS_PRODDB
db_name PRODDBno nó 1 verifique o tns e suas configurações LISTENERS_PRODDB & LISTENER_node1 existem ?. se não você deverá configurar.LISTENERS_PRODDB =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
)LISTENER_node1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PRODDB)
(INSTANCE_NAME = PRODDB1)
)
)
Execute as mesmas etapas no nó 2 e em todos os nós subseqüentessqlplus scott/welcome@PRODDB.
Verifique as sessões conectadas ao seu database 1 SELECT
instance_name
, host_name
, NULL AS failover_type
, NULL AS failover_method
, NULL AS failed_over
FROM v$instance
UNION
SELECT
NULL
, NULL
, failover_type
, failover_method
, failed_over
FROM v$session
WHERE username = ‘SCOTT’;
INSTANCE_NAME HOST_NAME FAILOVER_TYPE FAILOVER_METHOD FAILED_OVER
————- ——— ————- ————— ———–
PRODDB1 node1
#Vamos testar as configurações agora pare o PRODDB1 database$ srvctl stop instance -d PRODDB -i PRODDB1 -o abort$ srvctl status database -d PRODDB
Instance PRODDB1 is not running on node node1
Instance PRODDB2 is running on node node2

Agora vamos executar a query abaixo;

COLUMN instance_name FORMAT a13
COLUMN host_name FORMAT a9
COLUMN failover_method FORMAT a15
COLUMN failed_over FORMAT a11SELECT
instance_name
, host_name
, NULL AS failover_type
, NULL AS failover_method
, NULL AS failed_over
FROM v$instance
UNION
SELECT
NULL
, NULL
, failover_type
, failover_method
, failed_over
FROM v$session
WHERE username = ‘SCOTT’;
INSTANCE_NAME HOST_NAME FAILOVER_TYPE FAILOVER_METHOD FAILED_OVER
————- ——— ————- ————— ———–
PRODDB2 node2
SELECT BASIC NO

Upgrading the RAC database from 10.2.0.1 to 10.2.0.3
Download patch set
Shutdown crs, database, asm, liseteners
Update crs home
Update oracle home
Start asm on node1
Start up nomount racdb on node1
Restart racdb on node1
Disable cluster_database init parameter setting
Restart racdb on node1
Upgrade database using startup upgrade catupgrd.sql & utlrp.sql
Enable cluster_database init parameter setting
Restart racdb on node1 and node2

Renomeando e Realocando os Datafiles
SQL> ALTER DATABASE DATAFILE ‘+DG_DATA/PRODDB/datafile/users.268.639139571’ OFFLINE;Database altered.SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
$ rmanRecovery Manager: Release 10.2.0.3.0 – Production on Wed Dec 5 09:40:46 2007Copyright (c) 1982, 2005, Oracle. All rights reserved.RMAN> connect target /connected to target database: PRODDB (DBID=4038713422)RMAN> COPY DATAFILE ‘+DG_DATA/PRODDB/datafile/users.268.639139571’ TO ‘+DG_ARCH’;Starting backup at 05-DEC-07
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=491 instance=PRODDB1 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00007 name=+DG_DATA/PRODDB/datafile/users.268.639139571
output filename=+DG_ARCH/PRODDB/datafile/users.260.640518077 tag=TAG20071205T094115 recid=2 stamp=640518077
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 05-DEC-07RMAN> exitRecovery Manager complete.

$ sqlplus “/as sysdba”SQL*Plus: Release 10.2.0.3.0 – Production on Wed Dec 5 09:44:56 2007Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining optionsSQL>
ALTER DATABASE RENAME FILE ‘+DG_DATA/PRODDB/datafile/users.268.639139571’ TO ‘+DG_ARCH/PRODDB/datafile/users.260.640518077’
SQL> 2
SQL> /Database altered.SQL> exit;$ rmanRecovery Manager: Release 10.2.0.3.0 – Production on Wed Dec 5 09:46:09 2007Copyright (c) 1982, 2005, Oracle. All rights reserved.RMAN> connect target /connected to target database: PRODDB (DBID=4038713422)RMAN>SWITCH DATAFILE ‘+DG_ARCH/PRODDB/datafile/users.260.640518077’ TO COPY;
RMAN>
RMAN>using target database control file instead of recovery catalog
datafile 7 switched to datafile copy “+DG_ARCH/PRODDB/datafile/users.260.640518077″RMAN> exit
Recovery Manager complete.
$ sqlplus “/as sysdba”SQL*Plus: Release 10.2.0.3.0 – Production on Wed Dec 5 09:46:33 2007Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining optionsSQL>
RECOVER DATAFILE ‘+DG_ARCH/PRODDB/datafile/users.260.640518077’;SQL>
Media recovery complete.
SQL>
ALTER DATABASE DATAFILE ‘+DG_ARCH/PRODDB/datafile/users.260.640518077′ ONLINE;
SQL>
Database altered. Steps to change the RAC database from no-archive mode to archive modeSQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /u01/10gRAC/10gdb/dbs/arch
Oldest online log sequence 95
Current log sequence 96
SQL> alter system set log_archive_dest_state_1=enable scope=spfile sid=’*’;System altered.
SQL> alter system set log_archive_dest_1=’LOCATION=+DG_ARCH’ scope=spfile sid=’*’;System altered.SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.Total System Global Area 1526726656 bytes
Fixed Size 2226904 bytes
Variable Size 916194600 bytes
Database Buffers 603979776 bytes
Redo Buffers 4325376 bytes
Database mounted.SQL> alter system switch logfile;System altered.SQL> alter system archive log current;System altered.SQL> select name from v$archived_log;NAME+DG_ARCH/PRODDB/archivelog/2007_12_05/thread_1_seq_96.257.64051781
+DG_ARCH/PRODDB/archivelog/2007_12_05/thread_2_seq_29.258.640517897
+DG_ARCH/PRODDB/archivelog/2007_12_05/thread_1_seq_97.259.640517899
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +DG_ARCH
Oldest online log sequence 97
Next log sequence to archive 98
Current log sequence 98
Multiplex Controlfiles SQL> show parameter controlNAME TYPE VALUEcontrol_file_record_keep_time integer 7
control_files string +DG_DATA/PRODDB/controlfile/cu
rrent.260.639080591$ rmanRecovery Manager: Release 10.2.0.3.0 – Production on Wed Dec 5 10:15:53 2007Copyright (c) 1982, 2005, Oracle. All rights reserved.RMAN> connect target /connected to target database: PRODDB (not mounted)RMAN>restore controlfile to ‘+DG_DATA/PRODDB/controlfile/control2.ctl’ from ‘+DG_DATA/PRODDB/controlfile/current.260.639080591’;RMAN>
RMAN>
Starting restore at 05-DEC-07
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=373 instance=PRODDB1 devtype=DISKchannel ORA_DISK_1: copied control file copy
Finished restore at 05-DEC-07RMAN>
restore controlfile to ‘+DG_DATA/PRODDB/controlfile/control3.ctl’ from ‘+DG_DATA/PRODDB/controlfile/current.260.639080591′;RMAN>
Starting restore at 05-DEC-07
using channel ORA_DISK_1channel ORA_DISK_1: copied control file copy
Finished restore at 05-DEC-07RMAN>SQL>
alter system set control_files=’+DG_DATA/PRODDB/controlfile/current.260.639080591’,
‘+DG_DATA/PRODDB/controlfile/control2.ctl’,
‘+DG_DATA/PRODDB/controlfile/control3.ctl’ scope=spfile sid=’*’;
SQL>
System altered.SQL> show parameter controlNAME TYPE VALUEcontrol_file_record_keep_time integer 7
control_files string +DG_DATA/PRODDB/controlfile/cu
rrent.260.639080591
SQL> shutdown immediate;
ORA-01507: database not mountedORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.Total System Global Area 1526726656 bytes
Fixed Size 2226904 bytes
Variable Size 916194600 bytes
Database Buffers 603979776 bytes
Redo Buffers 4325376 bytes
SQL> show parameter controlNAME TYPE VALUEcontrol_file_record_keep_time integer 7
control_files string +DG_DATA/PRODDB/controlfile/cu
rrent.260.639080591, +DG_DATA/
PRODDB/controlfile/control2.ct
l, +DG_DATA/PRODDB/controlfile
/control3.ctl
SQL> alter database mount;
Database altered.
SQL> alter database open;

 

 

BY Ricardo Franco Argona – CS Suporte Banco de Dados