RENAME RELOCATE DATA FILES AND RESIZING LOG FILES IN DR ENV.pdf

September 6, 2017 | Author: G.R.THIYAGU ; Oracle DBA | Category: Oracle Database, Databases, Computer Architecture, Information Retrieval, Computer Engineering
Share Embed Donate


Short Description

Download RENAME RELOCATE DATA FILES AND RESIZING LOG FILES IN DR ENV.pdf...

Description

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

STANDBY_FILE_MANAGEMENT

The default value is MANUAL. Once you set to AUTO whenever you add or drop files on Primary database, those files are reflected automatically on the Standby database. Let’s check. ENVIRONMENT DETAILS

Database Name

: crms

Primary db_unique_name : crms Standby db_unique_name : stbycrms Primary Site

: SERVER1 – 192.168.117.131

Standby Site

: SERVER2 – 192.168.117.129

Standby Database type

: Physical Standby

Data Protection Mode

: MAXIMUM PERFORMANCE

# ON THE PRIMARY DATABASE SYS> show parameter STANDBY_FILE_MANAGEMENT; NAME

TYPE

VALUE

------------------------------------ ----------- -------standby_file_management

string

AUTO

# ON THE STANDBY DATABASE SYS> show parameter STANDBY_FILE_MANAGEMENT; NAME

TYPE

VALUE

------------------------------------ ----------- -------standby_file_management

string

AUTO

SYS> show parameter db_file_name; NAME

TYPE

VALUE

------------------------------------ ---------- -----------------------------db_file_name_convert

string

/u01/app/oracle/oradata/crms/, /u01/app/oracle/oradata/stbycrms/

# CREATE THE TABLESPACE ON PRIMARY DATABASE SYS> create tablespace crms datafile '/u01/app/oracle/oradata/crms/crms_file01.dbf' size 100m; Tablespace created. $ tail –f alert_crms.log Thu Dec 10 12:42:35 2015 Completed: create tablespace crms datafile '/u01/app/oracle/oradata/crms/crms_file01.dbf' size 100m

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

# ON THE STANDBY DATABASE $ tail –f alert_stbycrms.log Recovery created file /u01/app/oracle/oradata/stbycrms/crms_file01.dbf Successfully added datafile 6 to media recovery Datafile #6: '/u01/app/oracle/oradata/stbycrms/crms_file01.dbf'

RENAMING A DATA FILE In this section we will see how to rename/relocate data file(s) in Data Guard environment setup. Whenever you rename data file(s) the changes are NOT reflected on the Standby database; even if the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO. I want to rename the data file from crms_file01.dbf to crms01.dbf

# ON PRIMARY DATABASE SYS> select file_name, file_id from dba_data_files where tablespace_name='CRMS'; FILE_NAME

FILE_ID

------------------------------------------------------ --------/u01/app/oracle/oradata/crms/crms_file01.dbf

6

SYS> select file#, status, name from v$datafile where file#=6; FILE# NAME

STATUS

---------- ---------------------------------------------- ---------6 /u01/app/oracle/oradata/crms/crms_file01.dbf

RECOVER

# RENAME THE DATAFILE USING mv COMMAND AT OS LEVEL $ cd /u01/app/oracle/oradata/crms $ mv crms_file01.dbf crms01.dbf $ ls -l crms* -rw-r-----

1 oracle oinstall 104865792 Dec 10 14:10 crms01.dbf

# RENAME THE DATAFILE AT DATABASE LEVEL SYS> alter tablespace crms rename datafile '/u01/app/oracle/oradata/crms/crms_file01.dbf' TO '/u01/app/oracle/oradata/crms/crms01.dbf'; Tablespace altered. $ tail –f alert_crms.log alter tablespace crms rename datafile '/u01/app/oracle/oradata/crms/crms_file01.dbf' TO '/u01/app/oracle/oradata/crms/crms01.dbf' Completed: alter tablespace crms rename datafile '/u01/app/oracle/oradata/crms/crms_file01.dbf' TO '/u01/app/oracle/oradata/crms/crms01.dbf'

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

SYS> alter database datafile 6 online; alter database datafile 6 online * ERROR at line 1: ORA-01113: file 6 needs media recovery ORA-01110: data file 6: '/u01/app/oracle/oradata/crms/crms01.dbf' SYS> select file#, name, status from v$datafile where file#=6; FILE# NAME

STATUS

---------- ------------------------------------------- -----------6 /u01/app/oracle/oradata/crms/crms01.dbf

RECOVER

SYS> recover datafile 6; Media recovery complete. $ tail –f alert_crms.log ALTER DATABASE RECOVER

datafile 6

Media Recovery Start Serial Media Recovery started Recovery of Online Redo Log: Thread 1 Group 2 Seq 185 Reading mem 0 Mem# 0: /u01/app/oracle/oradata/crms/redo02.log Media Recovery Complete (crms) Completed: ALTER DATABASE RECOVER

datafile 6

SYS> select file#, name, status from v$datafile where file#=6; FILE# NAME

STATUS

---------- ----------------------------------------- -------------6 /u01/app/oracle/oradata/crms/crms01.dbf

OFFLINE

SYS> alter database datafile 6 online; Database altered. SYS> select file#, status, name from v$datafile where file#=6; FILE# NAME

STATUS

---------- ----------------------------------------- -------6 /u01/app/oracle/oradata/crms/crms01.dbf

ONLINE

You should do above steps manually to make the equivalent modifications on the standby database. # ON THE STANDBY DATABASE, STOP REDO APPLY SYS> alter database recover managed standby database cancel; Database altered. SYS> shutdown immediate; ...

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

# RENAME THE DATAFILE USING mv COMMAND AT OS LEVEL $ cd /u01/app/oracle/oradata/stbycrms/ $ mv crms_file01.dbf crms01.dbf $ ls –l crms* $ -rw-r-----

1 oracle oinstall 104865792 Dec 10 14:22 crms01.dbf

# START AND MOUNT STANDBY DATABASE SYS> startup mount; ORACLE instance started. .. ... Database mounted. # RENAME THE DATAFILE IN STANDBY CONTROLFILE SYS> alter database rename file '/u01/app/oracle/oradata/stbycrms/crms_file01.dbf' TO '/u01/app/oracle/oradata/stbycrms/crms01.dbf'; alter database rename file '/u01/app/oracle/oradata/stbycrms/crms_file01.dbf' TO * ERROR at line 1: ORA-01511: error in renaming log/data files ORA-01275: Operation RENAME is not allowed if standby file management is automatic. # SET STANDBY FILE MANAGEMENT TO MANUAL SYS> alter system set standby_file_management='MANUAL' scope=both; System altered. SYS> alter database rename file '/u01/app/oracle/oradata/stbycrms/crms_file01.dbf' TO '/u01/app/oracle/oradata/stbycrms/crms01.dbf'; Database altered.

# START REDO APPLY SYS> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT using current logfile; Database altered.

SYS> select file#, name, status from v$datafile where file#=6; FILE# NAME

STATUS

--------------- ------------------------------------------------ ------6 /u01/app/oracle/oradata/stbycrms/crms01.dbf

ONLINE

# RESET STANDBY FILE MANAGEMENT TO AUTO SYS> alter system set standby_file_management='AUTO' scope=both; System altered.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

RELOCATE A DATAFILE

Suppose you create a datafile in different location which is NOT in the db_file_name_convert path in the standby init.ora and how to recover the standby database in this case.

# ON THE STANDBY DATABASE SYS> show parameter db_file_name_convert; NAME

TYPE

VALUE

------------------------------------ ---------- -----------------------------db_file_name_convert

string

/u01/app/oracle/oradata/crms/, /u01/app/oracle/oradata/stbycrms/

SYS> show parameter standby; NAME

TYPE

VALUE

------------------------------------ ---------- -----------------------------standby_file_management

string

AUTO

# ADD NEW DATAFILE ON PRIMARY DATABASE SYS> alter tablespace crms add datafile '/u05/crms/oradata/DATA/crms02.dbf' size 100m; Tablespace altered. SYS> select name from v$datafile where ts#=7; NAME -----------------------------------------------/u01/app/oracle/oradata/crms/crms01.dbf /u05/crms/oradata/DATA/crms02.dbf # ON STANDBY DATABASE $ tail –f alert_stbycrms.log File #7 added to control file as 'UNNAMED00007'. Originally created as: '/u05/crms/oradata/DATA/crms02.dbf' Recovery was unable to create the file as: '/u05/crms/oradata/DATA/crms02.dbf' MRP0: Background Media Recovery terminated with error 1274 ORA-01274: cannot add datafile '/u05/crms/oradata/DATA/crms02.dbf' - file could not be created Managed Standby Recovery not using Real Time Apply Recovery interrupted! Recovery stopped due to failure in applying recovery marker (opcode 17.30). Datafiles are recovered to a consistent state at change 1247692 but controlfile could be ahead of datafiles. Errors in file /u01/app/oracle/diag/rdbms/stbycrms/stbycrms/trace/stbycrms_mrp0_3771.trc: ORA-01274: cannot add datafile '/u05/crms/oradata/DATA/crms02.dbf' - file could not be created MRP0: Background Media Recovery process shutdown (stbycrms)

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

# ON STANDBY DATABASE SYS> select name from v$datafile where ts#=7; NAME -----------------------------------------------/u01/app/oracle/oradata/stbycrms/crms01.dbf /u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00007 SYS> alter system set standby_file_management=manual; System altered.

SYS> alter database create datafile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/UNNAMED00007' as '/u01/app/oracle/oradata/stbycrms/crms02.dbf'; Database altered. SYS> alter database recover managed standby database disconnect using current logfile; Database altered. SYS> alter system set standby_file_management=auto scope=both; System altered. SYS> select name from v$datafile where ts#=7; NAME -----------------------------------------------/u01/app/oracle/oradata/stbycrms/crms01.dbf /u01/app/oracle/oradata/stbycrms/crms02.dbf # DROP THE NEWLY CREATED DATAFILE ON PRIMARY DATABASE SYS> alter tablespace crms drop datafile '/u05/crms/oradata/DATA/crms02.dbf'; Tablespace altered. $ tail –f alert_crms.log alter tablespace crms drop datafile '/u05/crms/oradata/DATA/crms02.dbf' Deleted file /u05/crms/oradata/DATA/crms02.dbf Completed: alter tablespace crms drop datafile '/u05/crms/oradata/DATA/crms02.dbf' # VERIFY ON STANDY DATABSE SYS> select name from v$datafile where ts#=7; NAME -----------------------------------------------/u01/app/oracle/oradata/stbycrms/crms01.dbf $ tail –f alert_stbycrms.log Recovery deleting file #7:'/u01/app/oracle/oradata/stbycrms/crms02.dbf' from controlfile. Deleted file /u01/app/oracle/oradata/stbycrms/crms02.dbf

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

RESIZE REDOLOG FILES IN DATA GUARD CONFIGURATION

It is required to resize the online redo log files in Data Guard configuration you need to perform resize for both online redo logfiles and Standby Redo logfiles SRL is not mandatory for Primary database but it’s good and useful in role conversion from Primary to Standby Database. Oracle recommends that you create a Standby redo log on the Primary database so that the primary database can switch over quickly to the standby role without any extra step. It is good to create SRL on both sides (Primary and Standby) you switchover quickly. The SRL files will NOT be used on the Primary database side until you perform Switchover operation i.e. (when Primary database becomes Standby database). On Primary Site, Standby Redo Logs will not be used unless you do switchover. On Standby Site, Online Redo logs will not be used, instead Standby RedoLogs (SRL) will be used. It is important to configure the Standby Redo Logs (SRL) with the same size as the online redo logs.

# ON PRIMARY DATABASE SYS> select name, db_unique_name, database_role from v$database; NAME

DB_UNIQUE_NAME

--------- --------------CRMS

crms

DATABASE_ROLE ---------------PRIMARY

SYS> select thread#, group#, bytes/1024/1024 "SIZE IN MB", status from v$log; THREAD#

GROUP# SIZE IN MB STATUS

---------- ---------- ---------- ---------------1

1

50

INACTIVE

1

2

50

INACTIVE

1

3

50

CURRENT

SYS> select thread#, group#, bytes/1024/1024 "SIZE IN MB", status from v$standby_log; THREAD#

GROUP# SIZE IN MB STATUS

---------- ---------- ---------- ---------1

4

50 UNASSIGNED

1

5

50 UNASSIGNED

1

6

50 UNASSIGNED

0

7

50 UNASSIGNED

If status is INACTIVE, we can drop and recreate them.

GROUP #1, GROUP #2 both are inactive status.

So I am going to drop GROUP #1 and Group #2 on Primary database.

# DROP GROUP #1 FROM PRIMARY DATABASE SYS> alter database drop logfile group 1; Database altered.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

# DROP GROUP #2 FROM PRIMARY DATABASE SYS> alter database drop logfile group 2; alter database drop logfile group 2 * ERROR at line 1: ORA-01567: dropping log 2 would leave less than 2 log files for instance crms (thread 1) ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/crms/redo02.log'

It is very basic requirement in an Oracle database that minimum 2 Redo Log Groups are required. Hence we cannot drop any Redo Group if there are only 2 Groups. So I would add GROUP #1 first. # ADD REDO LOG GROUP #1 SYS> alter database add logfile group 1 '/u01/app/oracle/oradata/crms/redo02.log' size 100m reuse; Database altered. SYS> alter database add logfile group 2 '/u01/app/oracle/oradata/crms/redo02.log' size 100m reuse; Database altered. SYS> select thread#, group#, bytes/1024/1024 "SIZE IN MB", status from v$log; THREAD#

GROUP# SIZE IN MB STATUS

---------- ---------- ---------- ---------------1

1

100 UNUSED

1

2

100 UNUSED

1

3

50 CURRENT

SYS> alter database drop logfile group 3; alter database drop logfile group 3 * ERROR at line 1: ORA-01623: log 3 is current log for instance crms (thread 1) - cannot drop ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/crms/redo03.log' SYS> alter system switch logfile; System altered. SYS> select thread#, group#, bytes/1024/1024 "SIZE IN MB", status from v$log; THREAD#

GROUP# SIZE IN MB STATUS

---------- ---------- ---------- ---------------1

1

100 CURRENT

1

2

100 UNUSED

1

3

50 ACTIVE

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

NOW GROUP #3 STATUS is ACTIVE means (if the Database crashes now, you need this Group for recovery.) We need to make this group Inactive before proceeding ahead:

SYS> alter database drop logfile group 3; alter database drop logfile group 3 * ERROR at line 1: ORA-01624: log 3 needed for crash recovery of instance crms (thread 1) ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/crms/redo03.log'

Do switch logfiles manually until Group 3 becomes INACTIVE; you can do couple of log switches, to make GROUP #3 status as INACTIVE.

SYS> alter system checkpoint; System altered.

SYS> select thread#, group#, bytes/1024/1024 "SIZE IN MB", status from v$log; THREAD#

GROUP# SIZE IN MB STATUS

---------- ---------- ---------- ---------------1

1

100 CURRENT

1

2

100 INACTIVE

1

3

50 INACTIVE

SYS> alter database drop logfile group 3; Database altered. SYS> alter database add logfile group 3 '/u01/app/oracle/oradata/crms/redo02.log' size 100m reuse; Database altered.

SYS> select thread#, group#, bytes/1024/1024 "SIZE IN MB", status from v$log; THREAD#

GROUP# SIZE IN MB STATUS

---------- ---------- ---------- ---------------1

1

100 CURRENT

1

2

100 INACTIVE

1

3

100 UNUSED

We have changed the Redo Log file size from 50M to 100M on the Primary database. SYS> select group#, sum(bytes/1024/1024)"size in MB" from v$standby_log group by group#; GROUP# size in MB ---------- ---------6

50

4

50

5

50

7

50

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

Directly we can drop the UNASSIGNED SRLs and re-create them with the new size. As I told earlier SRL will be used on the Primary, when Primary database starts to behave as a Standby database.

# DROP STANDBY REDOLOG FILES ON THE PRIMARY SYS> alter database drop standby logfile group 4; Database altered. SYS> alter database drop standby logfile group 5; Database altered. SYS> alter database drop standby logfile group 6; Database altered. SYS> alter database drop standby logfile group 7; Database altered.

# RECRATE STANDBY REDOLOG FILES ON THE PRIMARY SYS> alter database add standby logfile group 4 '/u01/app/oracle/oradata/crms/sredo04.log' size 100m reuse; Database altered. SYS> alter database add standby logfile group 5 '/u01/app/oracle/oradata/crms/sredo05.log' size 100m reuse; Database altered.

SYS> alter database add standby logfile group 6 '/u01/app/oracle/oradata/crms/sredo06.log' size 100m reuse; Database altered. SYS> alter database add standby logfile group 7 '/u01/app/oracle/oradata/crms/sredo07.log' size 100m reuse; Database altered.

SYS> select group#, bytes, status from v$standby_log; GROUP#

BYTES STATUS

---------- ---------- ---------4

104857600 UNASSIGNED

5

104857600 UNASSIGNED

6

104857600 UNASSIGNED

7

104857600 UNASSIGNED

On the Primary side, we have changed ORL and SRL files size from 50m to 100m. On the Primary database changes of the ORL/SRL file changes are not propagated to the standby database.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

# ON THE STANDBY DATABASE SYS> select name, db_unique_name, database_role from v$database; NAME

DB_UNIQUE_NAME

DATABASE_ROLE

------------ ------------------ ---------------CRMS

stbycrms

PHYSICAL STANDBY

SYS> select thread#, group#, bytes/1024/1024 "SIZE IN MB", status from v$log; THREAD#

GROUP#

SIZE IN MB STATUS

--------------- --------------- --------------- ---------------1

1

50 CLEARING_CURRENT

1

3

50 CLEARING

1

2

50 CLEARING

SYS> alter database drop logfile group 2; alter database drop logfile group 2 * ERROR at line 1: ORA-01156: recovery or flashback in progress may need access to files SYS> alter database recover managed standby database cancel; Database altered. SYS> alter database drop logfile group 2; alter database drop logfile group 2 * ERROR at line 1: ORA-01275: Operation DROP LOGFILE is not allowed if standby file management is automatic. SYS> ! oerr ORA 1275 01275, 00000, "Operation %s is not allowed if standby file management is automatic." // *Cause: An operation that renames, adds, or drops a file was attempted //

at a standby database and STANDBY_FILE_MANAGEMENT was set to AUTO.

// *Action: Set STANDBY_FILE_MANAGEMENT to MANUAL if the operation must be performed. SYS> alter system set standby_file_management=auto scope=both; System altered. SYS> alter database drop logfile group 2; alter database drop logfile group 2 * ERROR at line 1: ORA-01624: log 2 needed for crash recovery of instance stbycrms (thread 1) ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/stbycrms/redo02.log'

More over Status of Group #2 is still clearing, let’s clear it manually before dropping the group. Check STATUS column of V$LOG V$VIEW.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

SYS> alter database clear logfile group 2; Database altered. SYS> alter database drop logfile group 2; Database altered. SYS> alter database add logfile group 2 '/u01/app/oracle/oradata/stbycrms/redo02.log' size 100m reuse; Database altered. SYS> select thread#, group#, bytes/1024/1024 "SIZE IN MB", status from v$log; THREAD#

GROUP#

SIZE IN MB STATUS

--------------- --------------- --------------- ---------------1

1

1

2

1

3

50 CLEARING 100 UNUSED 50 CLEARING_CURRENT

SYS> alter database clear logfile group 1; Database altered. SYS> alter database drop logfile group 1; Database altered. SYS> alter database add logfile group 1 '/u01/app/oracle/oradata/stbycrms/redo01.log' size 100m reuse; Database altered.

SYS> alter database clear logfile group 3; Database altered. SYS> alter database drop logfile group 3; Database altered. SYS> alter database add logfile group 3 '/u01/app/oracle/oradata/stbycrms/redo03.log' size 100m reuse; Database altered. # CHECK SIZE OF NEWLY CREATED LOGFILES SYS> select group#, sum(bytes/1024/1024)"SIZE IN MB" from v$log group by group#; GROUP#

SIZE IN MB

--------------- --------------1

100

2

100

3

100

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

RESIZE STANDBY REDO LOGS ON STANDBY DATABASE

SYS> select group#, sum(bytes/1024/1024)"SIZE IN MB" from v$standby_log group by group#; GROUP#

SIZE IN MB

--------------- --------------6

50

4

50

5

50

7

50

SYS> select group#, status from v$standby_log; GROUP# STATUS --------------- ---------4 ACTIVE 5 UNASSIGNED 6 UNASSIGNED 7 UNASSIGNED

For the SRL groups whose status is UNASSIGNED, just drop the group and recreate them with the size same as that of the Online Redo Logs.

SYS> alter database drop logfile group 5; Database altered. SYS> alter database drop logfile group 6; Database altered. SYS> alter database drop logfile group 7; Database altered. SYS> alter database add standby logfile group 5 '/u01/app/oracle/oradata/stbycrms/sredo05.log' size 100m reuse; Database altered. SYS> alter database add standby logfile group 6 '/u01/app/oracle/oradata/stbycrms/sredo06.log' size 100m reuse; Database altered. SYS> alter database add standby logfile group 7 '/u01/app/oracle/oradata/stbycrms/sredo07.log' size 100m reuse; Database altered. SYS> alter database clear logfile group 4; Database altered.

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

SYS> alter database drop logfile group 4; Database altered. SYS> alter database add standby logfile group 7 '/u01/app/oracle/oradata/stbycrms/sredo07.log' size 100m reuse; Database altered. SYS> select group#, sum(bytes/1024/1024)"size in MB" from v$standby_log group by group#; GROUP#

size in MB

--------------- --------------6

100

4

100

5

100

7

100

We have done all SRL & ORL files on Primary and standby database. Next we have to set the parameter STANDBY_FILE_MANAGEMENT to AUTO as well as start the recovery (MRP) on Standby database. # ON STANDBY DATABASE SYS> alter system set standby_file_management=auto scope=both; System altered. SYS> select sequence#, first_time, next_time, applied from v$archived_log order by sequence#; SEQUENCE# FIRST_TIM NEXT_TIME APPLIED --------------- --------- --------- --------256 12-DEC-15 12-DEC-15 YES 257 12-DEC-15 12-DEC-15 YES 258 12-DEC-15 12-DEC-15 YES 259 12-DEC-15 12-DEC-15 NO 260 12-DEC-15 12-DEC-15 NO 261 12-DEC-15 12-DEC-15 NO 262 12-DEC-15 12-DEC-15 NO 263 12-DEC-15 12-DEC-15 NO 264 12-DEC-15 12-DEC-15 NO 265 12-DEC-15 12-DEC-15 NO 266 12-DEC-15 12-DEC-15 NO 267 12-DEC-15 12-DEC-15 NO SYS> select thread#, max(sequence#) from v$archived_log where applied='YES' group by thread#; THREAD#

MAX(SEQUENCE#)

--------------- --------------1

258

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

RENAME - RELOCATE DATA FILES & RESIZING REDO LOG FILES

SYS> alter database recover managed standby database using current logfile disconnect; Database altered. SYS> select open_mode from v$database; OPEN_MODE -------------------READ ONLY WITH APPLY

SYS> select process, status, sequence# from v$managed_standby; PROCESS

STATUS

SEQUENCE#

--------- ------------ --------------ARCH

CLOSING

258

ARCH

CLOSING

252

ARCH

CONNECTED

ARCH

CLOSING

RFS

IDLE

0

RFS

IDLE

0

RFS

IDLE

0

RFS

IDLE

268

MRP0

APPLYING_LOG

260

0 259

SYS> select thread#, max(sequence#) from v$archived_log where applied='YES' group by thread#; THREAD# MAX(SEQUENCE#) ---------- -------------1

267

# ON PRIMARY DATABASE SYS> select thread#, max(sequence#) from v$archived_log group by thread#; THREAD# MAX(SEQUENCE#) ---------- -------------1

267

SYS> select group#, sequence#, used, bytes, status from v$standby_log; GROUP#

SEQUENCE#

USED

BYTES STATUS

--------------- --------------- --------------- --------------- ---------4

0

512

104857600 UNASSIGNED

5

270

61952

6

0

512

104857600 UNASSIGNED

7

0

512

104857600 UNASSIGNED

104857600 ACTIVE

Exploring the Oracle DBA Technology by Gunasekaran ,Thiyagu

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF