In Oracle 11 g2, duplicating a database has two methods:
1. Active database duplication
2. Backup-based duplication
The advantages of using duplicate for a database are:
Test backup and recovery procedures
Test an upgrade to a new release of Oracle Database
Test the effect of applications on database performance
Create a standby database
Generate reports
First, we will learn about Backup-based duplication, which is better understood. test environment: Same directory on different machines
Prerequisites:
There are now two oracle servers, one: 192.168.1.249 and the other: 192.168.1.248.
Use 192.168.1.249 as the primary A and 192.168.1.248 as the auxiliary B.
For ease of operation, I will use auxiliary B as the main operation point to complete the duplicate operation.
1. Operate on primary
Now, we will use dbca to create a new oracle database_name and SID. We will also learn how to create tables and insert data in oracle.
Through dbca, a tablespace and a temporary tablespace are created by default, and the tablespace is no longer created during the test. The syntax for creating a tablespace is as follows:
Create tablespace space name datafile 'data file path' size: 200 MB;
Create a table:
Create table employees (employee_id number (6), first_name varchar2 (20), last_name varchar2 (25), phone_number varchar2 (15), salary number (8, 2), department_id number (4 ), constraint emp_salary_min check (salary> 0 ));
Some constraints are inserted during table creation.
Insert data:
Insert into employees (employee_id, first_name, last_name, phone_number, salary, department_id) values (1189, 'wang', 'in', 18920782475,4900, 2 );
Insert into employees (employee_id, first_name, last_name, phone_number, salary, department_id) values (1109, 'zhang ', 'in', 18920482475,4900, 3 );
Just insert two pieces of data at will to prove that there is data in the table.
2. Start listening and open the database:
Execute:
Lsnrctl start
Sqlplus/as sysdba
Startup;
3. access remote database A through netmgr on Database B, that is, Modification
/Opt/oracle/product/11.2.0/dbhome_1/network/admin
Tnsnames. ora and listener. ora files
Netmgr
Configure listener
Click Close to save and exit.
Then, try to see if B server can connect to the test05 database on Aserver.
[Oracle @ test1 ~] $ Rman
RMAN> connect target sys/biao_123 @ test05;
The RMAN connection format is: username/password @ listener name (the name of the listener created by netmgr to database A in the previous step)
Connected to target database: TEST05 (DBID = 4183336084) (indicating successful connection)
Note: If you do not remember the password of sys and system recorded during database installation, the solution is as follows:
On the target database, you do not need a password to log on to the database at the operating system level.
So you can use sqlplus/as sysdba (LOGIN)
Change the password of user sys and system
Alter user sys identified by password; this password should not contain the 'dot 'character whenever possible
Next, let's take a look at the highlights of page 2nd:
Recommended reading:
Basic Oracle tutorial-copying a database through RMAN
Reference for RMAN backup policy formulation
RMAN backup learning notes
Oracle Database Backup encryption RMAN Encryption