人人范文网 范文大全

oracle数据库使用总结

发布时间:2020-03-02 20:34:37 来源:范文大全 收藏本文 下载本文 手机版

Oracle数据库遇到问题与使用心得总结

一、快速得到存储过程运行的结果。 步骤方法:

1、在c://temp目录中得到存储过程调用的参数语句,然后复制。

2、在PL/SQL中打开Test Window窗口,粘贴复制的内容,然后在内容中如下图增加2个参数(r1和r2)。

3、在Test Window窗口的变量和类型中入下图那样设置增加的参数。

4、点Test Window窗口中的图标,等运行按钮亮起时,再点击运行按钮。

5、在Test Window窗口中值哪列点击就能查看运行存储过程的结果。

二、解决数据库弹出\"本地计算机上的OracleOraDb11g_home1TNSListener服务启动后停止。 某些服务在未由其他服务或程序使用时将自动停止\"问题。

分析原因:是因为数据库监听配置文件添加这句话(如下图),然后重启监听服务OracleOraDb11g_home1TNSListener就报上面的错误。

报错现象:接着打开”开始-》所有程序-》oracle_home-》Net Manager “程序发现不能配置监听程序 ;启动监听服务提示\"本地计算机上的OracleOraDb11g_home1TNSListener服务启动后停止。 某些服务在未由其他服务或程序使用时将自动停止\"信息

解决方法步骤:

1、删除这句话。

2、修改为

三、解决数据库提示“ora-12514 无监听程序处理”问题。

原因分析:数据库监听配置都好好,用sqlplus能正常连接数据库,但是用PL/SQL连接就报“ora-12514 无监听程序处理”错误。

1、找到数据库的安装目录文件下的listener.log文件(本人的监听文件放在D:\\orcl\\admin\\diag\\tnslsnr\\tzz\\listener\\trace目录),发现文件很大有几个G。

2、在cmd中输入如下命令

lsnrctl set log_status off;(暂停日志监控)

3、在cmd中通过输入“D:”进入D盘,然后通过 “cd orcl”进入D:\\orcl目录,一直到D:\\orcl\\admin\\diag\\tnslsnr\\tanzizi\\listener\\trace为止

4、再输入命令:copy listener.log listener.log.20150114 (复制文件)

5、输入命令:echo >listener.log (清空listener文件)

6、lsnrctl set log_status on;(启动日志监控)

四、oralce查询锁定进程和关闭window系统中的锁定进程

1、查询锁定进程语句: SELECT /*+ rule */ s.username, decode(l.type, \'TM\', \'TABLE LOCK\', \'TX\', \'ROW LOCK\', NULL) LOCK_LEVEL, o.owner, o.object_name, o.object_type, s.sid, s.serial#, s.terminal, s.machine, s.program, s.osuser FROM v$seion s, v$lock l, dba_objects o WHERE l.sid = s.sid AND l.id1 = o.object_id(+) AND s.username is NOT Null;

2、杀掉锁定的进程

alter system kill seion \'sid,serial#\'; 找到锁定进程对应的spid select a.SID,a.USERNAME,a.status,a.proce,b.SPID from v$seion a,v$proce b where a.PADDR=b.ADDR and a.sid=\'sid\';

4、在cmd中输入关闭锁定进程命令: orakill orcl spid;

五、oracle数据库中的jobs

1、查询所有的jobs select * from user_jobs;

2、查看怎在运行的jobs select * from dba_jobs_running;

六、数据库表空间增加空间

1、允许已存在的数据文件自动增长

ALTER DATABASE DATAFILE \'D:\\orcl\\admin\\oradata\\orcl\\APP03.DBF\' AUTOEXTEND ON NEXT 50M MAXSIZE 20480M; 手工改变已存在数据文件的大小

ALTER DATABASE DATAFILE \'D:\\orcl\\admin\\oradata\\orcl\\APP02.DBF\' RESIZE 20480M;

七、数据库服务器端数据的导出与导入(必须在数据库服务器端使用),导出和导入使用服务器端命令好处是速度快,不会出现空表不导出现象。

1、cmd

2、expdp kdcrm/1@orcl version=11.1.0.6.0 数据库名/数控密码@实例名 要导入数据库的版本号

(版本号一般是用在高版本数据库向低版本数据库导入数据。)

3、查看导出日志,根据日志找到导出文件

4、进入D:\\orcl\\admin\\admin\\orcl\\dpdump目录,把EXPDAT.DMP压缩下。

5、把压缩之后的文件从服务器拷入本地计算机。

6、找到本地计算机的安装目录下的D:\\orcl\\admin\\admin\\orcl\\dpdump文件夹,把压缩的文件解压到此地。

7、在本地计算机中输入cmd

8、在本地计算机创建表空间,通过PL/SQL工具用oracle数据库的系统管理员进入数据库。 CREATE TABLESPACE CMBC_PMS_TBS

LOGGING

DATAFILE \'D:\\orcl\\admin\\oradata\\orcl\\CMBC_PMS_TBS .ora\'

SIZE 100M AUTOEXTEND

ON NEXT 100M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT AUTO ;

-- Create the user create user CMBC_PMS identified by 1 default tablespace CMBC_PMS_TBS temporary tablespace TEMP profile DEFAULT paword expire; -- Grant/Revoke role privileges grant connect to CMBC_PMS; grant dba to CMBC_PMS; grant resource to CMBC_PMS; -- Grant/Revoke system privileges grant create any table to CMBC_PMS; grant create any view to CMBC_PMS; grant create database link to CMBC_PMS; grant create table to CMBC_PMS; grant debug connect seion to CMBC_PMS; grant drop any table to CMBC_PMS; grant select any table to CMBC_PMS; grant unlimited tablespace to CMBC_PMS;

CREATE TABLESPACE TS_CRM_01

LOGGING

DATAFILE \'D:\\orcl\\admin\\oradata\\orcl\\TS_CRM_01.dbf\'

SIZE 100M AUTOEXTEND

ON NEXT 100M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT AUTO ; CREATE TEMPORARY TABLESPACE ts_tmp_01

TEMPFILE \'D:\\orcl\\admin\\oradata\\orcl\\ts_tmp_01.dbf\'

SIZE 100M

AUTOEXTEND ON

NEXT 100M maxsize 2000M;

CREATE TABLESPACE TS_CC_01

LOGGING

DATAFILE \'D:\\orcl\\admin\\oradata\\orcl\\TS_CC_01.dbf\'

SIZE 100M AUTOEXTEND

ON NEXT 100M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT AUTO ;

CREATE TABLESPACE TS_TA_01

LOGGING

DATAFILE \'D:\\orcl\\admin\\oradata\\orcl\\TS_TA_01.dbf\'

SIZE 100M AUTOEXTEND

ON NEXT 100M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL

SEGMENT SPACE MANAGEMENT AUTO ;

--系统管理员

select * from dba_directories ; CREATE OR REPLACE DIRECTORY dir_crm_db AS \'D:\\orcl\\db_bak\'; --drop directory dir_crm_db; CREATE OR REPLACE DIRECTORY dir_dp AS \'D:\\orcl\\dp_bak\'; --drop directory dir_dp; CREATE OR REPLACE DIRECTORY expdp_dir AS \'D:\\orcl\\dir_bak\'; --drop directory expdp_dir;

9、在本地计算机创建用户,通过PL/SQL工具用oracle数据库的系统管理员进入数据库。 -- Create the user

create user KDCRM identified by 1

default tablespace TS_CRM_01

temporary tablespace TS_TMP_01

profile DEFAULT

paword expire; -- Grant/Revoke object privileges

grant select, insert, update, delete grant select, insert, update, delete KDCRM; grant select, insert, update, delete M; grant select, insert, update, delete CRM; grant select, insert, update, delete KDCRM; grant select, insert, update, delete REHOLD to KDCRM; grant select, insert, update, delete RM; grant select, insert, update, delete grant select, insert, update, delete NFO to KDCRM; grant select, insert, update, delete KDCRM; grant select, insert, update, delete KDCRM; grant select, insert, update, delete ACT to KDCRM; grant select, insert, update, delete ; grant select, insert, update, delete grant select, insert, update, delete CRM; grant select, insert, update, delete M;

on CMBC_PMS.BENEFIT to KDCRM; on CMBC_PMS.COLLATERAL_CONTRACT toon CMBC_PMS.ENTRUST_AGENCY to KDCRon CMBC_PMS.FINANCE_CONTRACT to KDon CMBC_PMS.FINANCE_COUNTERPARTY toon CMBC_PMS.FINANCE_COUNTERPARTY_SHAon CMBC_PMS.FINANCE_PROJECT to KDCon CMBC_PMS.FUND_RAISE to KDCRM; on CMBC_PMS.GENERAL_FINANCE_PROJECTIon CMBC_PMS.GUARANTEE_CONTRACT to on CMBC_PMS.INVESTMENT_ADVISER to on CMBC_PMS.INVESTMENT_ADVISER_CONTRon CMBC_PMS.KD_RIGHT_ROLE to KDCRMon CMBC_PMS.PMS_PROJECT to KDCRM; on CMBC_PMS.PMS_PROJECT_USER to KDon CMBC_PMS.SYS_BUSINESSNO to KDCRgrant select, insert, update, delete on CMBC_PMS.SYS_REPORTFIELD to KDCRM; grant select, insert, update, delete on CMBC_PMS.WF_BUSINESSDATA to KDCRM; grant select, insert, update, delete on CMBC_PMS.WF_ROLE_FLOW_AUTH to KDCRM; grant select, insert, update, delete on CMBC_PMS.WF_ROUGH_DRAFT to KDCRM; grant read, write on directory SYS.DIR_CRM_DB to KDCRM; grant execute, read, write on directory SYS.DIR_DP to KDCRM with t option; grant read, write on directory SYS.EXPDP_DIR to KDCRM; -- Grant/Revoke role privileges grant connect to KDCRM; grant dba to KDCRM; grant resource to KDCRM; -- Grant/Revoke system privileges grant create any table to KDCRM; grant create any view to KDCRM; grant create database link to KDCRM; grant create table to KDCRM; grant debug connect seion to KDCRM; grant drop any table to KDCRM; grant select any table to KDCRM; grant unlimited tablespace to KDCRM;

8、impdp kdcrm/1@orcl remap_schema=kdcrm:kdcrm dumpfile=EXPDAT.DMP 数据库名/密码@实例名 导出的数据库名:导入的数据库名 数据库备份文件名

gran

Oracle数据库使用心得

Oracle数据库总结

ORACLE数据库学习总结

Oracle数据库 知识点总结

Oracle数据库学习总结

Oracle数据库实验报告

Oracle数据库心得体会

ORACLE数据库工作总结

ORACLE数据库学习心得

oracle数据库实训总结

oracle数据库使用总结
《oracle数据库使用总结.doc》
将本文的Word文档下载到电脑,方便编辑。
推荐度:
点击下载文档
点击下载本文文档