/*登入*/
C:>sqlplus /nolog;
...
SQL> conn /as sysdba;(本地数据库)
SQL> conn user/passwd;(切换用户用)
/*创建一个和已经存在的表列名和类型相同的空表*/
create table table_bak
as select * from table where 1<>1;
/*解决ora-28001 the password has expired问题*/
1,用sysdba用户登录
2,查看账户信息,select username,account_status from dba_users;
3,如果账户是locked/expired先解锁
alter user USERNAME account unlock;
再修改密码:
alter user USERNAME identified by NEWPASSWORD;
/*Oracle实例*/
oracle的运行结构是:操作系统-->oracle程序-->实例,也就是说一个操作系统下可以创建多个实例,每个实例都有自己的内存结构和进程调度,所以与sqlserver不完全相同。
默认实例:oracle选择默认安装时会创建一个orcl实例
/*创建序列*/
create sequence 序列名 increment by 1 start with 100;
/*删除序列*/
drop sequence 序列名;
/*修改表名*/
rename tablename to tablename1;
/*删除表的主键*/
alter table 表名 drop constraint 主键名;