Fourth Lecture Oracle client tools

Oracle database after a successful installation, you can connect to Oracle through the Oracle client tools, the following are some commonly used Oracle client tools.

SQL Plus tool

The tool is a client tool that comes with Oracle systems installed by default. Enter the command line in Windows cmd "sqlplus" command, you can start the tool and the following diagram:

Enter Account: system and password to log in to the local database, as shown below:

 

SQL * Plus command-line tool

The command-line tool provides interactive capabilities and oracle database, can not connect to the local database, you can also connect to a remote database. Input "sqlplus / nolog" cmd in the command line to start the tool, as shown below:

 

 This time is really just launched a client process, you can connect to the database via the command line. input the command:

conn 用户名/密码@服务器连接字符串 as 连接身份 

例子: conn sys/****@ 127.0 . 0.1 : 1521 /orcl  as  sysdba

 Description: The connection capacity on behalf of the authority to change the database after the user connects to enjoy, oracle has three identity as follows:

sysdba:数据库管理员身份。权限:打开(关闭)数据库服务器、备份(恢复)数据库、日志功能、会话限制、数据库管理功能等。

例如:sys用户必须用sysdba才能登陆,system用户用普通用户就可以登陆。       
sysoper:数据库操作员身份 。权限:打开(关闭)数据库服务器、备份(恢复)数据库、日志功能、会话限制。
normal:普通用户。权限:操作该用户下的数据对象和数据查询,默认的身份是normal用户。

Configuring the local network service name

The above connection string to connect through the server database, we can also configure the network service name configuration wizard (Net Configuration Assistant) by the local client network, you can replace the above database connection string. If you have only one local database instance, you can not fill in the network service name to sign in.

提醒:既然使用ip地址的字符串即可连接数据库,为啥还要配置本地网络服务名,在开发过程当中我们经常使用测试环境,测试环境的数据库和正式环境会不一样,因此我们只需同一个服务名,通过切换改服务名对应的ip地址,即可达到环境的切换,而不需要修改程序代码。

Local network service name configuration is as follows:

Start Net Configuration Assistant. Select "Local Net Service Name Configuration" option. As shown below:

 

Click Next, fill in the service name (the name is a global service database Natori installation of Oracle data), as shown below:

 

Click Next, select network protocols, network protocols and database communications that is, the default selection TCP, as shown below:

 

Click Next, configure the ip address to connect to Oracle services, local can fill localhost / 127.0.0.1. Examples choose to install the database listen port port selection, usually the default is 1521. As shown below:

 

 Then click Next to log test, using a test system user and password, as shown below:

 

Finally, click Next, fill in the network service name, fill out the complete configuration database local network service name. As shown below:

 

Through SQLPLUS client test tool, connect to the database through the network service name, as follows, the test is successful.

 

PL/SQL Developer 工具

在实际Oracle的开发过程当中,经常会使用到一个第三方开发工具“PL/SQL Developer”,因为SQLPLUS开发过程当中操作相对比较麻烦,不具有友好的可视化操作,因此,使用“PL/SQL Developer”开发工具替代SQLPLUS来进行oracle数据库开发,他的运行也需要安装Oracle客户端软件,并且可以通过本地网络服务配置向导配置好网络服务名,可以使用服务名直接连接登录。如下:

Oracle服务

Oracle在window下安装完毕,会安装很多服务,如下图:

1、OracleService+服务名(ORCL):

该服务是Oracle数据库的基础,只有启动该服务才能正常使用Oracle数据库。

2、OracleOraDb11g_home1TNSlistener :

该服务为Oracle客户端提供监听程序的服务,只有启动该服务,本地的客户端程序才能通过监听连接到数据库,和数据库进行交互。

3、Oracle ORCL VSS Writer Service:

Oracle卷映射拷贝写入服务,VSS(Volume Shadow Copy Service)能够让存储基础设备(比如磁盘,阵列等)创建高保真的时间点映像,即映射拷贝(shadow copy)。它可以在多卷或者单个卷上创建映射拷贝,同时不会影响到系统的性能。(非必须启动)

4、OracleMTSRecoveryService:

服务端控制。该服务允许数据库充当一个微软事务服务器MTS、COM/COM+对象和分布式环境下的事务的资源管理器。(非必须启动)

5、 OracleOraDb11g_home1ClrAgent:

Oracle数据库 .NET扩展服务的一部分。 (非必须启动)

6、 OracleJobSchedulerORCL:

Oracle作业调度(定时器)服务,ORCL是Oracle实例标识。(非必须启动)

OracleService服务启动后,即可以操作数据库了,默认情况下Oracle数据库是启动状态,可以通过客户端SQLPLUS使用sys用户进行登录,通过命令行关闭Oracle数据库,命令如下:

 

数据库启动和关闭

OracleService服务启动后,即可以操作数据库了,默认情况下Oracle数据库是启动状态,可以通过客户端SQLPLUS使用sys用户进行登录,通过命令行关闭Oracle数据库,命令如下:

shutdown immediate

 

 重新启动Oracle数据库和实例,命令如下:

startup open

 

 

 


  

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/xiaohumeng/p/12130442.html