SQL*Plus FAQ
What is SQL*Plus and where does it come from?
SQL*Plus is a command line SQL and PL/SQL language interface and reporting tool that ships with the Oracle Database Client and Server software. It can be used interactively or driven from scripts. SQL*Plus is frequently used by DBAs and Developers to interact with the Oracle database.
If you are familiar with other databases, sqlplus is equivalent to:
"sql" in Ingres,
"isql" in Sybase and SQL Server,
"sqlcmd" in Microsoft SQL Server,
"db2" in IBM DB2,
"psql" in PostgreSQL, and
"mysql" in MySQL.
SQL*Plus's predecessor was called UFI (User Friendly Interface). UFI was included in the first Oracle releases up to Oracle 4. The UFI interface was extremely primitive and, in today's terms, anything but user friendly. If a statement was entered incorrectly, UFI issued an error and rolled back the entire transaction (ugggh).
How does one use the SQL*Plus utility?
Start using SQL*Plus by executing the "sqlplus" command-line utility from the $ORACLE_HOME/bin directory. Some of the command line options:
userid/password@db -- Connection details
/nolog -- Do not login to Oracle. You will need to do it yourself.
-s or -silent -- start sqlplus in silent mode. Not recommended for beginners!
@myscript -- Start executing script called "myscript.sql"
Look at this example session:
sqlplus /nolog
SQL> connect scott/tiger
SQL> select * from tab;
SQL> disconnect
SQL> exit
Please note that one must prepare the environment before starting sqlplus.
Linux/ Unix example:
$ . oraenv
ORACLE_SID = [orcl] ? orcl
$ sqlplus scott/tiger
Windows Example:
Click on "Start" -> "Run" and enter "cmd"
C:> set ORACLE_SID=orcl
C:> sqlplus scott/tiger
or...
C:> sqlplus scott/tiger@orcl
What commands can be executed from SQL*
相关文档:
SQL自动异地备份方法
方法一:
mssql数据库远程备份的job
/*在远程机器操作系统的计算机管理里建立一个用户名为kyle的用户,密码为1234,同时在那台机器的非系统盘里建一个名为backup的共享文件夹,为了安全另外设置这个文件夹只有这个kyle用户可以访问。*/
declare @sql varchar(500)
select @sql='\\10.2. ......
当修改了登录密码时,当启动mssqlserver的时候会出现error 1069, means logon error. 这是由于一下2个原因1.sqlserver的密码没有同步的原因,需要在administrator tools ->services-> right click mssqlserver -> property-> logon tab -> change passward to new one . 2.sqlserver的启动用户不对,需要在a ......
导入的详细流程
1、新建一个数据库
2、在新的数据库上点右键-》“所有任务”-》“导入数据库”,点下一步
3、什么都不要改,在数据库中选择那个旧的数据库,点下一步
4、在这个界面的数据库中选择你新建的数据库,点下一步
5、选择“在SQL SERVER数据库之间复制对象和数据”,点下一步
......
--都写了 参考下吧
通常,你需要获得当前日期和计算一些其他的日期,例如,你的程序可能需要判断一个月的第一天或者最后一天。你们大部分人大概都知道怎样把日期进行分割(年、月、日等),然后仅仅用分割出来的年、月、日等放在几个函数中计算出自己所需要的日期!在这篇文章里,我将告诉你如何使用DATEADD和DATEDIFF函数 ......