本地开发环境为WIN2003+VS2005+Oracle9i
测试站点环境为WIN2003+IIS+Oracle10G
本地开发数据库帐号OracleUserA密码OrclePasswordA和数据库名OracleDataBaseNameA
测试站点数据库帐号OracleUserB密码OrclePasswordB和数据库名OracleDataBaseNameB
--建立数据库连接(F:/oracle/ora92/network/admin/tnsnames.ora)内容如下
# TNSNAMES.ORA Network Configuration File: F:/oracle/ora92/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
OracleDataBaseNameA=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 本地电脑名称)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = OracleDataBaseNameA)
)
)
OracleDataBaseNameB=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 测试站点IP地址)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = OracleDataBaseNameB)
)
)
--从测试站点数据库导入到本地开发环境中的数据库中
步骤1.先导出测试站点数据库备份文件
exp OracleUserB/OraclePasswordB@OracleDataBaseNameB file=c:OracleUserBOracleUserBOracleDataBaseNameB_20101010121016.dmp
步骤2.创建用户并授权
选择开始菜单--运行输入cmd
D:/Documents and Settings/Administrator>SQLPLUS
用户名 system
密码Manager
删除已有用户
drop user OracleUserA cascade;
删除用户时就删除了用户对应的数据表资料
创建用户
SQL>create user OracleUserA IDENTIFIED BY OraclePasswordA;
SQL>GRANT DBA TO OracleUserA;
SQL>quit;
D:/Documents and Settings/Administrator>
步骤3.从本地备份文件导入到本地数据库中
imp OracleUserA/OraclePasswordA@OracleDataBaseNameA file=c:OracleUserBOracleUserBOracleDataBaseNameB_20101010121016.dmp fromuser=OracleUserB
touser=OracleUserA
--从本地开发环境中导入数据库到测试站点数据库中
步骤1.先导出本地开发环境的对应数据库文件
exp OracleUserA/OraclePasswordA@OracleDataBaseNameA file=c:OracleUserAOracleUserAOracleDataBaseNameA_20101010121016.dmp
步骤2.备份测试站点数据库文件
exp OracleUserB/OraclePasswordB@OracleDataBaseNameB file=c:OracleUserBOracleUserBOracleDataBaseNameB_20101010121335.dmp
步骤3.导入本地开发环境数据库到测试站点数据库中
imp OracleUserB/OraclePasswordB@OracleDataBaseNameB file=c:OracleUserAOracleUserAOracleDataBaseNameA_20101010121016.dmp fromuser=OracleUserA
touser=OracleUserB
--忘记安装密码时候的操作资料整理
D:/Documents and Settings/Administrator>sqlplus / as sysdba
SQL>alter user system identified by manager;
SQL>alter user sys identified by change_on_install;
Oracle 8i安装完成后的初始口令:
internal/oracle
sys/change_on_install
system/manager
scott/tiger
sysman/oem_temp
Oracle 9i安装完成后的初始口令:
用户名/密码 登录身份 说明
sys/change_on_install SYSDBA或SYSOPER 不能以NORMAL登录,可作为默认的系统管理员
system/manager SYSDBA或NORMAL 不能以SYSOPER登录,可作为默认的系统管理员
sysman/oem_temp sysman 为oms的用户名 scott/tiger
NORMAL 普通用户
aqadm /aqadm SYSDBA或NORMAL 高级队列管理员
Dbsnmp/dbsnmp SYSDBA或NORMAL 复制管理员
清除Oracle缓存命令:
1、在Oracle9i里,Oracle提供了一个内部事件,用以强制刷新Buffer Cache,语法为:
alter session set events 'immediate trace name flush_cache level 1';
2、针对session,语法为:
alter session set events = 'immediate trace name flush_cache';
3、针对整个系统,语法为:
alter system set events = 'immediate trace name flush_cache';