Step by Step Moving Controlfile in ASM from one diskgroup to another diskgroup
[oracle@testdb ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 31 14:31:34 2018
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
[grid@testdb ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 10228 10122 0 5061 0 N ARCH/
MOUNTED NORMAL N 512 4096 1048576 10228 7040 0 3520 0 N DATA/
MOUNTED NORMAL N 512 4096 1048576 10228 9620 0 4810 0 N FRA/
-- Checking Controlfile Location
SQL> show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DATA/testdb/controlfile/curre
nt.260.966829689, +FRA/testdb/
controlfile/current.256.966829
691
control_management_pack_access string DIAGNOSTIC+TUNING
SQL>
-- Moving Controlfile from +FRA to +ARCH
SQL> alter system set control_files='+DATA/testdb/controlfile/current.260.966829689','+ARCH/TESTDB/CONTROLFILE/control02.ctl' scope=spfile;
System altered.
-- Now shutting down the Database
SQL>
[grid@testdb ~]$ cd /u01/app/11.2.0/grid/bin/
[grid@testdb bin]$ srvctl stop database -d testdb -o immediate;
[[grid@testdb bin]$ srvctl status database -d testdb
Database is not running.
-- Copy controlfile to new location
[grid@testdb bin]$ asmcmd
ASMCMD> cd arch
ASMCMD> pwd
+arch
ASMCMD> ls
TESTDB/
ASMCMD> cd TESTDB
ASMCMD> mkdir CONTROLFILE
ASMCMD> cp +DATA/testdb/controlfile/current.260.966829689 +ARCH/TESTDB/CONTROLFILE/control02.ctl
copying +DATA/testdb/controlfile/current.260.966829689 -> +ARCH/TESTDB/CONTROLFILE/control02.ctl
ASMCMD>
-- Starting the Database up
[grid@testdb bin]$ pwd
/u01/app/11.2.0/grid/bin
[grid@testdb bin]$ ./srvctl start database -d testdb
[grid@testdb bin]$ ./srvctl status database -d testdb
Database is running.
[grid@testdb bin]$
--Checking Controlfile on new location
SQL> show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DATA/testdb/controlfile/curre
nt.260.966829689, +ARCH/testdb
/controlfile/control02.ctl
control_management_pack_access string DIAGNOSTIC+TUNING
SQL>
[oracle@testdb ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jan 31 14:31:34 2018
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
[grid@testdb ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED NORMAL N 512 4096 1048576 10228 10122 0 5061 0 N ARCH/
MOUNTED NORMAL N 512 4096 1048576 10228 7040 0 3520 0 N DATA/
MOUNTED NORMAL N 512 4096 1048576 10228 9620 0 4810 0 N FRA/
-- Checking Controlfile Location
SQL> show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DATA/testdb/controlfile/curre
nt.260.966829689, +FRA/testdb/
controlfile/current.256.966829
691
control_management_pack_access string DIAGNOSTIC+TUNING
SQL>
-- Moving Controlfile from +FRA to +ARCH
SQL> alter system set control_files='+DATA/testdb/controlfile/current.260.966829689','+ARCH/TESTDB/CONTROLFILE/control02.ctl' scope=spfile;
System altered.
-- Now shutting down the Database
SQL>
[grid@testdb ~]$ cd /u01/app/11.2.0/grid/bin/
[grid@testdb bin]$ srvctl stop database -d testdb -o immediate;
[[grid@testdb bin]$ srvctl status database -d testdb
Database is not running.
-- Copy controlfile to new location
[grid@testdb bin]$ asmcmd
ASMCMD> cd arch
ASMCMD> pwd
+arch
ASMCMD> ls
TESTDB/
ASMCMD> cd TESTDB
ASMCMD> mkdir CONTROLFILE
ASMCMD> cp +DATA/testdb/controlfile/current.260.966829689 +ARCH/TESTDB/CONTROLFILE/control02.ctl
copying +DATA/testdb/controlfile/current.260.966829689 -> +ARCH/TESTDB/CONTROLFILE/control02.ctl
ASMCMD>
-- Starting the Database up
[grid@testdb bin]$ pwd
/u01/app/11.2.0/grid/bin
[grid@testdb bin]$ ./srvctl start database -d testdb
[grid@testdb bin]$ ./srvctl status database -d testdb
Database is running.
[grid@testdb bin]$
--Checking Controlfile on new location
SQL> show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DATA/testdb/controlfile/curre
nt.260.966829689, +ARCH/testdb
/controlfile/control02.ctl
control_management_pack_access string DIAGNOSTIC+TUNING
SQL>
No comments:
Post a Comment