重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2869|回复: 0
打印 上一主题 下一主题

[Oracle] Linux使用命令把前台和后台的进程互相转换

[复制链接]
跳转到指定楼层
楼主
发表于 2020-11-26 14:37:39 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
一、Shell支持作用控制,有以下命令:
command         让进程到后台运行
jobs  -l   查看后台运行的进程
fg   %n   让后台运行的进程n到前台来
bg   %n让进程n到后台去
PS : "n"为jobs查看到的金城编号

二、执行命令&切换到后台
   在linux终端运行命令的时候,在命令行结尾上加&符号,就可以让程序在后台运行

测试:
[oracle@strong backup]$ ll
total 8
-rw-r--r-- 1 oracle dba 150 Nov 26 13:56 backup.rcv
-rwxr-xr-x 1 oracle dba 290 Nov 26 14:14 backup.sh
[oracle@strong backup]$ more backup.rcv
run{
allocate channel c1 device type disk;
backup incremental level 0 database format '/home/oracle/RmanBackup/db0_%d_%T_%s';
release channel c1;
}

[oracle@strong backup]$


执行命令&切换到后台
[oracle@strong backup]$ ./backup.sh &
[1] 23533
[oracle@strong backup]$ RMAN> 2> 3> 4> 5> 6>


验证:
[oracle@strong ~]$ cd RmanBackup/
[oracle@strong RmanBackup]$ ll
total 1129544
-rw-r----- 1 oracle dba 1146822656 Nov 26 14:35 db0_ORCL_20201126_7
-rw-r----- 1 oracle dba    9830400 Nov 26 14:35 db0_ORCL_20201126_8

[oracle@strong backup]$ more backup.log

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Nov 26 14:35:27 2020
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: ORCL (DBID=1575005578)

RMAN> run{
2>  allocate channel c1 device type disk;
3>  backup incremental level 0 database format '/home/oracle/RmanBackup/db0_%d_%T_%s';
4> release channel c1;
5> }
6>
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=41 device type=DISK

Starting backup at 26-NOV-20
channel c1: starting incremental level 0 datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/orcl/system01.dbf
input datafile file number=00002 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf
input datafile file number=00005 name=/u01/app/oracle/oradata/orcl/example01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf
channel c1: starting piece 1 at 26-NOV-20
channel c1: finished piece 1 at 26-NOV-20
piece handle=/home/oracle/RmanBackup/db0_ORCL_20201126_7 tag=TAG20201126T143528 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:15
channel c1: starting incremental level 0 datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 26-NOV-20
channel c1: finished piece 1 at 26-NOV-20
piece handle=/home/oracle/RmanBackup/db0_ORCL_20201126_8 tag=TAG20201126T143528 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 26-NOV-20

released channel: c1

Recovery Manager complete.
[oracle@strong backup]$





分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-5-15 01:52 , Processed in 0.082098 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表