zoukankan      html  css  js  c++  java
  • Oracle

    (1) 在oracle中,如果需要执行多条相同的语句,可以通过ping语句实现,例如:在user_obejects表中有多张表的表名存在列OBJECT_NAME中,此时通过以下语句:

    SELECT 'grant select,update on user_name1.'||object_name||' to user_name;' from user_objects where  OBJECT_TYPE in ('TABLE' ,'VIEW')

    (2) 创建用户:

    create user user_name1 identified by "password"
    default tablespace tablespace_name
    temporary tablespace temporarytable_name
    profile DEFAULT;

    (3) 给对象赋权:-- Grant/Revoke object privileges 

    grant connect to user_name1;
    grant resource to user_name1;

    grant select,update on user_name.table_name to user_name1

    (4) oracle用户不区分大小写,密码区分大小写;

    (5) 日期范围的查询(oracle中用to_date函数进行日期转换,由于SQL不区分大小写,因此分钟用mi表示,mm代表月份,另外凡是以24小时的形式显示日期的需要使用HH24):

     select * from table_name
             where dates 
             between
             to_date('2015-08-12 10:00:00', 'yyyy-mm-dd hh24:mi:ss')
             and
             to_date('2015-09-12 10:00:00', 'yyyy-mm-dd hh24:mi:ss')

    (6) 打开PL developer,在所有对象下拉框中,有时会出现无法下拉查看对象的情况,此时通过:select * from user_objects可以查看到所有的用户对象,包括DB link,Table,Procedure,view或者Index.

  • 相关阅读:
    B/S 和 C/S
    SQL 注入
    软件测试
    Spring的注解方式
    测试开发题目
    策略模式
    设计模式
    单例模式
    读写文件
    对List里的对象元素进行排序
  • 原文地址:https://www.cnblogs.com/roseHLF/p/oraclehlf.html
Copyright © 2011-2022 走看看