进入超级管理员,执行以下命令 |
Window下创建数据库,表空间,用户,插入数据等操作 |
-- 01 创建表空间 -- CREATE TABLESPACE ts_myscott LOGGING DATAFILE ‘F:/app/to-to/oradata/orcl/ts_myscott.dbf‘ SIZE 10M EXTENT MANAGEMENT LOCAL; CREATE TABLESPACE ts_myscott2 LOGGING DATAFILE ‘F:/app/to-to/oradata/orcl/ts_myscott2.dbf‘ SIZE 20M EXTENT MANAGEMENT LOCAL; ALTER DATABASE DATAFILE ‘F:/app/to-to/oradata/orcl//ts_myscott.dbf‘ AUTOEXTEND ON NEXT ALTER DATABASE DATAFILE ‘F:/app/to-to/oradata/orcl/ts_myscott2.dbf‘ AUTOEXTEND ON NEXT commit; -- 02 CREATE USER MYSCOTT IDENTIFIED BY MYSCOTT DEFAULT TABLESPACE USERS ACCOUNT UNLOCK; -- GRANT RESOURCE TO MYSCOTT; GRANT create session TO MYSCOTT; -- 03 -- CREATE TABLE MYSCOTT.DEPT( DEPTNO NUMBER(2) PRIMARY KEY, DNAME VARCHAR2(14) NOT NULL, LOC VARCHAR2(13) )TABLESPACE ts_myscott; INSERT INTO MYSCOTT.dept VALUES(10, ‘ACCOUNTING‘, ‘NEW YORK‘); INSERT INTO MYSCOTT.dept VALUES(20, ‘RESEARCH‘, ‘DALLAS‘); INSERT INTO MYSCOTT.dept VALUES(30, ‘SALES‘, ‘CHICAGO‘); INSERT INTO MYSCOTT.dept VALUES(40, ‘OPERATIONS‘, ‘BOSTON‘); commit; -- CREATE TABLE MYSCOTT.EMP( EMPNO NUMBER(4) constraint emp_empno_pk PRIMARY KEY, ENAME VARCHAR2(10) constraint emp_ename_notnull NOT NULL, JOB VARCHAR2(9), MGR NUMBER(4), HIREDATE DATE, SAL COMM NUMBER(7,2), DEPTNO NUMBER(2) constraint emp_deptno_fk references MYSCOTT.dept(deptno) )TABLESPACE ts_myscott; --创建索引 CREATE INSERT INTO MYSCOTT.EMP VALUES(7369, ‘SMITH‘, ‘CLERK‘, 7902, ‘17-12月-80‘, INSERT INTO MYSCOTT.EMP VALUES(7499, ‘ALLEN‘, ‘SALESMAN‘, 7698, ‘20-2月 INSERT INTO MYSCOTT.EMP VALUES(7521, ‘WARD‘, ‘SALESMAN‘, 7698, ‘22-2月 INSERT INTO MYSCOTT.EMP VALUES(7566, ‘JONES‘, ‘MANAGER‘, 7839, ‘02-4月 INSERT INTO MYSCOTT.EMP VALUES(7654, ‘MARTIN‘, ‘SALESMAN‘, 7698, ‘28-9月 INSERT INTO MYSCOTT.EMP VALUES(7698, ‘BLAKE‘, ‘MANAGER‘, 7839, ‘01-5月 INSERT INTO MYSCOTT.EMP VALUES(7782, ‘CLARK‘, ‘MANAGER‘, 7839, ‘09-6月 INSERT INTO MYSCOTT.EMP VALUES(7788, ‘SCOTT‘, ‘ANALYST‘, 7566, ‘19-4月 INSERT INTO MYSCOTT.EMP VALUES(7839, ‘KING‘, ‘PRESIDENT‘, NULL, ‘17-11月-81‘, INSERT INTO MYSCOTT.EMP VALUES(7844, ‘TURNER‘, ‘SALESMAN‘, 7698, ‘08-9月 INSERT INTO MYSCOTT.EMP VALUES(7876, ‘ADAMS‘, ‘CLERK‘, 7788, ‘23-5月 INSERT INTO MYSCOTT.EMP VALUES(7900, ‘JAMES‘, ‘CLERK‘, 7698, ‘03-12月-81‘, INSERT INTO MYSCOTT.EMP VALUES(7902, ‘FORD‘, ‘ANALYST‘, 7566, ‘03-12月-81‘, INSERT INTO MYSCOTT.EMP VALUES(7934, ‘MILLER‘, ‘CLERK‘, 7782, ‘23-1月 commit; -- CREATE TABLE MYSCOTT.SALGRADE( GRADE NUMBER, LOSAL NUMBER, HISAL NUMBER )TABLESPACE ts_myscott; INSERT INTO MYSCOTT.SALGRADE VALUES(1, 700, 1200); INSERT INTO MYSCOTT.SALGRADE VALUES(2, 1201, 1400); INSERT INTO MYSCOTT.SALGRADE VALUES(3, 1401, 2000); INSERT INTO MYSCOTT.SALGRADE VALUES(4, 2001, 3000); INSERT INTO MYSCOTT.SALGRADE VALUES(5, 3001, 9999); commit; --创建奖金表 CREATE TABLE MYSCOTT.BONUS( ENAME VARCHAR2(10), JOB VARCHAR2(9), SAL NUMBER, COMM NUMBER )TABLESPACE ts_myscott; ------停止----- -- 04创建新用户方案 CREATE USER "MYSCOTTUSER1" GRANT "CONNECT" TO "MYSCOTTUSER1"; GRANT SELECT ANY TABLE TO "MYSCOTTUSER1"; GRANT DELETE ON MYSCOTT.DEPT TO "MYSCOTTUSER1"; GRANT INSERT ON MYSCOTT.DEPT TO "MYSCOTTUSER1"; GRANT UPDATE ON MYSCOTT.DEPT TO "MYSCOTTUSER1"; GRANT DELETE ON MYSCOTT.EMP TO "MYSCOTTUSER1"; GRANT INSERT ON MYSCOTT.EMP TO "MYSCOTTUSER1"; GRANT UPDATE ON MYSCOTT.EMP TO "MYSCOTTUSER1"; commit; |
Linux下创建数据库,表空间,用户,插入数据等操作 |
-- 01 创建表空间 -- CREATE TABLESPACE ts_myscott LOGGING DATAFILE ‘/home/oracle_11/app/oradata/orcl/ts_myscott.dbf‘ SIZE 10M EXTENT MANAGEMENT LOCAL; CREATE TABLESPACE ts_myscott2 LOGGING DATAFILE ‘/home/oracle_11/app/oradata/orcl/ts_myscott2.dbf‘ SIZE 20M EXTENT MANAGEMENT LOCAL; ALTER DATABASE DATAFILE ‘/home/oracle_11/app/oradata/orcl/ts_myscott.dbf‘ AUTOEXTEND ON NEXT ALTER DATABASE DATAFILE ‘/home/oracle_11/app/oradata/orcl/ts_myscott2.dbf‘ AUTOEXTEND ON NEXT commit; -- 02 CREATE USER MYSCOTT IDENTIFIED BY MYSCOTT DEFAULT TABLESPACE USERS ACCOUNT UNLOCK; -- GRANT RESOURCE TO MYSCOTT; GRANT create session TO MYSCOTT; -- 03 -- CREATE TABLE MYSCOTT.DEPT( DEPTNO NUMBER(2) PRIMARY KEY, DNAME VARCHAR2(14) NOT NULL, LOC VARCHAR2(13) )TABLESPACE ts_myscott; INSERT INTO MYSCOTT.dept VALUES(10, ‘ACCOUNTING‘, ‘NEW YORK‘); INSERT INTO MYSCOTT.dept VALUES(20, ‘RESEARCH‘, ‘DALLAS‘); INSERT INTO MYSCOTT.dept VALUES(30, ‘SALES‘, ‘CHICAGO‘); INSERT INTO MYSCOTT.dept VALUES(40, ‘OPERATIONS‘, ‘BOSTON‘); commit; -- CREATE TABLE MYSCOTT.EMP( EMPNO NUMBER(4) constraint emp_empno_pk PRIMARY KEY, ENAME VARCHAR2(10) constraint emp_ename_notnull NOT NULL, JOB VARCHAR2(9), MGR NUMBER(4), HIREDATE DATE, SAL COMM NUMBER(7,2), DEPTNO NUMBER(2) constraint emp_deptno_fk references MYSCOTT.dept(deptno) )TABLESPACE ts_myscott; --创建索引 CREATE INSERT INTO MYSCOTT.EMP VALUES(7369, ‘SMITH‘, ‘CLERK‘, 7902, ‘17-12月-80‘, INSERT INTO MYSCOTT.EMP VALUES(7499, ‘ALLEN‘, ‘SALESMAN‘, 7698, ‘20-2月 INSERT INTO MYSCOTT.EMP VALUES(7521, ‘WARD‘, ‘SALESMAN‘, 7698, ‘22-2月 INSERT INTO MYSCOTT.EMP VALUES(7566, ‘JONES‘, ‘MANAGER‘, 7839, ‘02-4月 INSERT INTO MYSCOTT.EMP VALUES(7654, ‘MARTIN‘, ‘SALESMAN‘, 7698, ‘28-9月 INSERT INTO MYSCOTT.EMP VALUES(7698, ‘BLAKE‘, ‘MANAGER‘, 7839, ‘01-5月 INSERT INTO MYSCOTT.EMP VALUES(7782, ‘CLARK‘, ‘MANAGER‘, 7839, ‘09-6月 INSERT INTO MYSCOTT.EMP VALUES(7788, ‘SCOTT‘, ‘ANALYST‘, 7566, ‘19-4月 INSERT INTO MYSCOTT.EMP VALUES(7839, ‘KING‘, ‘PRESIDENT‘, NULL, ‘17-11月-81‘, INSERT INTO MYSCOTT.EMP VALUES(7844, ‘TURNER‘, ‘SALESMAN‘, 7698, ‘08-9月 INSERT INTO MYSCOTT.EMP VALUES(7876, ‘ADAMS‘, ‘CLERK‘, 7788, ‘23-5月 INSERT INTO MYSCOTT.EMP VALUES(7900, ‘JAMES‘, ‘CLERK‘, 7698, ‘03-12月-81‘, INSERT INTO MYSCOTT.EMP VALUES(7902, ‘FORD‘, ‘ANALYST‘, 7566, ‘03-12月-81‘, INSERT INTO MYSCOTT.EMP VALUES(7934, ‘MILLER‘, ‘CLERK‘, 7782, ‘23-1月 commit; -- CREATE TABLE MYSCOTT.SALGRADE( GRADE NUMBER, LOSAL NUMBER, HISAL NUMBER )TABLESPACE ts_myscott; INSERT INTO MYSCOTT.SALGRADE VALUES(1, 700, 1200); INSERT INTO MYSCOTT.SALGRADE VALUES(2, 1201, 1400); INSERT INTO MYSCOTT.SALGRADE VALUES(3, 1401, 2000); INSERT INTO MYSCOTT.SALGRADE VALUES(4, 2001, 3000); INSERT INTO MYSCOTT.SALGRADE VALUES(5, 3001, 9999); commit; --创建奖金表 CREATE TABLE MYSCOTT.BONUS( ENAME VARCHAR2(10), JOB VARCHAR2(9), SAL NUMBER, COMM NUMBER )TABLESPACE ts_myscott; ------停止----- -- 04创建新用户方案 CREATE USER "MYSCOTTUSER1" GRANT "CONNECT" TO "MYSCOTTUSER1"; GRANT SELECT ANY TABLE TO "MYSCOTTUSER1"; GRANT DELETE ON MYSCOTT.DEPT TO "MYSCOTTUSER1"; GRANT INSERT ON MYSCOTT.DEPT TO "MYSCOTTUSER1"; GRANT UPDATE ON MYSCOTT.DEPT TO "MYSCOTTUSER1"; GRANT DELETE ON MYSCOTT.EMP TO "MYSCOTTUSER1"; GRANT INSERT ON MYSCOTT.EMP TO "MYSCOTTUSER1"; GRANT UPDATE ON MYSCOTT.EMP TO "MYSCOTTUSER1"; commit; |
4.windows和Linux下创建oracle用户名表空间,表,插入数据,用户管理表等操作
时间: 2024-10-02 12:58:47
4.windows和Linux下创建oracle用户名表空间,表,插入数据,用户管理表等操作的相关文章
linux下安装Oracle时交换空间不足的解决方法
摘:linux下安装Oracle时交换空间不足的解决方法 linux上安装Oracle时交换空间不足的解决办法 增加交换空间有两种方法: 严格的说,在系统安装完后只有一种方法可以增加swap,那就是本文的第二种方法, 至于第一种方法应该是安装系统时设置交换区. 1.使用分区: 在安装OS时划分出专门的交换分区,空间大小要事先规划好,启动系统时自动进行mount. 这种方法只能在安装OS时设定,一旦设定好不容易改变,除非重装系统. 2.使用swapfile:(或者是整个空闲分区) 新建临时swap
linux下创建oracle表空间
来自:http://blog.sina.com.cn/s/blog_62192aed01018aep.html 1 . 登录服务器 2 . 查看磁盘空间是否够大df -h -h更具目前磁盘空间和使用情况 以更易读的方式显示 [[email protected] ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 2.9G 2.3G 521M 82% / none 209M 0 209M 0% /dev/shm /dev/s
4.windows和Linux下创建oracleusername表空间,表,插入数据,用户管理表等操作
进入超级管理员,运行下面命令 Window下创建数据库.表空间,用户,插入数据等操作 -- 01 创建表空间 -- 注意表空间的路径 依据实际安装环境进行调整 CREATE TABLESPACE ts_myscott LOGGING DATAFILE 'F:/app/to-to/oradata/orcl/ts_myscott.dbf' SIZE 10M EXTENT MANAGEMENT LOCAL; CREATE TABLESPACE ts_myscott2 LOGGING DATAFILE
linux系统下创建oracle表空间和用户权限查询
创建用户和表空间: 1.登录linux,以oracle用户登录(如果是root用户登录的,登录后用 su - oracle命令切换成oracle用户) 2.以sysdba方式来打开sqlplus,命令如下: sqlplus / as sysdba 3.创建临时表空间: --查询临时表空间文件的绝对路径.如果需要的话,可以通过查询来写定绝对路径.一般用${ORACLE_HOME}就可以了 select name from v$tempfile; create temporary tablespac
Windows 和 Linux下使用socket下载网页页面内容(可设置接收/发送超时)的代码
主要难点在于设置recv()与send()的超时时间,具体要注意的事项,请看代码注释部分,下面是代码: [cpp] view plaincopyprint? #include <stdio.h> #include <sys/types.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <string.h> #ifdef _WIN32 ///
Linux下安装Oracle 12c数据库
(1)Linux下安装Oracle 安装前注意:1.确保/etc/hosts中有系统主机名的记录 2.Linux系统安装图形化界面 3.OFA(最佳灵活体系结构):/字母数字/标准名字/用户名,如/u01/app/oracle 步骤:1.创建Oracle用户和/u01目录,并将/u01的所有者和所属组修改为此用户: 2.将软件复制到/u01,之后unzip解压,使用创建的用户运行runInstaller安装: (注:(1)如果报DISPLAY未定义执行:export DISPLAY=:0.0和x
【大话QT之五】Windows与Linux下文件操作监控的实现
一.需求分析: 随着渲染业务的不断进行,数据传输渐渐成为影响业务时间最大的因素.究其原因就是因为数据传输耗费较长的时间.于是,依托于渲染业务的网盘开发逐渐成为迫切需要解决的需求.该网盘的实现和当前市场上网盘实现有一些的不同,主要在客户端与服务器端的操作需要双向进行,即:用户在客户端的操作需要及时同步到服务器端:在服务器端作业渲染生成的文件要及时同步到客户端.即:用户不在需要单独的下载数据,而是在作业运行的同时,渲染就过就会自动同步到客户端,大大缩短了等待时间.当然,无论是在客户端还是在服务端都面
socket在windows下和linux下的区别
windows到Linux代码移植遇到的问题 1.一些常用函数的移植 http://www.vckbase.com/document/viewdoc/?id=1586 2.网络 ------ 转载 & 修改(待整理) socket相关程序从windows移植到linux下需要注意的 1)头文件 windows下winsock.h/winsock2.h linux下sys/socket.h 错误处理:errno.h 2)初始化 windows下需要用WSAStartup linux下不需要 3)关
linux下安装oracle需要的配置
1.检查系统包安装情况 rpm -qa|grep binutils rpm -ivh sysstat-7.0.2.rpm binutils-2.17.50.0.6 compat-libstdc++-33-3.2.3 compat-libstdc++-33-3.2.3 (32 bit) elfutils-libelf-0.125 elfutils-libelf-devel-0.125 gcc-4.1.2 gcc-c++-4.1.2 glibc-2.5-24 glibc-2.5-24 (32 bit