文章分类 - Oracle
摘要:1. 创建存储过程 存储过程中有些 sql 不能直接执行,使用 execute IMMEDIATE str_sql; 执行 -- 创建存储过程 CREATE OR REPLACE PROCEDURE PRO_ANALYZE_TABLE AS str_sql varchar2(2000); BEGIN
阅读全文
摘要:select * from user_tables;
阅读全文
摘要:alter table {表名} modify {字段名} varchar2({长度}); alter table MCH_REPORTCHANGERECORD modify REPORTDESCRIPTION varchar2(4000);
阅读全文
摘要:select table_name, column_name from user_cons_columns where constraint_name = '约束名称';// 查询表名和列名 select table_name, column_name from user_cons_columns
阅读全文
摘要:问题:公司的笔记本带回家后,连接不上了本地的数据库 解决方式 修改 listener.ora(D:\app\boeetech\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora) 修改 tnsnames.ora(D:\app\boeetech\pro
阅读全文
摘要:alter table {表名} add constraint {主键名} primary key ({字段名1}, {字段名2}, ...); alter table MCH_PRO_TPJ_COND add constraint PK_MCH_PRO_TPJ_COND primary key (
阅读全文
摘要:select column_name from user_col_comments where table_name = '{表名}'; select column_name from user_col_comments where table_name = 'FRIEND'; 注: 表名区分大小写
阅读全文
摘要:select wm_concat({字段名}) from {表名}; select name from friend; select wm_concat(name) from friend;
阅读全文
摘要:创建存储过程语句 create or replace PROCEDURE INSERT_FRIEND ( insertCount IN NUMBER ) AS BEGIN declare i int := 1; begin for i in 1..insertCount loop insert in
阅读全文
摘要:create user {用户名} identified by {密码}; grant connect,resource to {用户名}; grant unlimited tablespace to {用户名}; create user student identified by 123456;
阅读全文
摘要:可能原因: 其他的用户有相同名称的表 类的属性里使用了oracle的关键字 解决方式: 原因1:由于本人的其他用户是为了测试创建的,所有直接删除用户 drop user {用户名} cascade; 就解决了,如果是有用的用户,不能删除,就参考 https://blog.csdn.net/qq_24
阅读全文
摘要:查询所有序列:select * from user_sequences order by sequence_name; 修改某一序列的增量:alter sequence {序列名} increment by {增量}; alter sequence TASK_EVENT_ID_SEQ increme
阅读全文
摘要:> select * from dba_constraints where constraint_name = '外键名称';// 要有DBA权限 select * from user_constraints where constraint_name = '外键名称';// 不需要DBA权限 se
阅读全文
摘要:需求 迁移数据库到另一台服务器,有些表需要保留数据,有些表只需要表结构。 步骤: 查询逻辑目录 select * from dba_directories; 如果没有则进行创建 -- create directory {目录名} as '{物理地址}'; create directory wise_
阅读全文