一.基础SQL语句
- 查:select * from employees;
- 增:insert into employees (Name , Birthday , Location , Salary) values (‘hyddd’,’1984-10-1′,’guangzhou’,999999);
- 改:update employees set Salary=999999999 where Name=’hyddd’;
- 删:delete from employees where name=’zhangsan’;
更多技巧请参考:SQL基本语句
二.PFile,SPFile管理
- SPFile->PFile:
-
##用生成对应SID的spfile生成pfile,生成的pfile位置:$ORACLE_HOME/dbs/init$ORACLE_SID.ora
SQL> create pfile from spfile;
–——
##自己指定生成文件的位置
SQL> create pfile=‘/home/oracle/initorcl.ora‘ from spfile;
-
SQL> create spfile from pfile;
三.启动,关闭数据库
- 启动
-
SQL>startup
-
- 关闭
-
SQL>shutdown normal
SQL>shutdown transactional
SQL>shutdown immediate
SQL>shutdown abort
四.修改SGA参数
- 修改SGA的原则
- sga_target <= sga_max_size
- SGA加上PGA等其他进程占用的内存必须少于机器物理内存。
- 命令
-
SQL>alter system set sga_max_size=2048m scope=spfile;
SQL>alter system set sga_target=2048m scope=spfile;
##修改SGA的相关参数,只能spfile,然后重启数据库。不能直接scope=both!
-
五.查询Oracle配置参数
- 命令
-
SQL>show parameter;
-
- 具体查询某个Oracle参数,只需输入部分关键字即可,比如:查询sga_target的值。
-
SQL> show parameter sga;
NAME TYPE VALUE
–———————————- ———– ——————————
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 2G
sga_target big integer 2G
SQL>
-


Recent Comments