通过并行nologging等快速创建大表备份
redhat6.5+oracle11.2.0.4rac+96cpu,256g内存
[root@db jyc]# cat 20200527.sh
#!/bin/sh
su - oracle -c "sqlplus /nolog <<EOF
@/home/oracle/jyc/20200527.sql;
exit;
EOF"
[root@db jyc]# cat 20200527.sql
set time on
set timing on
conn user/password
alter session set workarea_size_policy=manual;
alter session set sort_area_size=1073741820;
alter session set sort_area_retained_size=1073741820;
alter session set db_file_multiblock_read_count=128;
create table testtable parallel (degree 32) ----主机cpu96,而且sar 1 10查看空闲99%,所以并行度可增加,此处用了32
nologging
as
select * from tabtest;
alter table testtable NOPARALLEL;
alter table testtable LOGGING;
提示:非空的约束,包括主键会被创建。
赋予执行权限:
chmod +x20200527.sh
后台执行:
[root@db jyc]# nohup ./20200527.sh > ./2200527.log &
查看输出:
tail -f 2200527.log
原文地址:https://blog.csdn.net/jycjyc/article/details/144042055
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!