Full resume execution and stay in rollup example

Source: Internet
Author: User

This article, "Complete recovery and stay in rollup examples", introduces some of Oracle's operations and code.

After copying the data files back, there is also a full restore command

1.recover Database

Startup Force Mount

Recover database; ==alter database Reover database;

2.recover Tablespace can only run in open state

Recover tablespace users; = ALTER DATABASE recover tablespace users;

3. Recover datafile can be run under mount and open

Recover datafile ' d:\demo\system01.dbf ';

Recover datafile 1,2 ==alter database recover datafile 1,2

4, the application of the final log

Restore after specifying archive log location

Recover from ' E:\archivelog ' datafile 4;

To apply an archive log automatically:

Method 1:set AutoRecovery on

Recover DataFile 5;

Methods 2:recover automatic datafile 5;

See which data files need to be recovered

Select file#,error,change# from V$recover_file;

List which log number to start requires application

Select sequence# from V$loghist where 1481225 between first_change# and switch_change#;

List the required OCP authentication logs

Select Sequence#,archive_name from V$recovry_log;

Second, stay in rollup example

1.20:48:37 SCOTT@ORCL (^ω^) Select A.dname,b.job,sum (b.sal) sum_sal,grouping (a.dname), grouping (b.job)

2.20:57:43 2 from Dept a,emp b

3.20:57:43 3 where A.deptno=b.deptno

4.20:57:43 4 GROUP by A.dname,rollup (B.job)

5.20:57:45 5/

6.

7.DNAME JOB sum_sal GROUPING (a.dname) GROUPING (b.job)

8.----------------------------------------------------------------------------------------

9.SALES Clerk 950 0 0

10.SALES MANAGER 2850 0 0

11.SALES Salesman 5600 0 0

12.SALES 9400 0 1

13.RESEARCH Clerk 1200 0 0

14.RESEARCH ANALYST 7000 0 0

15.RESEARCH MANAGER 2975 0 0

16.RESEARCH 11175 0 1

17.ACCOUNTING Clerk 1300 0 0

18.ACCOUNTING MANAGER 2450 0 0

19.ACCOUNTING PRESIDENT 5000 0 0

20.ACCOUNTING 8750 0 1

21st.

22.12 rows have been selected.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

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.