您的位置:首页 > 数据库 > Oracle

oracle数据库学习 (上)

2016-02-20 14:21 549 查看
一、oracle 数据库的卸载 oracle11g以后有一个便利的卸载工具 安装目录下 的 \product\11.2.0\dbhome_\deinstall 文件夹下的deintall.bat 文件 打开即可卸载

二、系统用户(常用) sys 、 system 、scott

sys 默认密码:change_on_install 登录身份:SYSDBA 或 SYSOPER

system默认密码:manager 登录身份:SYSDBA 或 NORMAL

scott默认密码:tiger 登录身份:NORMAL

三、SQL*PLUS的使用

【Oracle的sql*plus是与oracle进行交互的客户端工具,借助sql*plus可以查看、修改数据库记录。在sql*plus中,可以运行sql*plus命令与sql语句。】

1、使用sys 或system登录

[username/passworld] [@serer] [as sysdba|sysoper]

例:system/密码

connect sys/密码 as sysdba

2、scott用户登录(scott用户是锁定的需要解锁)

先用system用户登录 用户名为:system 口令为:密码

scott 解锁 alter user scott account unlock;

切换用户为scott connect scott/tiger

3、查看用户

show user

4、表空间

创建表空间 create temporary tablespace tablespace_name tempfile|datafile 'xxxx.dbf' size xx;

修改表空间状态 alter tablespace test1_tablespace

online 联机状态 offline 脱机状态

修改表空间读写 alert tablespace teblespace_name read only|read write (默认状态读写)

修改数据文件

增加数据文件
alert tablespace tablespace_name

add datafile 'file_name.dbf' size 10m;

删除数据文件 alert tablespace tablespace_name

drop datafile 'file_name.dbf' size 10m;

删除表空间
drop tablespace tablespace_name including contents;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: