I recently came to work at the company.After a brief understanding of the company's processes,I found that the database was very bad.Some of the databases that I studied in school before are sqlserver, and some increase,Delete, modify, check the basic operations,

These are things that happened a long time ago,Later, I spent most of my time learning compilation.Going backwards,In order to develop ourselves, we must lay the foundation for development.Of course a database is necessary,oracle does feel very strange to meAfter tossing in recent days,About understanding the installation of the oracle database,Simple configuration,After all, Xiaobai,In the future, we need to continue to make up for it.Here are some of my new and recent gains.

1. The first is the installation of oracle

For a software installation,In my impression,Looks like most software is very easy to install,Generally, the installation software will configure its own operating environment.Create and start some of the services you need,And create some keys in the registry,Wait, but when I installed oracle, it was not so smooth.I remember using the company's computer at the beginning of the installation (win7 Ultimate 64-bit, the configuration was okay,Assembly machine.. ), The first version I installed is win64_11gr2_database (at that time the 10 version was rarely used,It is useless) The version of 11g is shown below:

I believe that all installed are familiar with this interface,Click next directly:

The above interface we can choose according to our actual situation,If this is the first installation,Just choose the first one,

Click next:

There are two options for this.Is a desktop class,One is the server class,In fact, if you use it, you can choose the desktop class.It has no effect on future use (personal feeling).The configuration will be more detailed,You can choose this according to your actual situation.This time we will select the desktop class first.Click next:

The above are some locations of the database to be created,Character type,What type of database,Here I choose the enterprise version,Here you can follow the default,The thing to note is the administrative password,This password is the password for future logins to the database,Which is the password,This must be remembered,The user name used to log in with this password is system sys, and the passwords of these users are the passwords set by themselves.The format of this password can be entered at will,Although he will prompt that the rules are not met,But it can be ignored.This has no effect on people who are not particularly professional ourselves.Click next:

The above interface appears,We just need to wait for a while,If normal, this interface will appear:

Met this interface,We can just wait quietly,This takes a long time,This is most prone to errors,When I installed it, a lot of errors appeared here.The first is that a service is not responding or starting,Need to explain here,if oracle is running normally,The services that need to be started are these:

oracle orcl vss writer service, oracledbconsoleorcl, oraclejobschedulerorcl, oraclemtsrecoveryservice, oracleoradb11g_home1clragent, oracleoradb11g_home1tnslistener, oracleserviceorcl. Where oracledbconsoleorcl,

oraclemtsrecoveryservice, oracleoradb11g_home1tnslistener, oracleserviceorcl is automatically started by default,oraclejobschedulerorcl is automatically disabled by default,The rest defaults to

The meanings of these seven services are:

oracle orcl vss writer service:oracle volume map copy write service,vss (volume shadow copy service) enables storage infrastructure devices (such as disks,Arrays, etc.) to create high-fidelity point-in-time images,That is, shadow copy. It can create mapped copies on multiple volumes or on a single volume,It will not affect the system performance of the system.(Optional)

oracledbconsoleorcl:oracle database console service,orcl is the instance ID of oracle,The default instance is orcl. When running the enterprise manager (enterprise manager oem), this service needs to be started.(Optional)

oraclejobschedulerorcl:The oracle job scheduling (timer) service, orcl is the oracle instance ID.(Optional)

oraclemtsrecoveryservice:Server-side control.This service allows the database to act as a resource manager for MTS, com/com + objects and transactions in a distributed environment.(Optional)

oracleoradb11g_home1clragent:oracle database .net extension service part. (Optional)

oracleoradb11g_home1tnslistener:Listener service,Services are needed only if the database requires remote access.(No need to start,See below for more details).

oracleserviceorcl:The database service (database instance) is the core service of oracle.Is the basis for database startup, Only the service is started,oracle database can start normally.(Must be started)

So what services do you need to start during development?

For newbies,If you only use sql * plus that comes with oracle, you only need to start oracleserviceorcl.oracleoradb11g_home1tnslistener service must also be enabled.oracledbconsoleorcl must be enabled to enter web-based em,The remaining services are rarely used.

Manual operation.

Problem I encountered 1

The oracleoradb11g_home1tnslistener service sometimes fails to start during installation.This service depends on an executable file in the path e:\ app \ admin \ product \ 11.2.0 \ dbhome_2 \ bin \ tnslsnr

Sometimes this file is missing and the service does not run properly.

Problem I encountered 2:

oracleserviceorcl This service cannot be started normally,The reason is because the oracle.exe executable file that this service depends on cannot start normally,

We can click on this service,Looking at the property bureau, you can see that this service has some dependent files.My computer environment was wrong at the time,Caused this executable to not run properly,Finally reinstalled the system,Solved, sometimes it is because uninstalling the previously installed oracle is not completely caused,These points need to be considered when installation errors occur,I was tossing about these issues for several days.

If all the above installations are successful,Then the basic environment of your oracle database is already equipped,The following is the need to create a new user,Set the appropriate permissions,Some operations such as importing the corresponding database backup (.dmp file), creating table spaces, etc.In order to adapt to my needs, I would like to talk about some of my recent operations with some of my own actual operation processes:

If the installation is successful,Then you can open the database command interface and enter the corresponding database command (some people may ask where to enter the database command?In fact, for convenience, you can directly win + r enter cmd, enter the black box is the command line of windows interface,Enter sqlplus and you will be prompted to enter your user name. You can enter system, which is not case sensitive, before creating a new user.Then enter the password is the password set during installation,Then you will enter the command line interface of the database,

Now you can enter the corresponding database commands

The following operations are some of the basic operations I do when I use them:

Create the tablespace first(that is, make space for things)

--Create collection process library data table space

create tablespace hiip_def logging datafile "e:\ app \ admin \ oradata \ orcl \ hiip_def.dbf" size 64m autoextend on next 64m maxsize unlimited extent management local autoallocate;

--Create collection process library temporary table space

create temporary tablespace hiip_temp tempfile "e:\ app \ admin \ oradata \ orcl \ hiip_temp.dbf" size 64m autoextend on next 64m maxsize unlimited extent management local;

-Create collection process library user (create a new login user,It's like system, but you need to grant some permissions to this created user)

create user hiip identified by hiip
 default tablespace hiip_def
 temporary tablespace hiip_temp
 profile default
 quota unlimited on hiip_def;
-grant/revoke object privileges
grant select, insert, update, delete on sys.dba_jobs to hiip;
-grant/revoke role privileges
grant connect to hiip;
grant dba to hiip;
grant resource to hiip;
-grant/revoke system privileges
grant create database link to hiip;
grant force any transaction to hiip;
grant unlimited tablespace to hiip;
grant execute any procedure to hiip;
grant create any table to hiip;
grant select any table to hiip;
grant insert any table to hiip;
grant delete any table to hiip;
grant update any table to hiip;

One thing to note is that oracle commands must end with ";", otherwise an error will occur.

Here's how toImport a backup database file (.dmp) into the required database, here I talk about importing a database file into the user hiip

At first I did n’t know how to import it.Later I asked others,How to do that,Not in this command line,Open a new cmd window and enter the imp command

The interface for entering your username and password will appear.Enter the username hiip you just created, enter your password,You will be prompted if i want to import the corresponding database file,We can just type yes directly,Then enter the path of the database file to be imported into it,OK, enter, you can see the database file is being imported into the library.

The following is how to export the database file. That is the exp command, which is also executed under cmd. When exporting, you need to select the exported content.This can be chosen according to your own situation,You also need to enter the location and file name of the exported file.This input will be created afterwards,After the export is successful, the xx.dmp file will appear. This is the exported database file.

Some other operations of the database will continue to be familiar with later.

  • Previous Talking about the life cycle of cookies
  • Next Jquery implements the completion of the drop-down prompt function when entering the mailbox