文章分类 -  Oracle

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

点击右上角即可分享
微信分享提示