2、sqlplus /nolog 或sqlplus system/manager 或./sqlplus system/manager@ora9i;
3、SQL>connect / as sysdba ;(as sysoper)或
connect internal/oracle AS SYSDBA ;(scott/tiger)
conn sys/change_on_install as sysdba;
4、SQL>startup; 启动数据库实例
5、查看当前的所有数据库: select * from v$database;
select name from v$database;
6、desc v$databases; 查看数据库结构字段
7、怎样查看哪些用户拥有SYSDBA、SYSOPER权限:
SQL>select * from V_$PWFILE_USERS;
Show user;查看当前数据库连接用户
8、进入test数据库:database test;
9、查看所有的数据库实例:select * from v$instance;
如:ora9i
10、查看当前库的所有数据表:
SQL> select TABLE_NAME from all_tables;
select * from all_tables;
SQL> select table_name from all_tables where table_name like '%u%';
TABLE_NAME
------------------------------
_default_auditing_options_
11、查看表结构:desc all_tables;
12、显示CQI.T_BBS_XUSER的所有字段结构:
desc CQI.T_BBS_XUSER;
13、获得CQI.T_BBS_XUSER表中的记录:
select * from CQI.T_BBS_XUSER;
14、增加数据库用户:(test11/test)
create user test11 identified by test default tablespace users Temporary TABLESPACE Temp;
15、用户授权:
grant connect,resource,dba to test11;
grant sysdba to test11;
commit;
16、更改数据库用户的密码:(将sys与system的密码改为test.)
alter user sys indentified by test;
alter user system indentified by test;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)