Common backup Import and Export commands for self-organized Oracle Database Operations

Source: Internet
Author: User

The local development environment is win2003 + vs2005 + Oracle9i

Testing site environment: win2003 + IIS + Oracle10g

The password of the local development database account oracleusera orclepassworda and the database name oracledatabasenamea

Test the database account oracleuserb password orclepasswordb and database name oracledatabasenameb.

 

-- Create a database connection (F:/Oracle/ora92/Network/admin/tnsnames. ora) with the following content:

# Tnsnames. ora network configuration file: F:/Oracle/ora92/Network/admin/tnsnames. ora
# Generated by Oracle configuration tools.

Oracledatabasenamea =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = Local Computer Name) (Port = 1521 ))
)
(CONNECT_DATA =
(Server = dedicated)
(SERVICE_NAME = oracledatabasenamea)
)
)

 

Oracledatabasenameb =
(Description =
(Address_list =
(Address = (Protocol = TCP) (host = test site IP address) (Port = 1521 ))
)
(CONNECT_DATA =
(Server = dedicated)
(SERVICE_NAME = oracledatabasenameb)
)
)

 

 

-- Import the test site database to the database in the Local Development Environment

Step 1. Export the database backup file of the test site
Exp oracleuserb/oraclepasswordb @ oracledatabasenameb file = C: oracleuserboracleuserboracledatabasenameb_201010121016.dmp
Step 2. Create and authorize a user
Select Start Menu -- run and Enter cmd
D:/Documents and Settings/Administrator> sqlplus
User Name System
Password Manager

Delete existing users
Drop user oracleusera cascade;
The data table corresponding to the user is deleted when the user is deleted.
Create user
SQL> create user oracleusera identified by oraclepassworda;
SQL> grant DBA to oracleusera;
SQL> quit;
D:/Documents and Settings/Administrator>

Step 3. Import the local backup file to the local database
IMP oracleusera/oraclepassworda @ oracledatabasenamea file = C: oracleuserboracleuserboracledatabasenameb_201010121016.dmp fromuser = oracleuserb

Touser = oracleusera

-- Import the database from the local development environment to the database of the test site

Step 1. Export the corresponding database file of the Local Development Environment
Exp oracleusera/oraclepassworda @ oracledatabasenamea file = C: oracleuseraoracleuseraoracledatabasenamea_201010121016.dmp

Step 2. Back up the database file of the test site
Exp oracleuserb/oraclepasswordb @ oracledatabasenameb file = C: oracleuserboracleuserboracledatabasenameb_20101010121335.dmp

Step 3. Import the local development environment database to the test site database
IMP oracleuserb/oraclepasswordb @ oracledatabasenameb file = C: oracleuseraoracleuseraoracledatabasenamea_201010121016.dmp fromuser = oracleusera

Touser = oracleuserb

 

-- Organize the operation information when you forget your password

D:/Documents and Settings/Administrator> sqlplus/As sysdba

SQL> alter user system identified by manager;

SQL> alter user SYS identified by change_on_install;

The initial password after Oracle 8i is installed:

Internal/Oracle

Sys/change_on_install

System/Manager

Scott/Tiger

Sysman/oem_temp

The initial password after Oracle 9i is installed:
Username/password logon identity description
 
Sys/change_on_install sysdba or sysoper cannot log on normally. It can be used as the default system administrator.
 
System/manager sysdba or normal cannot log on with sysoper, which can be used as the default system administrator

Sysman/oem_temp sysman is the username Scott/Tiger of OMS.
 
Normal normal user

Aqadm/aqadm sysdba or normal senior queue Administrator

Dbsnmp/Dbsnmp sysdba or normal replication Administrator

 

Command to clear Oracle cache:
1. in Oracle9i, Oracle provides an internal event to force refresh the buffer cache. Syntax:
Alter session set events 'immediate trace name flush_cache level 1 ';
2. For sessions, the syntax is:
Alter session set events = 'immediate trace name flush_cache ';
3. For the entire system, the syntax is:
Alter system set events = 'immediate trace name flush_cache ';
 

 

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.