Skip to main content

moregeek program

oracle数据文件导入导出-多极客编程

数据文件导出

在个人电脑中,打开cmd窗口,进入oracle安装目录oracle/product/10.1.0/Db_1/BIN
使用命令export 命令



数据文件导入

在个人电脑中,打开cmd窗口,进入oracle安装目录oracle/product/10.1.0/Db_1/BIN
使用命令Imp命令,Imp file=文件路径 userid=usr/passwd@IP地址 full=yes ignore=yes;
imp file=/home/oracle/confluence.dmp full=yes   然后提示输入要导入的用户名和密码。

数据导出:
1 将数据库TEST完全导出,用户名system 密码manager 导出到D:\daochu.dmp中
  exp system/manager@TEST file=d:\daochu.dmp full=y
2 将数据库中system用户与sys用户的表导出
  exp system/manager@TEST file=d:\daochu.dmp owner=(system,sys)
3 将数据库中的表table1 、table2导出
  exp system/manager@TEST file=d:\daochu.dmp tables=(table1,table2)
4 将数据库中的表table1中的字段filed1以"00"打头的数据导出
  exp system/manager@TEST file=d:\daochu.dmp tables=(table1) query=\" where filed1 like '00%'\"

    上面是常用的导出,对于压缩我不太在意,用winzip把dmp文件可以很好的压缩。
 不过在上面命令后面 加上 compress=y  就可以了

数据的导入:
1 将D:\daochu.dmp 中的数据导入 TEST数据库中。
  imp system/manager@TEST  file=d:\daochu.dmp
  上面可能有点问题,因为有的表已经存在,然后它就报错,对该表就不进行导入。
  在后面加上 ignore=y 就可以了。
2 将d:\daochu.dmp中的表table1 导入
imp system/manager@TEST  file=d:\daochu.dmp  tables=(table1)

注意事项:导出dmp数据时需要有导出表的权限的用户,否则不能导出。


oracle两个数据库间数据同步-多极客编程

公司所有测试服务器都有两套,所以两套测试数据库之间的数据同步,显得尤为重要:假设数据库A 和 B,现要求如果A中数据有更新,则同时更新B数据库首先一下所有操作都在A中进行:(1)在A中建立到B的DBlink,create public databASE link testconnect to user identified by "passwd" using 'test'; (2)在A中建立syn

利用oracle快照dblink解决数据库表同步-多极客编程

1、在目的数据库上,创建dblinkdrop public database link dblink_orc92_182;Create public DATABASE LINK dblink_orc92_182 CONNECT TO bst114 IDENTIFIED BY password USING ''orc92_192.168.254.111'';--dblink_orc92_182 是d

oracle中dblink的相关应用-多极客编程

--建立dblinkcreate database link AP connect to user identified by passwd using 'orcl' --查询dblink对应的sidselect * from global_name@AP --查询所有dblink纪录select * from dba_objects where object_type='DATABASE LIN

oracle数据库当前和最大连接数-多极客编程

1、查询oracle的连接数select count(*) from v$session;2、查询oracle的并发连接数select count(*) from v$session where status='ACTIVE';3、查看不同用户的连接数select username,count(username) from v$session where username is not null

oracle基础-多极客编程

ORALCE_BASE 数据库地址ORACLE_HOME 数据库软件存放地址cd @ORACLE_BASE 可直接进入路径selecet username from dba_users;  和select * from all_users;的区别建用户前先建立表空间create tablespace testtab datafile ‘@ORACLE_BASE/testtab.dbf' size

oracle开机自动启动-多极客编程

1.安装好Oracle数据库后: 执行 dbstart和dbshut会提示:[oracle@oracle11g ~]$ dbstartORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net ListenerUsage: /u01/app/oracle/oracle/product/10.2.0/db_1/bin/dbstart