I did not know much about the remote restoration of the RMAN backup database. When I went to Shangguan technology to attend lectures last Saturday, teacher Zhang lie is talking about RMAN backup, so he has recovered a lot of memories and understood a lot, this Friday evening, our company asked us to back up all the data in the production database and import it to the test database so that the test database can be used as the production database. Therefore, we cannot complete the task overnight in an emergency.
Here, I copied the full backup data of the production database to the test database. I killed the test database and put the full backup data of the production database under the/bk/directory of the test database, this/bk/directory is created by myself
First, start the database with the RMAN file without Parameters
Rman target/enters rman
RMAN> startup nomount; the file with no parameters is started to the nomount State. Here we need to restore the control file and the binary parameter file.
RMAN> restore controlfile from '/bk/xxxxxx'; restore control file
RMAN> restore spfile from '/bk/xxxx'; if the control file is in Oracle10g, the parameter file is automatically backed up when the control file is backed up, however, the control file cannot be found in the oracl11g, so the parameter file to be found in another file should be recovered; after this step is completed, your $ ORACLE_HONE/dbs/has a binary parameter file and a control file, however, this parameter file is the parameter file of the production database, which is not necessarily the same as the directory on your server, so you need to modify the parameter file.
Second, release RMAN to enter plsql. What you need here is to connect to the boss and then create and modify parameter files in text format.
SQL> conn/as sysdba connection boss
SQL> create pfile from spfile; create a parameter file based on the binary parameter file.
Modify the parameter file of the text, and change all the parameters corresponding to the path to the new directory you want to store, such as the control file, tracking file, and background process file, restore files and modify them. After the modification is complete, you need to go to slplus again
SQL> conn/as sysdba
SQL> create spfile from pile;
Then start the database to the mount status,
An error occurs when the database is not modified due to the log file in the log file.
My solution was to kill all oracle processes,
Ps-ef | grep ora _ Find all the processes and then kill-9 PID
Then, modify the path of the trace log file of the text parameter file to the path that you want to store on your local machine, and then start the database to the mount state.
Startup mount;
Third, in the mount state, if your own sid is different from the sid of the production database, you can modify it in this state.
SQL> alter system db_name = orcl scope = spfile; orcl is your current instance name
Fourth, the launch of plsql into RMAN for recovery and cross validation.
Crosscheck backup; backup Verification
Crosscheck copy; copy Verification
Delete noprompt expired backup; delete existing backups of the original database that have expired
Delete noprompt expired copy; delete expired copies from the original Library
List backup; view the result of your cross-validation backup
List copy; view the result of your cross-validation copy.
Fifth, register to the Control File
Catalog start with '/bk/'; grade your log files and data files in the control file.
Sixth, restore the log file to a new path.
View the path of the log file under sqlplus,
SQL> select member from v $ logfile;
SQL> alter database rename file '/u01/oracle/oradata/zhu/redo03.log' to '/oo/redo03'; --- all log files and so on
Restore the data file to a new path,
Select 'set newname for datafile' | file # | 'to ''' | replace (name, 'previous data file path','/bk /') | '''; 'from V $ datafile;
Then, restore the database under RMAN,
RUN
{
Set newname for datafile '/o254/system01.dbf' TO '/oo/system01.dbf ';
Set newname for datafile '/o254/undotbs01.dbf' TO '/oo/undotbs01.dbf ';
Set newname for datafile '/o254/sysaux01.dbf' TO '/oo/sysaux01.dbf ';
Set newname for datafile '/o254/users01.dbf' TO '/oo/users01.dbf ';
Set newname for datafile '/o254/example01.dbf' TO '/oo/example01.dbf ';
RESTORE DATAbase;
Switch datafile all;
RECOVER DATAbase;
}
7. open the database under sqlplus after the restoration is completed
SQL> alter database open resetlogs; open database and recreate control file;
This completes.
After you finish, there will be no temporary tablespace at 10 Gb, but there will be temporary tablespace at 11 GB and the temporary tablespace is in the oline status,
When we switch to an ip address website or other services, an error is reported when we log on to our website.
The data files in the temporary tablespace cannot be identified or locked.
My solution is
Delete the old temporary tablespace and change the new temporary tablespace to the default temporary tablespace.