rman generate script set until time

 
echo 'run {'  >  test2.cmd
echo 'allocate channel t1' >> test2.cmd
echo 'set until time="to_date('\'''`date "+%Y-%m-%d %H:%M:%S"`''\'','\''YYYY-MM-DD hh24:mi:ss'\'')";' >> test2.cmd
echo 'set newname for database to '+datadg';'  >> test2.cmd
echo 'restore database;' >> test2.cmd
echo 'switch  datafile all;' >> test2.cmd
echo 'recover database;' >> test2.cmd
echo 'release channel t1;' >> test2.cmd
echo '}' >> test2.cmd


prm dul恢复oracle数据库数据表 中文最简易说明

 

 

 

软件下载地址: https://zcdn.parnassusdata.com/DUL5108.zip

本软件为JAVA编写,可用于WINDOWS LINUX(红帽,Centos,Ubuntu) AIX SOLARIS HPUX

 

但必须先安装 JDK 1.8 !!!

 

JDK 下载地址:

 

LINUX X86: http://zcdn.parnassusdata.com/jdk-8u201-linux-i586.rpm 32位LIUNX
LIUNX X86-64: http://zcdn.parnassusdata.com/jdk-8u91-linux-x64.rpm 64位LIUNX

Windows X86: http://zcdn.parnassusdata.com/jdk-8u201-windows-i586.exe 32位Windows
Windows X86-64: http://zcdn.parnassusdata.com/jdk-8u181-windows-x64.exe 64位Windows

目前的操作系统,基本都是64位的,推荐用64位JDK!!

确认JAVA 版本,打开命令行,在windows上是cmd

java -version

解压DUL5108.zip

Windows双击prm.bat
Linux 在满足X-Windows的条件下运行sh prm.sh,可以安装XSHELL Xmanager等远程图形化客户端:
xmanager 下载地址:
xmanager 4 https://zcdn.askmaclean.com/Xme4.exe
xmanager 6 https://zcdn.askmaclean.com/Xme6.exe

选择字典模式,
加入所有数据文件即可!! 必须加入所有你找的到的数据文件,所有的属于整个数据库的数据文件!!
不要加入其他数据库的数据文件!!

所有数据文件!!
所有数据文件!!
不要只加入SYSTEM01.DBF!!
不要只加入SYSTEM01.DBF!!
不要只加入你认为有问题的数据文件!!
不要只加入你认为有问题的数据文件!!
所有数据文件!!
所有数据文件!!
必须包含 SYSTEM01.DBF!!
必须包含 SYSTEM01.DBF!!
必须包含 SYSTEM01.DBF!!

如何找到所有数据文件???
在命令行中
sqlplus / as sysdba
conn / as sysdba
shutdown immediate;
startup mount;
select name from v$datafile;

最简单模式下不用选择任何参数,只要加入数据文件!!

ctrl+A 选择目录下所有dbf/ora文件!!

双击查看表中的样例数据,
这只是样例数据!!不是全部数据!!
这只是样例数据!!不是全部数据!!
这只是样例数据!!不是全部数据!!

找到你要的用户名,下面查看重要表是否有数据!!
你看到的只是样例数据!!不是全部数据!!
你看到的只是样例数据!!不是全部数据!!

社区版最多抽1万行,可能会略多于1万行!!!
社区版最多抽1万行,可能会略多于1万行!!!
社区版最多抽1万行,可能会略多于1万行!!!
社区版最多抽1万行,可能会略多于1万行!!!

右键unload 数据抽取到文件。
抽取完 就给你 这个文件的路径了!!!
抽取完 就给你 这个文件的路径了!!!
抽取完 就给你 这个文件的路径了!!!
按照路径去 就能看到这个文件!!!!

建议使用databridge数据搭桥模式!!
建议使用databridge数据搭桥模式!!
建议使用databridge数据搭桥模式!!
不推荐用 unload 抽取模式!!

数据搭桥模式,在新数据库/目标数据库新建一个用户,
create user pd1 identified by oracle;
grant dba to pd1;

注意给dba权限!!!!
注意给dba权限!!!!
注意给dba权限!!!!

没有新数据库,那就自己建一个!! 用dbca命令,新建一个!!
注意字符集要和原来数据库一样!!!!

注意目标数据库监听是否打开了???????
注意目标数据库监听是否打开了???????
确保 监听打开了, 服务注册了!!!!
确保 监听打开了, 服务注册了!!!!

选择你想要的表空间!!!

可以数据搭桥整个用户,整个用户,整个用户下的所有表!!!!
不是只能一张张表抽!!!
不是只能一张张表抽!!!
可以数据搭桥整个用户,整个用户,整个用户下的所有表!!!!

点用户名,右键,数据搭桥整个用户下所有表!!!

可以将用户的表结构,索引,主键约束,视图,存储过程,包,触发器,sequence序列导出成ddl文本!!
可以将用户的表结构,索引,主键约束,视图,存储过程,包,触发器,sequence序列导出成ddl文本!!
可以将用户的表结构,索引,主键约束,视图,存储过程,包,触发器,sequence序列导出成ddl文本!!

右键用户 ,选择一个可用的数据搭桥用户,最后给你一个文本文件!!!
右键用户 ,选择一个可用的数据搭桥用户,最后给你一个文本文件!!!
右键用户 ,选择一个可用的数据搭桥用户,最后给你一个文本文件!!!

导出ddl功能,要购买了企业版授权,才能生效!!!!
导出ddl功能,要购买了企业版授权,才能生效!!!!
导出ddl功能,要购买了企业版授权,才能生效!!!!

数据搭桥默认将varchar字段,修改为varchar(4000),以保证一定可以插入成功!!!
如果不希望使用varchar(4000),可以用上一步(导出表结构ddl)生成的建表语句先建表!!
如果不希望使用varchar(4000),可以用上一步(导出表结构ddl)生成的建表语句先建表!!
数据搭桥会直接插入数据到目标表,而不自己创建表!!!!

如果还有问题可以找我们 电话 13764045638 QQ 47079569 !!!

使用PRM DUL软件快速恢复被勒索病毒 恶意软件加密的ORACLE数据库数据文件

为什么可以恢复这些被加密的ORACLE数据库数据文件?

因为这些文件一般比较大,超过300MB。导致恶意加密软件要加密它们时要花费大量时间和CPU,因此这些勒索软件一般仅部分加密其内容。

通过PRM-DUL的强大功能,可以恢复出其中绝大部分未被加密的内容。

PRM DUL download: https://zcdn.parnassusdata.com/DUL5108.zip

 

 

 

 

 

666和{Killserver@protonmail.com}KSR后缀加密病毒的Oracle数据文件DBF恢复

近期有大量勒索加密病毒造成ORACLE数据库损坏的案例,常见的有 Hephaestus666和Aphrodite666  以及 {Killserver@protonmail.com}KSR 和 完全无意义文件名的qxlozcf :

 

 

λ ls -ltr
-rw-r--r-- 1 st 197121 10737427200 7月  19 05:39 MAILBOX01.DBF.Hephaestus666
-rw-r--r-- 1 st 197121  5368718080 7月  19 05:39 SF_HISTORY01.DBF.Hephaestus666
-rw-r--r-- 1 st 197121  5368718080 7月  19 05:39 SF_MBP01.DBF.Hephaestus666
-rw-r--r-- 1 st 197121 32212263680 7月  19 05:39 SYSTEM01.DBF.Hephaestus666
-rw-r--r-- 1 st 197121  5368718080 7月  19 05:39 USERS01.DBF.Hephaestus666
-rw-r--r-- 1 st 197121 32212263680 7月  19 05:39 USR01.DBF.Hephaestus666
λ ls -ltr
total 27626584
-rw-r--r-- 1 st 197121  9017762736 7月  25 07:04 'MHSOFT.DBF.{Killserver@protonmail.com}KSR'
-rw-r--r-- 1 st 197121 15544099760 7月  25 07:04 'MHSOFT02.DBF.{Killserver@protonmail.com}KSR'
-rw-r--r-- 1 st 197121   104866736 7月  25 07:04 'MHTEMP.DBF.{Killserver@protonmail.com}KSR'
-rw-r--r-- 1 st 197121  1468015536 7月  25 07:04 'STRNEWEMR.DBF.{Killserver@protonmail.com}KSR'
-rw-r--r-- 1 st 197121  1310729136 7月  25 07:04 'SYSAUX01.DBF.{Killserver@protonmail.com}KSR'
-rw-r--r-- 1 st 197121   838869936 7月  25 07:04 'SYSTEM01.DBF.{Killserver@protonmail.com}KSR'
-rw-r--r-- 1 st 197121     5252016 7月  25 07:04 'USERS01.DBF.{Killserver@protonmail.com}KSR'
λ ls -l *666
-rw-r--r-- 1 st 197121  73409280 8月   1 05:32 GAA8220120228_T.Aphrodite666
-rw-r--r-- 1 st 197121 301998848 8月   1 05:33 GADATA0004_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:33 GADATA0004_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 251667200 8月   1 05:34 GADATA0006_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:34 GADATA0006_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 301998848 8月   1 05:35 GADATA0008_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:35 GADATA0008_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 352330496 8月   1 05:36 GADATA0010_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 251667200 8月   1 05:37 GADATA0010_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 251667200 8月   1 05:38 GADATA0012_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:39 GADATA0012_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 251667200 8月   1 05:40 GADATA0014_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:41 GADATA0014_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 251667200 8月   1 05:42 GADATA0016_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:42 GADATA0016_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 251667200 8月   1 05:43 GADATA0018_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:43 GADATA0018_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 251667200 8月   1 05:44 GADATA0020_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:45 GADATA0020_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 251667200 8月   1 05:46 GADATA0025_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:46 GADATA0025_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 301998848 8月   1 05:47 GADATA0027_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:48 GADATA0027_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 301998848 8月   1 05:48 GADATA0028_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:49 GADATA0028_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 301998848 8月   1 05:50 GADATA0030_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:51 GADATA0030_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 301998848 8月   1 05:51 GADATA0032_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:52 GADATA0032_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 301998848 8月   1 05:53 GADATA0034_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:54 GADATA0034_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 301998848 8月   1 05:55 GADATA0036_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:55 GADATA0036_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 301998848 8月   1 05:56 GADATA0038_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:57 GADATA0038_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 251667200 8月   1 05:58 GADATA0040_I.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 201335552 8月   1 05:58 GADATA0040_T.DAT.Aphrodite666
-rw-r--r-- 1 st 197121 251667200 8月   1 05:59 GADATA0044_I.DAT.Aphrodite666
λ ls -ltr
total 17428672
-rw-r--r-- 1 st 197121  1069556252 12月 29  2018 SYSTEM01.DBF.qxlozcf
-rw-r--r-- 1 st 197121 15728648732 12月 29  2018 APF_MES_YW_DATA.DBF.qxlozcf
-rw-r--r-- 1 st 197121  1048584732 12月 29  2018 APF_MES_YW_DATA_MM.DBF.qxlozcf

以上这些加密类病毒破坏的Oracle数据文件均可以通过PRM DUL 软件恢复其中的数据,

为什么可以恢复这些被加密的ORACLE数据库数据文件?

因为这些文件一般比较大,超过300MB。导致恶意加密软件要加密它们时要花费大量时间和CPU,因此这些勒索软件一般仅部分加密其内容。

通过PRM-DUL的强大功能,可以恢复出其中绝大部分未被加密的内容。

PRM DUL download: https://zcdn.parnassusdata.com/DUL5108.zip

恢复流程较为复杂,可以参考如下视频:

prm dul supports all version oracle pluggable database

prm oracle recovery software supports oracle 12cR1 12cR2 18c 19C PDB CDB Container database pluggable database

PRM-SCAN extract datafile from corrupted asm disk group

PRM-SCAN extract datafile from corrupted asm disk group

let ‘s go !

asmcmd
lsdsk
lsdg

let corrupt the asm disk header by manual

dd if=/dev/zero of=/dev/vdb1 bs=1024k count=10 conv=notrunc

this will write zero to asm header 10M

SQL> alter diskgroup data mount;
alter diskgroup data mount
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15017: diskgroup “DATA” cannot be mounted
ORA-15040: diskgroup is incomplete

fail to mount the corrupted asm disk group

ok

use PRMSCAN to scan the failed asm diskgroup’s disk

this only require read-only permission

it will take long time to scan , up to the disk size

java -jar PRMScan.jar –outputsh o1.sh

this command will output lots of dd command , help you extract datafiles blocks and merge them into datafiles

let see it

some datafiles may need to be ignored , find out your datafiles !!

execute the shell will generate datafiles under your current directory !

if you have multiple db’s system01.dbf store on same diskgroup , you may need to distinguish them by yourself, or you can call parnassusData service

let’s extract data from the datafile using prm !!

prm scan can work on

1. corrupted asm diskgroup ,failed to mount
2. corrupted / formatted filesystem
3. deleted datafile from asm diskgroup
4. deleted datafile from filesystem

filesystem(ntfs,ext 2/3/4,xfs whatever filesystem type)

we provide prm scan as a product (bundle with prm) or a service .

contact us service@parnassusdata.com !!

PRM支持恢复ORACLE 12cR1/12cR2/18C/19C 可拔插数据库

 

PRM DUL支持 ORACLE 12cR1,12cR2,18C,19C 容器数据库 可拔插数据库

PRM DUL now supports oracle 12cR1,12cR2,18C,19C Container Database Pluggable database PDB/CDB

12CR1 PDB TEST , works!
12cR2 PDB TEST , works!
18c PDB TEST , works!
19c PDB TEST , works!

所有版本的PDB,均可正常读取!

PRM-DUL Tool – Your Oracle Database Recovery Expert Here

PRM-DUL Oracle Database Recovery Tool (PRM-DUL) is one advanced tool developed for Oracle data recovery.

From release 1.0 to now, more functions and enhancements have been built into the new version. And continuous bug fixes and logical improvements support it to be now more stable in various enterprise environment.

 

  • Many cases have proved that PRM-DUL Oracle Database Recovery Tool can work well on multiple OS platforms (AIX/HPUX/SOLARIS/Linux/Windows). The current version now support Oracle 9i/10g/11g/12c Oracle Databases Data Rescue Operations.
  • It is a Java based, free installation software. You can start it directly after download and unzip the package. (On Windows, click the executable file prm.bat. On Linux/Unix, the start file is prm.sh)
    ** We advise users to use Java 1.6 or higher version before trying PRM-DUL 4.0.
    Java official version can support most of PRM-DUL functions except raw device operations. If you are using this tool for raw device data recovery, please install Java OpenJDK instead.
  • PRM-DUL GUI interface can help user for easy use. It is not necessary for users to learn extra sets of commands or try to understand Oracle data file layout structures. Through PRM-DUL Recovery Wizard, we can easily rescue the database data and “save my life” J.
  • PRM-DUL supports single data file scan and data extraction, it also supports Oracle ASM storage data recovery.

 

  • The rescued data can be exported in sql loader data file format. And also we can use PRM-DUL Data Bridge function to export data and insert into one another new database directly, that means data can be rescued and recovered without staging.

 

 

————————-

Version 4.0 Enhancements:

  1. Support data recovery for table DELETE wrong operations.
  2. Great improvements on exporting performance for LOB data bridge in dictionary mode.
  3. Add support for LOB data bridge in non-dictionary mode.
  4. Add support for re-use dictionary mode/non-dictionary mode scanning data info.
  5. Add DDL export support at schema level

————————-

PRM-DUL Oracle Database Recovery Tool – Major functions:

  • Can do data scanning and analyzing on database files, no matter Oracle Database is running or not.
  • Support ASM, PRM-DUL can read ASM storage disks directly, find the data files and then do the data scanning and analyzing.
  • Support raw devices data files reading.
  • Support LOB (CLOB, NCLOB and BLOB) column data recovery, it also supports the case when different LOB columns have different chunk size in one same table.
  • Support Oracle database recovery on multiple Big Endian or Little Endian operating systems (AIX/HPUX/SOLARIS/Linux/Windows).
  • Support partition, sub-partition data recovery
  • Support various table data recovery, which also includes HEAP tables and CLUSTER tables.
  • Support truncated table data recovery.
  • Support dropped table data recovery.
  • Support Non-dictionary mode data recovery when SYSTEM table space is missing or data dictionary is broken. Provide part of block data to assist user to determine the data type for recovery.
  • Support BigFile table space data recovery.
  • Support data files with different block sizes in one same database.
  • Support CREATE table SQL file and sqlldr control file auto-generating when rescued data is exported into flat file.

————————-

In the growing enterprise IT systems, data capacity is expanding in geometric progression. Even if DBAs are aware of the importance of backup, they will still suffer from problems such as lack of backup storage space, backup failures or unavailable, physical storage disaster damage, and so on. Therefore, it’s necessary for DBAs to familiar with a physical data recovery tool and understand how to use it.
If your Oracle database downs due to an unexpected failure, the physical storage is damaged and cannot be restarted, and you are stuck in the backup is too old to be used. Then you can consider trying PRM-DUL for emergency rescue processing.

————————-
There are many types of errors to show Oracle Database’s disaster damage or block corruption:
Such as block corruption/bad block, index corruption/ bad block, row corruption/ bad block, UNDO corruption/bad block, control file corruption, consistent read problem, data dictionary corruption, data file/RDBA/BL problem etc. If you meet ORA-1578 / ORA-8103 / ORA-1410 / ORA-1499 / ORA-1578 / ORA-81## / ORA-14## / ORA-26040 / ORA-600 …errors but failure to recover it, we advise you to try PRM-DUL as one of your data rescue means.

————————-

PRM-DUL Oracle database recovery tool has two editions (for Community and Enterprise):

  • Community Edition – Oracle database users can free download the latest version at any time from parnassusdata.com. Without the purchase of License, the software is free for use as a community version, the community version allows each table up to 10,000 lines of data rescue export, so users can use the software for free on some small databases.
  • Enterprise Edition – If the table row number required to be recovered is more than 10,000 and you’ve tried PRM-DUL and confirm it can fix your problem. Then you can visit the official website and consider to purchase the Enterprise License for this tool. After the registration for the software by using the license you’ve got. Your software can be upgraded from the community edition to the enterprise one. The enterprise edition has no line number limit, and all other functions and enhancements will be open to you.

————————-

If you have more questions about using this tool or you need more help on it, don’t hesitate to visit the official website at http://www.parnassusdata.com/. Call the hotline or email our software service for additional help.

 

 

 

Recovering a Deleted Oracle Datafile Without a Backup

Recovering a Deleted Oracle Datafile Without a Backup

 

Recovering a Deleted Oracle Datafile Without a Backup

Oracle PRM-DUL Undelete Oracle record/rows

Download PRM-DUL http://www.parnassusdata.com/en

On scenarios without valid physical or logical backups, when a mistaken delete occurred in Oracle, it will be given priority to use techniques such as flashback or logminer to recover the data rows in Oracle tables in general, but in many cases even flashback or logminer could not turn the tide.

For the row piece in the underlying data block of Oracle, delete operation only modify the row flag and mark them as deleted. It allows records of the subsequent INSERT to override these data marked as delete, and also allows to destroy the structure of these data that are deleted. In other words, if no operations has been done on tables after delete, it is possible to read the complete data by directly reading those records that are marked as deleted in blocks.

 

In a word, whether it can recover the deleted data or not all depends on whether the deleted data rows in oracle block on the disk have been eventually cleared or not.

 

As soon as it has not been cleared, ORACLE PRM-DUL can attempt to recover the data, and the specific steps has little difference with the ordinary data dictionary mode.

 

Start up the PRM – DUL, click the restore wizard in dictionary mode
prm-undelete1

prm-undelete2

 

 

 

prm-undelete4

prm-undelete5

 

Add all of the Oracle data files, no TEMPFILE, UNDO data files, control files, log files is required.

prm-undelete6

 

Click the load button, PRM will automatically load the data dictionary, i.e. bootstrap operation

 

prm-undelete7

ow on the left of PRM, you will see the object tree, select the corresponding data table under the user that you need to recover, right-click the object and then select unload deleted data.

prm-undelete8

 

prm-undelete9

After completing the recovery of the deleted data, PRM-DUL will write the data to the location of File path in the picture above, the Sample data recovery is as follows.

prm-undelete10

 

沪ICP备14014813号

沪公网安备 31010802001379号