Oracle Database manual recovery memo log

Source: Internet
Author: User

Recently, due to the upgrade of Mac OS x 10.10 Yosemite, one night just a few days ago, I found that I was stuck on the boot page. It seems that BETA is unreliable, then I thought that I had just backed up my backup a few days ago. It's okay. What an artifact does TimeMachine have? I don't have to say anything about direct recovery. However, I regret it. I forgot to work overtime last night. The success of the overtime work is almost no result left, the key is that TimeMachine does not back up virtual machine files (30 GB of virtual machine files, probably skipped). It is no wonder that every backup is so fast.

However, it's useless to regret it. just create a new development environment. Operating System WIN7-> development tool VS2012-> database ORACLE. And then the boring Database Backup recovery time. Since I do not have a deep understanding of oracle databases, I have no way to execute scripts in all databases without reading the tutorial with DBA of niub, however, in order not to repeat every time and look back for a tutorial, we will make a profound record here, and I will forget it next time.

Here, the database mainly restores exported dmp files. The specific instructions are as follows:

Import data 1: import data from D: \ daochu. dmp to the TEST database. Imp system/manager @ TEST file = d: \ daochu. dmp full = y imp system/manager @ TEST file = d: \ daochu. dmp full = y ignore = y may be a problem, because some tables already exist, and then it reports an error, so this table will not be imported. Add ignore = y to the end. 2 convert d: \ daochu. table 1 in dmp imports imp system/manager @ TEST file = d: \ daochu. dmp tables = (table1) 3. Import user A's tablespace imp system/manager @ TEST file = d: \ daochu. dmp fromuser = jandardb touser = jandardb data export: 1 completely export the database TEST, and export the username system Password manager to D: \ daochu. exp system/manager @ TEST file = d: \ daochu in dmp. dmp full = y 2 export the tables of system users and sys users in the database exp system/manager @ TEST file = d: \ daochu. dmp owner = (system, sys) 3 export the database tables inner_policy and policy_staff_relat to exp aichannel/aichannel @ TESTDB2 file = d: \ data \ newsmgnt. dmp tables = (inner_policy, policy_staff_relat) 4. Export the filed1 field in table 1 in the database with the data Header "00" exp system/manager @ TEST file = d: \ daochu. dmp tables = (table1) query = \ "where filed1 like '000000 '\"

The process is generally as follows:

Then the detailed steps of the corresponding Execution Process (all the following operations are performed on SQLPLUS)

Create a tablespace

Table Space {copy from Baidu encyclopedia }:

The ORACLE database is divided into logical regions called tablespaces-forming the logical structure of the ORACLE database. One ORACLE database can have one or more tablespaces, while one tablespace corresponds to one or more physical database files. Table space is the minimum unit for ORACLE database recovery. It contains many database entities, such as tables, views, indexes, clustering, rollback segments, and temporary segments.

In a narrow sense, a database can contain multiple tablespaces. Each table in the database belongs to a specific tablespace, which is a logical concept used by Oracle to manage the database.

/* Step 2: create a temporary tablespace */create temporary tablespace name tempfile' storage address \ temporary tablespace storage file name. DBF 'size 50 m autoextend on next 50 m maxsize 20480 m extent management local;/* Step 4: create a data table space */create tablespace name logging datafile 'storage address \ tablespace storage file name. DBF 'size 50 m autoextend on next 50 m maxsize 20480 m extent management local;

Temporary tablespace

Since Oracle often requires some temporary disk space when working, these space is mainly used for queries with sorting (Group by, Order by, etc.) algorithms, and will be released immediately after use, the information recorded in the disk area is no longer used, so it is called a temporary tablespace.

Create database users
/* Create user */create user username identified by password default tablespace temporary tablespace;/* assign permissions, connect, resource, dba is role name */grant connect, resource, dba to user name;

A brief description of database role reservation:

Role name Simple Description
Connect Have the most basic database connection Permissions
Resource Has the ability to create tables, triggers, and other general management Permissions
Dba Apart from not having the permission to shut down and restart the database, most of the system management permissions are available, but do not have the privileges such as SYSDBA and SYSOPER.
Import dmp backup data
Imp username/password @ connection name file = path/file name. dmp full = y

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.