Posts

Showing posts from June, 2013

How to rename or move a datafile in oracle

How to rename or move a datafile in oracle Renaming/Relocating a Data File or Tablespace 1. Take the tablespace offline: ALTER TABLESPACE USER_DATA OFFLINE; 2. Copy the file to the new location by using OS commands on the disk. 3. Rename the files in the database by using one of the following two commands. The number of data files specified before the keyword TO should be equal to the number of files specified after the keyword. ALTER DATABASE RENAME FILE ‘/disk1/oradata/DB01/user_data01.dbf‘, ‘/disk1/oradata/DB01/userdata2.dbf‘, ‘/disk1/oradata/DB01/user_data03.dbf‘ TO ‘/disk2/oradata/DB01/user_data01.dbf‘, ‘/disk2/oradata/DB01/user_data02.dbf‘, ‘/disk2/oradata/DB01/user_data03.dbf‘; Or ALTER TABLESPACE USER_DATA RENAME DATAFILE ‘/disk1/oradata/DB01/user_data01.dbf‘, ‘/disk1/oradata/DB01/userdata2.dbf‘, ‘/disk1/oradata/DB01/user_data03.dbf‘ TO ‘/disk2/oradata/DB01/user_data01.dbf‘, ‘/disk2/oradata/DB01/user_data02.dbf‘, ‘/

How to create a Recovery Catalog in Oracle

How to create a Recovery Catalog in Oracle What is a Recovery Catalog? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A recovery catalog is a database schema used by RMAN to store metadata about one or more Oracle databases.  Typically, you store the catalog in a dedicated database. A recovery catalog provides the following benefits: 1. A recovery catalog creates redundancy for the RMAN repository stored in the control file of each target database. The recovery catalog serves as a secondary metadata repository. If the target control file and all backups are lost, then the RMAN metadata still exists in the recovery catalog. 2. A recovery catalog centralizes metadata for all your target databases. Storing the metadata in a single place makes reporting and administration tasks easier to perform. 3. A recovery catalog can store metadata history much longer than the control file. This capability is useful if you must do a recovery that goes further back in time than the histo

How to retrieve lost control file

How to retrieve lost control file ORA-00210: cannot open the specified control file To simulate the situation of a lost control file or disk failure, I deleted a control file while the Oracle Database was running. SQL> alter database datafile '/u02/app/oracle/oradata/mynewdb/users01.dbf' resize 512M; Database altered.  SQL> ! rm -f /u02/app/oracle/oradata/mynewdb/control01.ctl Then I shutdown the database. SQL> shutdown immediate; Database closed. ORA-00210: cannot open the specified control file ORA-00202: control file: '/u02/app/oracle/oradata/mynewdb/control01.ctl' ORA-27041: unable to open file Linux Error: 2: No such file or directory Additional information: 3 Then I start the database up. SQL> startup ORA-01081: cannot start already-running ORACLE - shut it down first SQL> select open_mode from v$database; select open_mode from v$database                       * ERROR at line 1: ORA-0021
Back To Top