学习oracle
下载oracle网址http://www.oracle.com/technetwork/index.html 根据你的机型选择下载安装不同版本,首先你得注册一个oracle账户才能下载。 官网EX Edition是学习免费用的。 我的电脑是64位所以选择了一下版本。 解压安装(1) (2) (3) (4) 我安装的在D盘空间足够大 (5)输入口令随意取自己,但要自己记住哦,我输入的是1234 (6)安装 (7) 配置oracle(1)启动 2)sqlplus 连接数据库用户system 密码1234(前边设置的) 1. 建立表空间和用户的步骤: 2. 用户 3. 建立:createuser用户名identifiedby"密码"; 4. 授权:grantcreatesessionto用户名; 5. grantcreatetableto用户名; 6. grantcreatetablespaceto用户名; 7. grantcreateviewto用户名; 例如: 建立:create user myuseridentified by "password"; 授权:grant createsession to myuser; grant create table tomyuser; grant create tablespace tomyuser; grant create view to myuser; grantconnect,resourcetomyuser; grantcreateanysequencetomyuser; grantdeleteanytabletomyuser; grantinsertanytabletomyuser; grantselectanytabletomyuser; grantunlimitedtablespacetomyuser; grantexecuteanyproceduretomyuser; grantupdateanytabletomyuser; 1. 表空间 2. 建立表空间(一般建N个存数据的表空间和一个索引空间): 3. createtablespace表空间名 4. datafile'路径(要先建好路径)***.dbf'size*M 5. tempfile'路径***.dbf'size*M 6. autoextendon--自动增长 7. --还有一些定义大小的命令,看需要 8. defaultstorage( 9. initial100K, 10.next100k, 11.);
例子:创建表空间 create tablespace DEMOSPACE datafile'D:softoracleapporacleoradataoracle_tablespacesDEMOSPACE_TBSPACE.dbf'size 1500M autoextend on next 5M maxsize 3000M; 删除表空间 drop tablespace DEMOSPACE including contentsand datafiles
重新登录 使用创建的用户登录 使用plsql配置tns LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) 安装plsql 配置oci 登录 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |