Basic knowledge of Oracle database entry

Source: Internet
Author: User
Tags file copy reserved sqlplus

1, after the installation of the Oracle database, using the Sqlplus client login to the database management system, enter only the user name, no password is entered, the password will be blank, login is denied.

Please enter user name: System

Enter Password:

ERROR:ORA-01005: Give null password: Login denied

2. When you are not logged in to the Oracle database system, use this command (Sys/nolog) to log in, prompting the following error.

Please enter user name: Sys/nolog

ERROR:

Ora-01017:invalid Username/password; Logon denied//invalid user name/password, login denied

3. Log in to the Oracle database system with the correct user name password (username/password @sid)

Please enter user name: System/[email protected]

Connect to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the partitioning, OLAP, Data Mining and Real application testing options

Sql>

4. After logging into the database system, you can view the currently logged in user account

Sql>show user;

User is "SYSTEM"//Displays the currently logged on users

5. View Oracle database So the user's status

Sql> select Username,account_status from Dba_users;

USERNAME Account_status

------------------------------ --------------------------------

SYS OPEN

SYSTEM OPEN

Dbsnmp OPEN

Sysman OPEN

Mgmt_view LOCKED

Outln EXPIRED & LOCKED

Flows_files EXPIRED & LOCKED

Mdsys EXPIRED & LOCKED

Ordsys EXPIRED & LOCKED

Exfsys EXPIRED & LOCKED

Wmsys EXPIRED & LOCKED

USERNAME Account_status

------------------------------ --------------------------------

Appqossys EXPIRED & LOCKED

apex_030200 EXPIRED & LOCKED

Owbsys_audit EXPIRED & LOCKED

Orddata EXPIRED & LOCKED

Ctxsys EXPIRED & LOCKED

ANONYMOUS EXPIRED & LOCKED

XDB EXPIRED & LOCKED

Ordplugins EXPIRED & LOCKED

Owbsys EXPIRED & LOCKED

Si_informtn_schema EXPIRED & LOCKED

Olapsys EXPIRED & LOCKED

USERNAME Account_status

------------------------------ --------------------------------

SCOTT EXPIRED & LOCKED

ORACLE_OCM EXPIRED & LOCKED

Xs$null EXPIRED & LOCKED

Mddata EXPIRED & LOCKED

DIP EXPIRED & LOCKED

Apex_public_user EXPIRED & LOCKED

SPATIAL_CSW_ADMIN_USR EXPIRED & LOCKED

SPATIAL_WFS_ADMIN_USR EXPIRED & LOCKED

30 rows have been selected.

Description of Dbsnmp and Sysman:--from official documents

Dbsnmp

Dbsnmp

Default password

The account used by the Management Agent component of Oracle Enterprise Manager to monitor and manage the database
Account used by the management agent component of Oracle Enterprise Manager to monitor and manage databases

Sysman

Change_on_install

Default password

The account used to perform Oracle Enterprise Manager database administration tasks. Note that SYS and SYSTEM can also perform these tasks.
Account is used to perform Oracle Enterprise Manager database administration tasks. It is important to note that SYS and system can also perform these tasks.

6. Backing up the database with Rman

1, switch server archiving mode, if it is already an archive mode can skip this step:

%sqlplus/nolog (Start Sqlplus)

sql> conn/as SYSDBA (database connected as DBA)

sql> shutdown immediate; (Close database Now)

Sql> Startup Mount (launches the instance and loads the database but does not open)

sql> ALTER DATABASE Archivelog; (Change database to archive mode)

sql> ALTER DATABASE open; (Open database)

Sql> alter system archive log start; (Enable automatic archiving)

Sql> exit (Exit)

1. Run the cmd command on the Start menu:

Microsoft Windows [version 6.1.7601]

Copyright (c) Microsoft Corporation. All rights reserved.

C:\users\administrator> Sqlplus/nolog

Sql*plus:release 11.2.0.1.0 Production on Friday May 29 10:35:41 2015

Copyright (c) 1982, Oracle. All rights reserved.

Sql> Conn/as SYSDBA

is connected.

sql> shutdown immediate;

The database is closed.

The database has been uninstalled.

The ORACLE routine has been closed.

Sql> Startup Mount

The ORACLE routine has been started.

Total System Global area 1068937216 bytes

Fixed Size 2182592 bytes

Variable Size 633340480 bytes

Database buffers 427819008 bytes

Redo buffers 5595136 bytes

The database is loaded.

sql> ALTER DATABASE Archivelog;

The database has changed.

sql> ALTER DATABASE open;

The database has changed.

Sql> alter system archive log start;

The system has changed.

Sql>exit

From Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production

With the partitioning, OLAP, Data Mining and Real application testing options Disconnect

2. Connection:

Rman Target=sys/[email protected]; (Start Recovery Manager)

Continue to enter the Rman command in the launch command box

C:\users\administrator>rman Target=sys/[email protected];

Recovery manager: Release 11.2.0.1.0-production on Friday May 29 10:52:49 2015

Copyright (c) 1982, the Oracle and/or its affiliates. All rights reserved.

Connect to target database: ORCL (dbid=1408432054)

Rman>

3. Basic settings:

Rman> Configure default device type to disk; (Set the default backup device to disk)

Rman> Configure device type disk parallelism 2; (Set the parallel level of backup, number of channels)

Rman> Configure Channel 1 device type disk fromat '/backup1/backup_%u '; (Set the file format for backup, only for disk devices)

Rman> Configure Channel 2 device type disk Fromat '/backup2/backup_%u '; (Set the file format for backup, only for disk devices)

Rman> Configure Controlfile autobackup on; (Open automatic backup of control file and server parameter file)

Rman> Configure Controlfile autobackup format for device type disk to '/backup1/ctl_%f '; (Set file format for automatic backup of control files and server parameters files)

4. View all settings:

Rman> Show All

5. View the database Schema report:

Rman> Report schema;

6. Back up the whole library:

Rman> BACKUP database plus archivelog delete input; (Back up all libraries and control files, server parameter files and all archived redo logs, and delete old archive logs)

7. Backup Table Space:

Rman> backup tablespace system plus archivelog Delete input; (Back up the specified tablespace and archived redo logs, and delete the old archive log)

8. Backup Archive log:

rman> Backup Archivelog all delete input;

9. Copy data file:

rman> copy datafile 1 to '/oracle/dbs/system.copy ';

10. View backup and file copy:

rman> list backup;

11. Verify Backup:

Rman> Validate Backupset 3;

12. Recover Server parameter files from automatic backup:

rman> shutdown immediate; (Close database Now)

rman> startup Nomount; (Launch instance)

rman> restore SPFile to Pfile '/backup1/mydb.ora ' from autobackup; (Recover server parameter files from automatic backup) 13. Recover control files from automated backups:

rman> shutdown immediate; (Close database Now)

rman> startup Nomount; (Launch instance)

rman> restore Controlfile to '/backup1 ' from autobackup; (Recover control files from automated backups)

13. Recovery and recovery of the full database:

rman> shutdown immediate; (Close database Now)

Rman> exit (Exit)

%mv/oracle/dbs/tbs_12.f/oracle/dbs/tbs_12.bak (renaming the data file)

%mv/oracle/dbs/tbs_13.f/oracle/dbs/tbs_13.bak (renaming the data file)

%mv/oracle/dbs/tbs_14.f/oracle/dbs/tbs_14.bak (renaming the data file)

%mv/oracle/dbs/tbs_15.f/oracle/dbs/tbs_15.bak (renaming the data file)

%rman Target=rman/[email protected] (Start Recovery manager)

rman> startup Pfile=/oracle/admin/mydb/pfile/initmydb.ora (Specify initialization parameter file to start the database)

rman> Restore Database; (Restore Database)

rman> Recover database; (Recover database)

rman> ALTER DATABASE open; (Open database)

14. Recovery and recovery table space:

Rman> SQL ' alter tablespace users offline immediate '; (Take table space offline)

Rman> exit (Exit Recovery Manager)

%mv/oracle/dbs/users01.dbf/oracle/dbs/users01.bak (renaming tablespace)

%rman Target=rman/[email protected] (Start Recovery manager)

rman> restore tablespace users; (Restore table space)

rman> Recover tablespace users; (Recover table space)

Rman> SQL ' alter tablespace users online '; (Bring table space online)

Rman> Configure default device type to disk;

Using the target database control file instead of recovering the directory

New RMAN configuration parameters:

CONFIGURE DEFAULT DEVICE TYPE to DISK;

The new RMAN configuration parameters have been successfully stored

Rman> Configure device type disk parallelism 2;

New RMAN configuration parameters:

CONFIGURE DEVICE type DISK PARALLELISM 2 BACKUP type to BACKUPSET;

The new RMAN configuration parameters have been successfully stored

Rman> Configure Channel 1 device type disk fromat ' c:/backup1/backup_%u ';

New RMAN configuration parameters:

CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/backup1/backup_%u ';

The new RMAN configuration parameters have been successfully stored

Rman> Configure Channel 2 device type disk format '/backup2/backup_%u ';

New RMAN configuration parameters:

CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/backup2/backup_%u ';

The new RMAN configuration parameters have been successfully stored

Rman> Configure Controlfile autobackup on;

Old RMAN configuration parameters:

CONFIGURE controlfile autobackup OFF;

New RMAN configuration parameters:

CONFIGURE Controlfile autobackup on;

The new RMAN configuration parameters have been successfully stored

Rman> Configure Controlfile autobackup format for device type disk to '/backup1/ctl_%f ';

Old RMAN configuration parameters:

CONFIGURE controlfile autobackup FORMAT for DEVICE TYPE DISK to '%F ';

New RMAN configuration parameters:

CONFIGURE controlfile autobackup FORMAT for DEVICE TYPE DISK to '/backup1/ctl_%f ';

The new RMAN configuration parameters have been successfully stored

Rman> Show All;

The RMAN configuration parameters for the database db_unique_name for ORCL are:

CONFIGURE RETENTION POLICY to redundancy 1;

CONFIGURE BACKUP optimization OFF;

CONFIGURE DEFAULT DEVICE TYPE to DISK;

CONFIGURE Controlfile autobackup on;

CONFIGURE controlfile autobackup FORMAT for DEVICE TYPE DISK to '/backup1/ctl_%f ';

CONFIGURE DEVICE type DISK PARALLELISM 2 BACKUP type to BACKUPSET;

CONFIGURE datafile BACKUP COPIES for DEVICE TYPE DISK to 1;

CONFIGURE ARCHIVELOG BACKUP COPIES for DEVICE TYPE DISK to 1;

CONFIGURE CHANNEL 2 DEVICE TYPE DISK FORMAT '/backup2/backup_%u ';

CONFIGURE CHANNEL 1 DEVICE TYPE DISK FORMAT '/backup1/backup_%u ';

CONFIGURE maxsetsize to UNLIMITED;

CONFIGURE encryption for DATABASE OFF;

CONFIGURE encryption algorithm ' AES128 ';

CONFIGURE COMPRESSION algorithm ' BASIC ' as of RELEASE ' DEFAULT ' OPTIMIZE for LOA

D TRUE; # Default

CONFIGURE ARCHIVELOG deletion POLICY to NONE;

CONFIGURE SNAPSHOT controlfile NAME to ' C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHO

Me_1\database\sncforcl. ORA ';

Rman> Report schema;

Db_unique_name database schema report for the ORCL database

Permanent data File List

===========================

File Size (MB) tablespace fallback segment data file name

---- -------- -------------------- ------- ------------------------

1 680 SYSTEM * * * C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYS

TEM01. Dbf

2 490 Sysaux * * * C:\APP\ADMINISTRATOR\ORADATA\ORCL\SYS

AUX01. Dbf

3 UNDOTBS1 * * * C:\APP\ADMINISTRATOR\ORADATA\ORCL\UND

OTBS01. Dbf

4 5 USERS * * * C:\APP\ADMINISTRATOR\ORADATA\ORCL\USE

RS01. Dbf

Temporary file list

=======================

File size (MB) table space maximum size (MB) temp file name

---- -------- -------------------- ----------- --------------------

1 TEMP 32767 C:\APP\ADMINISTRATOR\ORADATA\ORCL\TEMP01. Dbf

Rman>

Basic knowledge of Oracle database entry

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.