Oracle-数据库还原和备份

数据还原

imp hsopics/123456@128.8.100.101/OPICS full=y file=/home/oracle/dmp/opics_20180104.dmp ignore=y
imp fms/single_qlb@128.8.100.101/OPICS full=y file=/home/oracle/dmp/fms_20160830.dmp ignore=y
imp quote_qd/123456@128.8.100.101/OPICS full=y file=/home/oracle/dmp/position20170831.dmp ignore=y

数据库备份

exp sl_trd_sh/123456@128.8.100.101/IFBM file=/home/oracle/databak/ifbmbak20180416.dmp full=y 上海银行数据库
imp tygl/123456@128.8.100.101/IFBM full=y file=/home/oracle/dmp/20180424.dmp ignore=y

导入导出

exp VOLET_DEV_SL/123456@128.8.100.101/IFBM file=/home/oracle/databak/VOLET_DEV_SL20200303.dmp full=y

imp VOLET_DEV_SL/123456@192.168.2.23:1521/ORCL file=/mnt/hgfs/vmshare/VOLET_DEV_SL20200303.dmp fromuser=VOLET_DEV_SL touser=VOLET_DEV_SL ignore=y buffer=5400000

cat '/mnt/hgfs/vmshare/VOLET_DEV_SL20200303.dmp' |od -x|head -1|awk '{print $2 $3}'|cut -c 3-6

–导出、生成当前用户的所有表和视图的注释

SELECT 'comment on table ' || a.table_name || ' is ' || '''' || a.comments || '''' || ';'
from user_tab_comments a
where a.table_type in ('TABLE', 'VIEW')
AND comments IS NOT NULL;

–导出、生成当前用户的所有表字段的注释

SELECT 'comment on column ' || t.table_name || '.' || t.column_name ||
' is ' || '''' || t1.comments || '''' || ';'
FROM User_Tab_Cols t, User_Col_Comments t1
WHERE t.TABLE_NAME = t1.table_name
AND t.column_name = t1.column_name
AND t1.comments IS NOT NULL;

1. 查看所有表空间大小


select tablespace_name,sum(bytes)/1024/1024 from dba_data_files

group by tablespace_name;

2. 未使用的表空间大小

select tablespace_name,sum(bytes)/1024/1024 from dba_free_space

group by tab
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值