1.解锁账户:
默认的scott用户是被锁定的,先解锁就能登陆上了。 使用下面的语句解锁scott:
alter user scott account unlock;
解锁之后可能会要求你该密码:
alter user scott identified by tiger;
再登陆:
sqlplus scott/tiger
就能登陆了
Oracle锁定和解锁用户的命令
SQL> conn /as sysdba
已连接。
//scott 用户在没有设定tieger默认密码时,登陆不上
2. 创建表空间
Linux:
CREATE TABLESPACE "SSHE" DATAFILE '/home/oracle/app/oradata/orclSSHE.DBF' SIZE 10M AUTOEXTEND ON NEXT 10M MAXSIZE
UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
Windows:
CREATE TABLESPACE "SSHE" DATAFILE 'C:dev_environmentapporadataorclSSHE.DBF' SIZE 10M AUTOEXTEND ON NEXT 10M MAXSIZE
UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
3.创建用户与授权
create user sshe identified by 123456 default sshe;
grant connect,resource,dba to sshe;
commit;
4.oracle查询表中字段里数据是否有重复
查单个字段:
SELECT
TEST_NAME,
COUNT
(*)
FROM
T_TEST
GROUP
BY
TEST_NAME
HAVING
COUNT
(*) > 1;
查组合字段:
SELECT
TEST_NAME1,TEST_NAME2,
COUNT
(*)
FROM
T_TEST
GROUP
BY
TEST_NAME1,TEST_NAME2
HAVING
COUNT
(*) > 1;
5.