Oracle Database creation steps-using cold backup and RMAN

Source: Internet
Author: User

U RMAN create database
 
1. Prepare the environment
2. the username of the Oracle OWNER applied for in the DBA group on the machine where the database is created must be the same as that of the oracle owner of the original database.
2. Install the ORACLE software. The installation path can be different from the source path.
2. Make sure that the backup group colleagues have used RMAN to restore the data file to the specified path.
2. Start the database
2. Because the data files recovered by RMAN are not at the same time, logs need to be restored.
SQL> sqlplus internal
SQL> recover database using backup controlfile;
ORA-00279: change 3078306444075 generated at 03/29/2004 22:00:19 needed for thread 1
ORA-00289: suggestion:/data3/lurept/arch/lass/lass_0000002378.arc
ORA-00280: change 3078306444075 for thread 1 is in sequence #2378
Specify log: {= suggested | filename | AUTO | CANCEL}
Get the log sequence to be restored from the error message #, and tell the backup group colleagues to ask them to restore the log.
2. Apply archived logs
SQL> recover database using backup controlfile;
2. Open Database
SQL> alter database open resetlogs;
3. Database Replication
After RMAN recovers the database, you need to copy the database to our test environment (or another host ). The replication method is the same as that used to create a database using cold backup.
 
U use cold backup to create a database
 
1. Prepare the environment
2. Ensure that the backup group's colleagues have restored the cold backup file to PATH1 on a unix machine A, and grant the DBA the read permission.
2. Ensure that the oracle owner has been created on the UNIX machine B that is about to create a new database, install the ORACLE software, and configure the environment variable. profile file of the ORACLE OWNER.
2. Copy the cold backup file to the data file path of the new database to be created
Run the following command on the new database machine B with the ORACLE OWNER:
Cd $ HOME/oradata
Mkdir $ ORACLE_SID
Cd $ ORACLE_SID
Scp UserA @ UNIXA: PATH1 /*.
3. Create a directory under $ ORACLE_BASE
Run the following command on the new database machine B with the ORACLE OWNER:
Cd $ ORACLE_BASE
Mkdir admin
Mkdir admin/$ ORACLE_SID
Cd admin/$ ORACLE_SID
Mkdir bdump cdump udump
4. Configure the init file of the new database.
Create the init. ora file under $ ORACLE_HOME/dbs. You can refer to the standard database init file configuration manual to configure the init file for the new database. You can copy the init. ora file of other databases and modify the parameters.
5. (1) method of creating a database with the same name: a-> a (on different servers)
Note that you need to modify the data file path after mounting.
SQL> STARTUP MOUNT
SQL> ALTER DATABASE RENAME FILE ***** ***
-> SQL> ALTER DATABASE RENAME FILE ***** ***
 
SQL> ALTER DATABASE RENAME FILE ***** ***
-> SQL> ALTER DATABASE RENAME FILE ***** ***
 
SQL> ALTER DATABASE OPEN;
SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP
(2) renaming the database creation method. The difference is that the control file must be rebuilt.
Modify the database name by recreating the control file.
To change the Database Name (DB_NAME), follow these steps:
-- Original database
Alter database backup controlfile to trace as '/tmp/cre_con1010. SQL' resetlogs;
 
 
E2cs4020: ltzz8i> sqlplus/nolog
SQL> conn/as sysdba
SQL> alter database backup controlfile to trace;
-Note: The trc file generated in the udump directory contains the control file generation script. You can extract the control file creation script as follows:
Create controlfile reuse database "LUZZ0" NORESETLOGS NOARCHIVELOG
MAXLOGFILES 32
MAXLOGMEMBERS 2
MAXDATAFILES 254
MAXINSTANCES 8
# MAXLOGHISTORY 2726
LOGFILE
GROUP 1 '/paic/8i/lbs/exp/dmpfiles/oradata/ltzz8i/redo01.log' SIZE 30 M,
GROUP 2 '/paic/8i/lbs/exp/dmpfiles/oradata/ltzz8i/redo02.log' SIZE 30 M,
..............................
DATAFILE
'/Paic/8i/lbs/exp/dmpfiles/oradata/ltzz8i/system01.dbf ',
'/Paic/8i/lbs/exp/dmpfiles/oradata/ltzz8i/tools01.dbf ',
'/Paic/8i/lbs/exp/dmpfiles/oradata/ltzz8i/rbs01.dbf ',
..........................
'/Paic/8i/lbs/exp/dmpfiles/oradata/ltzz8i/factuser_data01.dbf'
Character set ZHS16GBK
;
-- SQL> shutdown immediate;
 
-- Operate on the new database

  • 1
  • 2
  • Next Page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.