Oracle Database Data Recovery verification notes

Source: Internet
Author: User

In the past few years, we have made data recovery orders and often encountered Oracle cases. When we recover data, how can we let users see what is in the oracle database, instead of one oracle data file, the following is my summary, which is useful for beginners of oracle and engineers engaged in data recovery. This is some of the experiences I have spent a lot of energy summing up in the past, I made them all in 1.1 drops.

1. Cold backup requires that controlfile, pfile, datafile, and redo logfile be copied when the database is shut down.

2. Copy the corresponding files to the corresponding directory on the new machine according to the same directory structure.

3. Assume that the pfile is in D: \ Oracle \ admin \ dsserver \ pfile \ init. ora and runs on the new machine:

Oradim-NEW-SRVC OracleServiceDSSERVER-STARTMODE manual-PFILE "D: \ Oracle \ admin \ dsserver1 \ pfile \ init. ora"

Generate a new instance Management Service in the service, and start the service manually.

4. Add "D: \ oracle \ ora81 \ network \ ADMIN \ listener. ora"

(SID_DESC =

(GLOBAL_DBNAME = dsserver)

(ORACLE_HOME = D: \ oracle \ ora81)

(SID_NAME = dsserver)

)

5. Run lsnrctl, stop, and start to check the dsserver listener.

6. Run oradim-STARTUP-SID dsserver-STARTTYPE srvc to start the database instance.

7. log in with the original dsserver User:

Add the following options to the D: \ oracle \ ora81 \ network \ ADMIN \ tnsnames. ora file:

DSSERVER_QINTL =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP) (HOST = qintl) (PORT = 1521 ))

)

(CONNECT_DATA = (SID = dsserver) (SERVER = DEDICATED ))

)

Or oracle dba studio connection

8. If everything goes well, everything is OK!

**************************************** **************************************** *********************************

For windows, after the service is started, it does not mean that the database has started I

Solve the problem of different directory structures

If the path changes, for example, controlfile, You need to modify the path of controlfile in pfile. If the path of the data file changes, you need to rename datafile to the new path after mount.

Connect sys/qintl @ dsserver_qintl as sysdba

Connect/as sysdba

Startup mount pfile = D: \ oracle \ admin \ dsserver1 \ pfile \ init. ora

Startup mount pfile =/ora/ora9/admin/gpdx/pfile/init. ora.7122004261153

Startup pfile =/ora/ora9/admin/gpdx/pfile/init. ora.7122004261153

Startup mount pfile =/oracle/initLYGADB. ora.112007223616

Startup nomount pfile =/oracle/initLYGADB. ora.112007223616

Alter database datafile '/oradata/LYGADB/lsa_image.dbf' offline drop;

Move data files

Alter database rename file 'e: \ test. dbf' to 'd: \ test. dbf ';

Alter database rename file 'd: \ oracle \ oradata \ dsserver \ DBSTAR_IND_L.ORA 'to 'd: \ oracle \ oradata \ dsserver \ dbf \ DBSTAR_IND_L.ORA ';

SQL> alter database rename file '/opt/oracle/test. dbf' to'/opt/oracle/oradata/conner/test. dbf ';

Database altered.

The path of the redo log file cannot be changed?

SQL> recover database until cancel;

SQL> alter database open resetlogs; // recreate the log file

 

Recover database;

SQL> alter database open;

Database altered.

Orapwd file =/home/oracle/product/10.2.0/db_1/dbs/orapw password = oracle entries = 10

Orapwd file = d: \ oracle \ ora81 \ DATABASE \ PWDorcl. ORA password = oracle entries = 10

SQL> select name from v $ datafile;

Moved

SQL> alter database drop logfile group 1;

SQL> alter database add logfile group 1 ('d: \ oracle \ oradata \ dsserver1/log1.log ',

'D: \ oracle \ oradata \ dsserver1 \ log101.log ') size 50 m;

Summary steps:

1. sqlplus/nolog

2. SQL> connect as sysdba

3. SQL> startup mount pfile = D: \ oracle \ admin \ dsserver \ pfile \ init. ora

4. SQL> select name from v $ datafile; // view the original data file location

5. alter database rename file 'd: \ oracle \ oradata \ dsserver \ DBSTAR_IND_L.ORA 'to 'd: \ oracle \ oradata \ dsserver \ dbf \ DBSTAR_IND_L.ORA '; // update the data file location one by one

6. SQL> alter database open; // open the database

7. SQL> select name from v $ datafile; // view the changed data

 

Rem creates user DBSTAR

Create user "DBSTAR" PROFILE "DEFAULT" identified by "qintl"

Default tablespace "USERS" temporary tablespace "TEMP" account unlock;

GRANT "CONNECT" TO "DBSTAR ";

GRANT "RESOURCE" TO "DBSTAR ";

Alter user "DBSTAR" default role all;

 

 

Database files: data files, Control files, and redo log files.

Optional files: parameters file, passwordfile, and archived log files.

 

Cold Backup recovery without redoing log files

1) startup mount

2) alter database open resetlogs;

It will re-create redo logs based on information in control files.

 

This article is written by Yan tingliang, dasi's chief engineer. For more information, see the source.

This article is from the blog "ting tingliang data recovery technology blog ".

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.