oracle 基础学习01----服务启动|语句定义|数据类型

本博客主要用于以后查询,错误肯定会有,欢迎各位大神指正。。。。。。


1. Oracle服务的启动

为了加快电脑的启动速度,在安装好oracle之后,在管理工具的服务选项之中,将oracle服务作为手动启动(oracleservice[sid]),当需要启动之时,再打开在服务之中打开即可,也可在控制台下使用netstart oracleserviceorcl 来启动oracle服务(net stoporacleserviceorcl来关闭服务)。

2.为了释放oracle运行时所占用的内存,而又不关闭oracle服务,可以只停止数据库实例,这种情况下可以使用sys权限进行操作,使用shutdownimmediate (连接方式为:控制台下使用sqlplus /nolog    然后使用 conn /as  sysdba连接)

3.oracle之中的监听服务:

   启动监听:lsnrctl start 

   关闭监听:lsnrctl stop

4.启动或者停止dbconsole服务

  启动dbconsole服务: emctl start dbconsole(emctl stop dbconsole)

5.启动和停止sql*plus

 isqlplusctl start|stop

 

6.oracle使用的pl编程方式,必须在专门的地方声明变量,在专门的地方进行流程的编码。使用方法:

      Declare 

       ----专门用来定义变量的区域

      Begin

          ----专门用来进行操作的区域。

      [ exception

         ----异常的处理操作

]

      End;

7.oracle基本数据类型:

Char(length):存储固定长度的字符串

Varchar2(length):存储可变长度的字符串

Number(p,s): 存储整数或者浮点数

Date: 存储日期和时间

Timestamp: 存储日期和时间,同时包含时区

Clob: 存储大的文本

Blob:存储二进制对象,如图形,视频,声音等

8.oracle基本流程操作:

   a.判断语句if

     if  条件 then  statement;

     end if;

     if  条件 then  statement;

     else  statement;

     end if;

   b.case语句

     case

       when 条件 then statement;

      when 条件 thenstatement;

      else  statement;

    end case;

   

    case 常量

    when  ‘a’ then statement;

    when  ‘b’ then statement;

    else statement;

    end case;

    c.循环结构

     loop循环结构:

      loop

        statement;

        exit  when 条件;

       ----可以添加statement

      end loop;

 

      when循环

      when  条件 loop

      statement;

      end loop;

 

      for循环

      for i in 1..100 loop

       statement;

      end loop;

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值