Oracle 10g Database Installation and configuration tutorial _oracle

Source: Internet
Author: User
Tags dba oracle database sqlplus

The Oracle installation configuration tutorial is shared with you for your reference, the details are as follows

1, installation

Oracle version: Oracle DatabaseG Release 2 (10.2.0.1)

Download Address:

Http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201winsoft.html

Installation settings:

1 The global database name here is the name of the database you created, in the future, when accessing the data, creating a "local net service name";

2 The database password is used in places such as logging in and creating a "local Net service name".

2, create "Local Net service name"

1 run the Network Configuration Assistant tool through the "program"-"oracle-oradb10g_home1"-"configuration and Migration Tool"-"Net Configuration Assistant":

2 Select "Local Net Service name Configuration":

3 Here "Net Service Name" We enter the "Global database name" When installing the database:

4 Host Name We enter the IP address of this machine:

5 test database connection, username/password: system/database password ("Database password" entered at installation):


Default username/Password Error:

Change login and enter the correct username/password:

Test success:

3. Plsql Developer Connection Test

Enter the correct username/password:

Successful login:

Database

4. Create a table space

Open the Sqlplus tool: Sqlplus/nolog

Connection database: Conn/ as Sysdba

To create a table space:

Create tablespace camds datafile ' D:\oracle\product\10.2.\oradata\camds\camds.dbf ' size 200m Autoextend on next 10m MaxSize Unlimited;

5. Create New user

Run the p/l SQL Developer tool and log on as DBA (user name: System):

1) New User:

2 Set user name, password, default tablespace (using the new table space above) and temporary tablespace:

3) Set role permissions:

4 Set "System Permissions":

5 Click to apply, the "Apply" button dimmed, the new user to create success:

6 New User Login test:

Enter user name/password for new user:

New user "Testcamds" successfully logged in:

6. Import Export Database

Run cmd command first, go to command line mode, go to the following directory: D:\oracle\product\10.2.0\db_1\BIN "There are exp.exe files under this directory"

1) Import

Command syntax: Imp userid/pwd@sid file=path/file fromuser=testcamds Touser=userid

Command instance: Imp testcamds/123@camds file=c:\testcamds fromuser=testcamds Touser=testcamds

Import Results:

2) Export:

Command syntax: Exp USERID/PWD@SID file=path/file Owner=userid

Command instance: Exp Testcamds/123@camdsora File=c:\testcamds Owner=testcamds

Import Results:

//Creating temporary tablespace create temporary tablespace zfmi_temp tempfile ' D:\oracle\oradata\zfmi\zfmi_ 

temp.dbf ' size 32m autoextend on next 32m maxsize 2048m extent management local; Tempfile parameter must have//create datasheet space created tablespace zfmi logging datafile ' D:\oracle\oradata\zfmi\zfmi.dbf ' size 100m aut 

Oextend on next 32m maxsize 2048m extent management local; 

The datafile parameter must have//remove the user and all the user objects drop ZFMI cascade; The cascade parameter is cascading deletes all objects for that user often encountered if the user has an object without this parameter will not be deleted by the user, so the habitual add this parameter//delete table space premise: Before you delete the tablespace to confirm that the tablespace is not used by other users before deleting the drop 

Tablespace ZFMI including contents and datafiles cascade; Including contents deletes the contents of the tablespace, if there is content in the tablespace before the table space is deleted, and the table space is not deleted, so the habitual addition of this parameter//including datafiles delete the data file in the Tablespace//cascade Constraints deletes a foreign key reference to the table in Tablespace 

If you delete tablespace files before you delete them, you can resolve:
If you delete the data file for the table space before you clear the table space, the database will not start and shut down properly.
You can recover by using the following method (this method has been validated in oracle9i):
In the following procedure, filename is a data file that has been deleted, and if there are more than one, it needs to be executed multiple times; Tablespace_name is the name of the corresponding table space.

$ sqlplus/nolog 
sql> conn/as sysdba; 
If the database is already started, you need to first execute the following line: 
sql> shutdown abort 
sql> startup Mount 
sql> ALTER DATABASE datafile ' filename ' offline drop; 
sql> ALTER DATABASE open; 
Sql> drop tablespace tablespace_name including contents; 

Creates a user and specifies the table space create user 

Zfmi identified by ZFMI 
default tablespace zfmi temporary tablespace zfmi_temp; 

The identified by parameter must have 


//grant all permissions to the message user's DBA role, 

Grant DBA to ZFMI; 


Grant permissions to the user grant 

Connect,resource to ZFMI; (DB2: Specify all permissions) 

Import Export command:
Oracle Data Import Export IMP/EXP is equivalent to Oracle data restore and backup. The EXP command can export data from a remote database server to a local DMP file, and IMP commands the DMP file to be imported locally into a distant database server. With this feature, you can build two identical databases, one for testing and one for formal use.

Execution environment: can be executed in SQLPLUS.EXE or DOS (command line),
DOS can be performed because the install directory Ora81bin in Oracle 8i is set to the global path,
There are EXP.EXE and IMP.EXE files under this directory that are used to perform import export.
Oracle is written in Java, Sqlplus. EXE, EXP. EXE, IMP. EXE these two files may be packaged after the class file.
Sqlplus. EXE call EXP.EXE, IMP. EXE package, complete the import and export function.

An instance of an import export is described below. &NBSP
Data export:  
1 Exports the database test completely, and the user Name System Password Manager is exported to d:daochu.dmp  
    exp system/manager@test file=d:daochu.dmp full=y 
2 Exports the table of system users and SYS users in the database  
   exp system/manager@test file=d:daochu.dmp owner= (System,sys)  
3 to Inner_ tables in the database Notify, Notify_staff_relat export  
    exp AICHANNEL/AICHANNEL@TESTDB2 file= D: Datanewsmgnt.dmp tables= (Inner_notify,notify_staff_relat)  
4 Export the fields in the table table1 in the database to the data that starts with "00" &NBSP
    exp system/manager@test file=d:daochu.dmp tables= (table1) query= "where filed1 like ' 0% '" &NBSP

The above is commonly used for export, for compression, both with WinZip to DMP file can be very good compression.
You can also implement it by adding Compress=y to the command below.
Import of data
1 Import the data from D:DAOCHU.DMP into the test database.
Imp system/manager@test file=d:daochu.dmp
Imp aichannel/aichannel@hust full=y file=d:datanewsmgnt.dmp ignore=y
There may be something wrong with it, because some tables already exist, and then it complains, and the table is not imported.
Just add ignore=y to the back.
2 Import the table table1 in D:daochu.dmp
Imp system/manager@test file=d:daochu.dmp tables= (table1)
Basically, the import export above is sufficient. In many cases, you should first delete the table completely and then import it.

Attention:
The operator must have sufficient permissions, and the permission is not sufficient for it to prompt.
Database can be connected to. You can use tnsping test to get the database test to connect.

Appendix I:
Actions to increase user access to import data
First, start sql*puls
Second, to System/manager landing
Third, create user username identified by password (if you have already created a user, this step can be omitted)
Four, GRANT create User,drop user,alter USER, create any VIEW,
DROP any view,exp_full_database,imp_full_database,
Dba,connect,resource,create Session to User name
V, run-cmd-into the directory where the DMP file resides,
Imp Userid=system/manager full=y file=*.dmp
or imp Userid=system/manager full=y file=filename.dmp
To Execute the example:
F:workoracle_databackup>imp userid=test/test full=y file=inner_notify.dmp
Screen display
Import:release 8.1.7.0.0-production on Thursday February 16 16:50:05 2006
(c) Copyright to Oracle Corporation. All rights reserved.
Connect to: Oracle8i Enterprise Edition Release 8.1.7.0.0-production
With the partitioning option
Jserver Release 8.1.7.0.0-production
To export a file created by export:v08.01.07 through a regular path
Import in the ZHS16GBK character set and ZHS16GBK NCHAR character set has been completed
The export server uses the UTF8 NCHAR character set (possible ncharset conversions)
. Importing Aichannel objects to Aichannel
. . Importing table "Inner_notify" 4 rows are imported
Ready to enable constraints ...
The import was successfully terminated, but a warning appears.

Appendix II:
Oracle does not allow direct changes to the owner of the table, using Export/import to achieve this.
First set up Import9.par,
Then, when used, the commands are as follows: Imp Parfile=/filepath/import9.par
Examples of Import9.par are as follows:
Fromuser=tgpms
TOUSER=TGPMS2 (Note: The user who changes the table owner from Fromuser to Touser,fromuser and Touser can be different)
Rows=y
Indexes=y
Grants=y
Constraints=y
buffer=409600
File==/backup/ctgpc_20030623.dmp
Log==/backup/import_20030623.log

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.