查看Oracle数据库状态
如何查看Oracle数据库实例状态?
set oracle_sid=你要查询的实例service名称
sqlplus / as sysdba
SQL>select status from v$instance;
06 | select * from v$bgprocess; |
07 | select * from v$bgprocess where paddr<> '00' ; |
10 | select * from v$controlfile; |
11 | select * from v$datafile; |
12 | select * from v$logfile; |
17 | show parameter db_cache |
20 | alter system set db_cache_size=64m; //可以动态修改sga中内存区的大小,但是不能超过sga的最大内存 |
26 | DATAFILE 'D:\oracle\oradata\APTECH\tbs2_01.dbf' |
29 | conn sys/admin as sysdba(重启数据库必须以sys用户登陆) |
31 | shutdown immediate(关闭数据库) |
34 | alter database mount;(装载数据库,读取控制文件) |
35 | alter database open ;(打开数据库,对数据文件,日志文件进行一致性校验) |
41 | IDENTIFIED BY martinpwd |
42 | DEFAULT TABLESPACE USERS |
43 | TEMPORARY TABLESPACE TEMP ; |
46 | GRANT CONNECT TO MARTIN; |
47 | GRANT RESOURCE TO MARTIN; |
50 | GRANT CREATE SESSION TO MARTIN; |
52 | GRANT CREATE TABLE TO MARTIN; |
54 | GRANT CREATE VIEW TO MARTIN; |
56 | GRANT CREATE SEQUENCE TO MARTIN; |
58 | GRANT CREATE SEQUENCE TO MARTIN; |
59 | GRANT SELECT ON TEST TO MARTIN; |
60 | GRANT ALL ON TEST TO MARTIN; |
64 | QUOTA UNLIMITED ON USERS; |
67 | ALTER USER MARTIN IDENTIFIED BY martinpass; |
70 | 在sql*plus中直接输入 password 命令即可 |
73 | DROP USER MARTIN CASCADE ; |
76 | select USERNAME,USER_ID,DEFAULT_TABLESPACE,TEMPORARY_TABLESPACE |
78 | where username = 'MARTIN' ; |