查看数据库状态(普通用户登录要保证数据库是open状态)
SQL> select status from v$instance;
创建用户(新用户需要授予连接权限才能连上数据库)
SQL> create user user1 identified by redhat;
SQL> conn user1/redhat
ERROR:
ORA-01045: user USER1 lacks CREATE SESSION privilege; logon denied
Warning: You are no longer connected to ORACLE.
SQL>
SQL> show user
USER is ""
SQL> conn / as sysdba
Connected.
SQL>
SQL> grant connect to user1;
SQL> conn user1/redhat;
Connected.
SQL>
查看系统拥有哪些用户
SQL> select * from all_users;
执行sql文件(PATH表示文件的路径)
SQL> @PATH/filename.sql
测试sql语句执行时间
SQL>set timing on ;
查看当前数据库名
SQL> select name from v$database;