Oracle database instance recovery CentOS above simple operation flow

1. When acquiring a backup of the database can be backed oracle database recovery operations above linux more complicated. This is a brief description of the inside.

2. Remote connection linux main tool to select xshell 

As illustrated:

3. It is recommended to use the root user to create a directory, and to this oracle user directory gives permission

mkdir / oracledir 

chown -R the Oracle: oinstall / oracledir 

first command creates a folder 

second command to modify the permissions of a folder

4. Open the ftp upload database backup.

Main interface

Note recommended after completion of uploading files in the file permissions could not handle it because the file permissions of the root user to upload

chown -R oracle:oinstall /oracledir

4. Restore pre-treatment

Which switch to the oracle in linux user 

SU - oracle

input the command

sqlplus / as sysdba
进入oracle的 命令行工具
然后输入命令
1. 创建目录
create or replace directory dir as '/oracledir/' ;
2. 创建表空间和用户等
create tablespace cwbaseoe73 datafile '/oracledir/cwbaseoe73.dbf' size 1024m autoextend on next 1024m ;
用户
create user lcoe739999 default tablespace cwbaseoe73 identified by Test6530 ;
赋予部分权限
grant dba,resource,connect,create any table,create any view,create any sequence ,unlimited tablespace to lcoe739999 ;

注意 如果是 orac的话 datafile 后面的参数 使用 '+DATA/cwbaseoe73.dbf' 应该即可

5. 执行恢复命令

impdp system/Test6530@127.0.0.1/ora18c directory=dir schemas=lcoe739999 dumpfile=CWBASEOE73_201906.DMP logfile=20190622.txt

注意 如果是rac的话 应该在任意一台机器上面执行恢复命令即可, ip地址 可以写成VIP的地址 服务名也是 最终的服务名. 

如果是rac 的话 还需要 添加一个
 cluster=no  的参数来执行
 

一般的日志为:

Import: Release 18.0.0.0.0 - Production on Sat Jun 22 14:55:48 2019
Version 18.3.0.0.0

Copyright (c) 1982, 2018, Oracle and/or its affiliates.  All rights reserved.


Connected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Master table "SYSTEM"."SYS_IMPORT_SCHEMA_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01":  system/********@127.0.0.1/ora18c directory=dir schemas=lcoe739999 dumpfile=CWBASEOE73_201906.DMP logfile=20190622.txt 
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"LCOE739999" already exists

Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TYPE/TYPE_SPEC
Processing object type SCHEMA_EXPORT/DB_LINK
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE

 

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/11068945.html