Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Database \ Migrate Oracle database files to ASM     - Oracle 10g in the unique and index problems (Database)

- IOS interview questions Summary (Programming)

- Linux Proc File System Experiment (Linux)

- Java factory pattern (Factory mode) (Programming)

- Sorting Algorithm (1) Quick Sort C ++ implementation (Programming)

- Docker - for the development and deployment of unified lightweight Linux containers (Linux)

- Linux --- process tracking (Linux)

- Analysis: Little Notebook facing a major security threat secure online (Linux)

- OpenGL Superb Learning Notes - Fragment Shader (Programming)

- OpenSUSE GPG Comments (Linux)

- Fatal: unable to connect to github.com problem solving (Linux)

- Linux environment has been running Tomcat how to deploy the new Tomcat (Server)

- Java, boolean operators & =, | = ^ = use (Programming)

- Fedora 20 users install the Mate 1.8 desktop (Linux)

- Oracle ORA-01691 error message, a single data file size limit problem (Database)

- MySQL Tutorial: About checkpoint mechanism (Database)

- C ++ precision performance test function (Programming)

- Slice MyCAT common fragmentation rules of enumeration (Database)

- Adjustment expand VMDK format VirtualBox disk space (Linux)

- iTerm - let your command line can also be colorful (Linux)

 
         
  Migrate Oracle database files to ASM
     
  Add Date : 2018-11-21      
         
       
         
  Read the navigation

Migrate data files to ASM
Migrate log files to ASM
Migrate control files to ASM
Migrate data files to ASM

Database consistency case migration: the database to mount state, generate rman copy statement, and then in the implementation of rman:

SQL> startup mount
SQL> select q '(copy datafile') '|| name || q' ( 'to' + oradata ';)' from v $ datafile;
Q '(COPYDATAFILE') '|| NAME || Q' ( 'TO' + ORADATA ';)'
-------------------------------------------------- -----------------------------
Copy datafile 'D: \ NSOADP \ SYSTEM01.DBF' to '+ oradata';
Copy datafile 'D: \ NSOADP \ SYSAUX01.DBF' to '+ oradata';
Copy datafile 'F: \ NSOADP \ UNDOTBS01.DBF' to '+ oradata';
Copy datafile 'D: \ NSOADP \ USERS01.DBF' to '+ oradata';
SQL> exit
D: \> rman target /
RMAN> run
2> {
3> copy datafile 'D: \ NSOADP \ SYSTEM01.DBF' to '+ oradata';
4> copy datafile 'D: \ NSOADP \ SYSAUX01.DBF' to '+ oradata';
5> copy datafile 'F: \ NSOADP \ UNDOTBS01.DBF' to '+ oradata';
6> copy datafile 'D: \ NSOADP \ USERS01.DBF' to '+ oradata';
7>}
Start backup on 2015-04-15 10:02:44
Use the channel ORA_DISK_1
Channel ORA_DISK_1: Starts the copy of the data file
Input data file: File number = 00001 Name = D: \ NSOADP \ SYSTEM01.DBF
Output file name = + ORADATA / nsoa / datafile / system.260.877082571 flag = TAG20150415T100250 RECID = 265 STAMP = 877082603
Channel ORA_DISK_1: Data file is copied, elapsed time: 00:00:35
Complete backup at 2015-04-15 10:03:25
...

Make a statement that changes the control file data name, and then make the changes:

SQL> SELECT --T.NAME, T.FILE #, C.FILE #, C.NAME
  2 q '(ALTER DATABASE RENAME FILE') '|| c.name || q' ( 'to') '|| t.name || q' ( ';)'
  3 FROM V $ DATAFILE_COPY T LEFT JOIN V $ DATAFILE C
  4 ON T.FILE # = C.FILE #
  5 WHERE T.NAME IS NOT NULL order by COMPLETION_TIME desc;

SQL> alter database rename file 'D: \ NSOADP \ SYSTEM01.DBF' to '+ ORADATA / nsoa / datafile / system.260.877082571';

Migration in case of database inconsistency (archive mode):
The use of alter database datafile '' offline orders data files offline, and then the same way as above, and finally the data file online

SQL> alter database datafile '/u01/oradata/sydb/user01.dbf' offline;

RMAN> copy datafile '/u01/oradata/sydb/user01.dbf' to '+ oradata';

Starting backup at 23-APR-15
Using target database control file instead of recovery catalog
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID = 180 device type = DISK
Channel ORA_DISK_1: starting datafile copy
Input datafile file number = 00004 name = / u01 / oradata / sydb / user01.dbf
Output file name = + ORADATA / sydb / datafile / users.257.877803115 tag = TAG20150423T181155 RECID = 1 STAMP = 877803123
Channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
Finished backup at 23-APR-15

SQL> alter database rename file '/u01/oradata/sydb/user01.dbf' to '+ ORADATA / sydb / datafile / users.257.877803115';
SQL> alter database datafile '+ ORADATA / sydb / datafile / users.257.877803115' online;
Alter database datafile '+ ORADATA / sydb / datafile / users.257.877803115' online
*
ERROR at line 1:
ORA-01113: file 4 needs media recovery
ORA-01110: data file 4: '+ ORADATA / sydb / datafile / users.257.877803115'
SQL> recover datafile '+ ORADATA / sydb / datafile / users.257.877803115';
Media recovery complete.
SQL> alter database datafile '+ ORADATA / sydb / datafile / users.257.877803115' online;

Migrate log files to ASM

You can either move the non-current or active log files to the asm in the mount or open state; you can delete the existing log files (each log group must have one member) or the log group (the database must have two log groups), and then add New log files or log groups;

Alter database drop logfile member 'E: \ NSOADP \ REDO07.LOG'; # Delete the log file
Alter database drop logfile group 2; # Delete the log group
Alter database add logfile member '+ oradata' to group 7; # Add a log file
Alter database add logfile ( '+ oradata', 'oradata') size 50m; # Add two members of the log group
Alter database add logfile '+ oradata', 'oradata' size 50m; # Add two log groups at the same time

Migrate control files to ASM

 First determine the control file location and name

SQL> show parameter control_file
NAME TYPE VALUE
------------------------------------ ----------- --- ---------------------------
Control_file_record_keep_time integer 7
Control_files string F: \ NSOADP \ CONTROL01.CTL

 Modify the control_files initialization parameter value asm, and then restart the database to the nomount state:

SQL> alter system set control_files = '+ oradata' scope = spfile;
SQL> shutdown immediate;
SQL> startup nomount

Use rman to copy the current control file into asm

Rman target /
RMAN> restore controlfile from 'F: \ NSOADP \ CONTROL01.CTL';
Start restore at 2015-04-22 09:40:30
Replace the recovery catalog with the target database control file
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID = 70 Device Type = DISK

Channel ORA_DISK_1: Copied control file copy
Output file name = + ORADATA / nsoa / controlfile / current.314.877686033
Complete restore at 2015-04-22 09:40:39

Note: If you use a backup control file to restore, and the database has a previous RESETLOGS operation or create a control file to create a statement that specifies RESETLOGS, you must open the database in RESETLOGS mode.


SQL> alter database mount;
SQL> show parameter control_file

NAME TYPE VALUE
------------------------------------ -------------- -------- ------------------------------
Control_file_record_keep_time integer 7
Control_files string + ORADATA / nsoa / controlfile / curr
                                                            Ent.314.877686033
SQL> alter database open;

 --Then end
     
         
       
         
  More:      
 
- Django1.8 return json json string and the string contents of the received post (Programming)
- To install the Ubuntu Touch emulator on Ubuntu (Linux)
- Linux Shell debugging (Programming)
- Installation and Configuration ISC DHCP server on Debian Linux (Server)
- Command filter MySQL slow query log (Database)
- CentOS RedHat YUM Source Extensions Supplement (including 32-bit, 64-bit) (Linux)
- Introduces Linux kernel compilation system and compiler installation (Linux)
- Distributed File System FastDFS deployment (Server)
- Linux and Unix systems really do network more secure (Linux)
- Linux Security Module (LSM) Introduction (Linux)
- MySQL database under Linux to achieve automatic backup scheduled backup day (Database)
- Ubuntu study notes and related problem solving (Linux)
- DRBD rapid installation and deployment (Server)
- Linux the best download manager uGet (Linux)
- Smooth upgrade to OpenSSH 6.1 Procedure (Linux)
- VirtualBox - Linux system virtual machine shared folders (Linux)
- Oracle PL / SQL based cursor (Database)
- Raspberry Pi 2 to install the latest version of the FPC and Lazarus 1.5 (Linux)
- Partition contrast manifestations under Windows and Linux (Linux)
- Browser caching mechanism on the analysis (Linux)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.