linux oracle 常用命令

#----------------------------------------------- #登入开发机 #----------------------------------------------- ssh [email protected] #数据库导出 export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK export f1=`date +%Y%m%d%H%M`.dmp expdp /'sys/pwd@orcl as sysdba/' directory=DATA_PUMP_DIR dumpfile=$f1 schemas=hs_aws_sa3 reuse_dumpfiles=true #复制到dump 到 hs-db scp /home/oa/oracle/admin/orcl/dpdump/$f1 [email protected]:/home/oracle/admin/hsoa/dpdump/imp.dmp #登出开发机 Ctrl + D #----------------------------------------------- #登入 hs-web #----------------------------------------------- ssh [email protected] # 备份 plugs tar -czvf /home/backup/plugs_`date +%Y%m%d%H%M`.tgz /home/hs_aws_system/bin/plugs/ # 复制 plugs java 包 到 hs-web scp -r [email protected]:/home/oa/hs_aws_system/bin/plugs /home/hs_aws_system/bin/plugs #备份表单 tar -czvf /home/backup/eform_html`date +%Y%m%d%H%M`_bak.tgz /home/hs_aws_system/template/eform/html # 复制 表单 到 hs-web scp -r [email protected]:/home/oa/hs_aws_system/template/eform/html /home/hs_aws_system/template/eform/html #登出hs-web Ctrl + D #------------------------------------------------- #登入 hs-db #------------------------------------------------ ssh [email protected] #备份 export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK export f2=exp_`date +%Y%m%d%H%M`.bak expdp /'sys/pwd@hsoa as sysdba/' directory=DATA_PUMP_DIR dumpfile=$f2 schemas=hs_aws_sa reuse_dumpfiles=true mv /home/oracle/admin/hsoa/dpdump/$f2 /home/oracle/backup/ #sqlplus 登入数据库 sqlplus sys/pwd@hsoa as sysdba #删除表空间 Drop TableSpace hs_aws_ts including contents and datafiles; #创建表空间 CREATE SMALLFILE TABLESPACE "HS_AWS_TS" DATAFILE '/home/oracle/oradata/hsoa/hs_aws_ts.dbf' SIZE 100M REUSE AUTOEXTEND ON NEXT 1024K MAXSIZE 32767M LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO; #导入 export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK impdp /'sys/pwd@hsoa as sysdba/' directory=DATA_PUMP_DIR dumpfile=imp.dmp schemas=hs_aws_sa3 REMAP_SCHEMA=hs_aws_sa3:hs_aws_sa  

 

dbca 命令 :管理 oracle 实例 .

删除 oracle 实例,通过删相应安装目录,还应删 /etc/oratab 文件,每个安装实例都会在这个文件里记录的。

你可能感兴趣的:(oracle,linux,Date,数据库,schema,logging)