Home > Database > Mysql Tutorial > Oracle数据库随笔

Oracle数据库随笔

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:46:26
Original
1178 people have browsed it

1.安装 选高级选项即可 只安装数据库软件,不创建数据库2.创建数据 填写数据库名称和SID及密码 比如 数据库:orcl SID:orcl 密

1.安装
  选高级选项即可
  只安装数据库软件,,不创建数据库
2.创建数据
  填写数据库名称和SID及密码
  比如 数据库:orcl SID:orcl 密码:Oracle

3.创建用户并赋予权限
  在控制台中输入
  sqlplus /nolog
  sql> connect /as sysdba;
  sql> alter user test identified "123";
       也可(忘记密码也适用)
  sql> alter user test identified by 123; 
  sql> grant create session,resource to test;
  如果出现建立视图错误
  sql> grant resource,connect,dba by test;
 
4.监听
 windows&linux下命令

        lnsrctl start  启动监听
                  stop   关闭监听
                  status 查看监听状态
  windows&linux添加监听
 命令 netca

 linux下查看设置查看监听 netmgr
 
5.启动、关闭数据库
  控制台 sqlplus /nolog
  sql> connect /as sysdba;
  启动库
  sql> startup;
  关闭库
  sql> shutdown immediate;
 
5.连接数据库
  根据已有用户登录
  在控制台输入
  sqlplus test/123;
  即可登录

6.查看实例名
  sql> select instance_name,status from v$instance;
 
7.查看数据库中所有表
  sql> select * from tab;
 
8.用户解锁
  sql> alter user scott acount unlock;

9.备份数据库,也称逻辑备份
  在控制台中输入
  exp test/123@orcl file=c:\orcl.dmp rows=y owner=orcl

10.还原数据库
  imp test/123 file=c:\orcl.dmp fromuser=orcl touser=orcl

linux

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template