–当前数据文件路径
select path from v$datafile
PATH
/opt/dmdba/dmdbms/data/DAMENG/SYSTEM.DBF
/opt/dmdba/dmdbms/data/DAMENG/ROLL.DBF
/opt/dmdba/dmdbms/data/DAMENG/TEMP.DBF
/opt/dmdba/dmdbms/data/DAMENG/MAIN.DBF
/opt/dmdba/dmdbs/tb/test11.dbf
/opt/dmdba/dmdbms/data/DAMENG/xiaoke_data01.dbf
/opt/dmdba/dmdbms/data/DAMENG/xiaoke_data02.dbf
–创建新的数据文件目录并备份数据库
[root@dbserver ~]#chown -R dmdba:dinstall /dm7
[root@dbserver bin]# systemctl start DmAPService.service
[dmdba@dbserver ~]$ disql SYSDBA/SYSDBA
SQL> backup database full TO BACKUP_FILE_02 BACKUPSET '/dm7/backup/BACKUP_FILE_02';
[root@dbserver BACKUP_FILE_02]# ls -lith /dm7/backup/BACKUP_FILE_02
总用量 4.3G
453969190 -rw-r--r-- 1 dmdba dinstall 77K 5月 28 17:57 BACKUP_FILE_02.meta
453969189 -rw-r--r-- 1 dmdba dinstall 4.3G 5月 28 17:57 BACKUP_FILE_02.bak
[root@dbserver BACKUP_FILE_02]#
–初始化新的数据库
[dmdba@dbserver ~]$ dminit path=/dm7/data/ DB_NAME=oadb INSTANCE_NAME=oadb PORT_NUM=5237 UNICODE_FLAG=0 PAGE_SIZE=16 EXTENT_SIZE=16 CASE_SENSITIVE=1
–数据还原
[dmdba@dbserver bin]$ ./dmrman USE_AP=2 CTLSTMT=“RESTORE DATABASE ‘/dm7/data/oadb/dm.ini’ FROM BACKUPSET ‘/dm7/backup/BACKUP_FILE_02’”
dmrman V7.6.0.142-Build(2019.03.12-103811)ENT
RESTORE DATABASE '/dm7/data/oadb/dm.ini' FROM BACKUPSET '/dm7/backup/BACKUP_FILE_02'
file dm.key not found, use default license!
checking if the database under system path [/dm7/data/oadb] is running...[4].
checking if the database under system path [/dm7/data/oadb] is running...[3].
checking if the database under system path [/dm7/data/oadb] is running...[2].
checking if the database under system path [/dm7/data/oadb] is running...[1].
checking if the database under system path [/dm7/data/oadb] is running...[0].
checking if the database under system path [/dm7/data/oadb] is running, write dmrman info.
RESTORE DATABASE CHECK......
RESTORE DATABASE,dbf collect......
RESTORE DATABASE,dbf refresh ......
RESTORE BACKUPSET [/dm7/backup/BACKUP_FILE_02] START......
total 150 packages processed...
total 180 packages processed...
total 240 packages processed...
total 258 packages processed...
RESTORE DATABASE,UPDATE ctl file......
RESTORE DATABASE,REBUILD key file......
RESTORE DATABASE,CHECK db info......
RESTORE DATABASE,UPDATE db info......
total 259 packages processed!
CMD END.CODE:[0]
restore successfully.
time used: 135579.088(ms)
[dmdba@dbserver bin]$
[dmdba@dbserver bin]$ ./dmrman USE_AP=2 CTLSTMT=“RECOVER DATABASE ‘/dm7/data/oadb/dm.ini’ FROM BACKUPSET ‘/dm7/backup/BACKUP_FILE_02’”
dmrman V7.6.0.142-Build(2019.03.12-103811)ENT
RECOVER DATABASE '/dm7/data/oadb/dm.ini' FROM BACKUPSET '/dm7/backup/BACKUP_FILE_02'
file dm.key not found, use default license!
checking if the database under system path [/dm7/data/oadb] is running...[4].
checking if the database under system path [/dm7/data/oadb] is running...[3].
checking if the database under system path [/dm7/data/oadb] is running...[2].
checking if the database under system path [/dm7/data/oadb] is running...[1].
checking if the database under system path [/dm7/data/oadb] is running...[0].
checking if the database under system path [/dm7/data/oadb] is running, write dmrman info.
EP[0] max_lsn: 29150558
RESTORE RLOG CHECK......
CMD END.CODE:[603],DESC:[备份集[/dm7/backup/BACKUP_FILE_02]备份过程中未产生日志]
备份集[/dm7/backup/BACKUP_FILE_02]备份过程中未产生日志
recover successfully!
time used: 7044.032(ms)
[dmdba@dbserver bin]$
[root@dbserver oadb]# ls -lith /dm7/data/oadb
总用量 8.9G
453969201 -rw-r--r-- 1 dmdba dinstall 27M 5月 28 18:13 SYSTEM.DBF
453969200 -rw-r--r-- 1 dmdba dinstall 256M 5月 28 18:13 oadb02.log
453969199 -rw-r--r-- 1 dmdba dinstall 256M 5月 28 18:13 oadb01.log
453969204 -rw-r--r-- 1 dmdba dinstall 633 5月 28 18:13 dm_service.prikey
453969202 drwxr-xr-x 2 dmdba dinstall 114 5月 28 18:13 ctl_bak
453969198 -rw-r--r-- 1 dmdba dinstall 6.5K 5月 28 18:13 dm.ctl
453969211 -rw-r--r-- 1 dmdba dinstall 128M 5月 28 18:13 xiaoke_data02.dbf
453969210 -rw-r--r-- 1 dmdba dinstall 128M 5月 28 18:13 xiaoke_data01.dbf
453969209 -rw-r--r-- 1 dmdba dinstall 100M 5月 28 18:13 test11.dbf
453969206 -rw-r--r-- 1 dmdba dinstall 7.9G 5月 28 18:13 MAIN.DBF
453969207 -rw-r--r-- 1 dmdba dinstall 220 5月 28 18:13 dminst.sys
453969205 -rw-r--r-- 1 dmdba dinstall 128M 5月 28 18:11 ROLL.DBF
524609589 drwxr-xr-x 2 dmdba dinstall 6 5月 28 18:11 HMAIN
453969208 -rw-r--r-- 1 dmdba dinstall 10M 5月 28 18:07 TEMP.DBF
453969194 -rw-r--r-- 1 dmdba dinstall 758 5月 28 18:03 dminit20200528180347.log
453969196 -rw-r--r-- 1 dmdba dinstall 43K 5月 28 18:03 dm.ini
453969197 -rw-r--r-- 1 dmdba dinstall 479 5月 28 18:03 sqllog.ini
453969193 drwxr-xr-x 2 dmdba dinstall 6 5月 28 18:03 bak
[root@dbserver oadb]#
–启动数据库验证
[dmdba@dbserver bin]$ ./dmserver path=/dm7/data/oadb/dm.ini
file dm.key not found, use default license!
version info: develop
Use normal os_malloc instead of HugeTLB
Use normal os_malloc instead of HugeTLB
DM Database Server x64 V7.6.0.142-Build(2019.03.12-103811)ENT startup...
License will expire on 2020-06-11
ckpt lsn: 29150558
ndct db load finished
ndct fill fast pool finished
EP[0] pseg_collect_items end, collect 0 trx, 0 committed pages, 0 active pages
EP[0] undo over, total 0 page rollbacked
purge over, total 0 page purged
set EP[0]'s pseg state to inactive
iid page's trxid = 56046
NEXT TRX ID = 56047
pseg recv finished
nsvr_startup end.
aud sys init success.
aud rt sys init success.
systables desc init success.
ndct_db_load_info success.
nsvr_process_before_open begin.
nsvr_process_before_open success.
SYSTEM IS READY.
–登陆验证数据
[root@dbserver oadb]# netstat -ntlp |grep dms
tcp6 0 0 :::5237 :::* LISTEN 6333/./dmserver
[dmdba@dbserver ~]$ disql sysdba/SYSDBA:5237
SQL> select path from v$datafile;
---------- --------------------------------
1 /dm7/data/oadb/SYSTEM.DBF
2 /dm7/data/oadb/ROLL.DBF
3 /dm7/data/oadb/TEMP.DBF
4 /dm7/data/oadb/MAIN.DBF
5 /dm7/data/oadb/test11.dbf
6 /dm7/data/oadb/xiaoke_data01.dbf
7 /dm7/data/oadb/xiaoke_data02.dbf
7 rows got
已用时间: 105.320(毫秒). 执行号:3.
SQL>
最后修改时间:2020-06-03 17:48:44
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




