Oracle for Sun Solaris Maintenance Manual

xiaoxiao2021-03-06  16

Oracle maintenance work mainly with the database; uses exp, Imp command to make a logical backup; use the T Ar command to do physical backup; Oracle database uses space expansion after a period of time and increases temporary or rollback table space for specific work, Cancel the new temporary or rollback table space; add Oracle users to authorize the user. These maintenance operations are described in detail below in order. First, open and close the database 1, open the database 1, # su - oracle 2,% dbstart Wait a dozen seconds, when you see Oracle Instances Started, Database Opened, the Oracle Database Opens the Second Step of Successful Step It consists of the following commands which SVRMGR% svrmgrl wakeup state SVRMGR> connect internal core connection SVRMGR> startup open database SVRMGR> exit% NOTE: startup can open the database with three parameters, namely SVRMGR> startup nomount start only instances SVRMGR> startup mount start instances , Connect (MOUNT) Database SVRMGR> Startup Normal Launches Instances, Connect (MOUNT) Database Open (Open) Database Startup Default Parameters is Normal 3,% LSNRCTL Start Launom Oracle Listener If the error Check environment variables, and LSNRCTL The content and execution properties of the file. 2, turn off the database 1, # su - oracle 2,% lsnrctl stop close Oracle Listener 3,% dbshut Waiting for a few seconds, when seeing Database Closed Database Dismounted Oracle Instances Shut Down, Oracle Database Turn off successful third step Composed of% SVRMGRL SVRMGR Status SVRMGR> Connect Internal Connection Database SVRMGR> SHUTDOWN NEW: TurpIn 注.................................. It is equal to sudden power outages SVRMGR> shutdown immediate to make a back operation, immediately shut down. SVRMGR> Shutdown Normal Normal shutdown shutdown default parameters is Normal II. Make logic backups with Exp, Imp commands, Output EXPORT basic command: Generally use interactive mode, type% Exp user / password í Exp mode 1 in Oracle User Prompt , Table: Export specified in a user mode; not all Table, and does not include Cluster definitions; 2, User: Export A user mode All objects (such as tables, data, indexing, etc.); Export sample user Mode: 3, Full Database: All objects in Export Database, perform this must be given to the exp-full-database role.

Export example a, dababase mode% Exp System / Manager ... ... Enter ARRAY FETCH BUFFER SIZE: 4096> (RETURN) Export file: expdat.dmp> DBA.DMP E (NTIRE DATABASE), U (SERS ): u> e export grants (y / n): y> y export table data (y / n): y> y> y b, table mode% exp System / Manager ... ... Enter Array Fetch Buffer Size: 4096> (Return) Export File: Expdat.dmp> DBA.DMP E (NTIRE DATABASE), U (SERS), T (Aables): U > t export grants (y / n): Y> y> y> y> y> y About to exp specified table ... Table to be exported (Return Quit> EMP (Name of input to output) .... Exporting Table EMP 14 ROWS Exported about to expot specified tables ... Table to be exported> So loop, press Enter to exit 2, enter Import premise: After Database is built, you must run oracle-home / rdbms /admin/catexp.sql to use Export, Import. Permissions: To use import, you must have Create session permissions. If you want to Import other users, you must have an IMP_FULL_DATABADE role. (After running catexp.sql, DBA has an IMP _FULL_DATABASE role). Character: related to Export, as long as the character settings of the two machines are no problem. Basic command: Generally use interactive mode, type% IMP User / Password IMP mode 1, Table: Allow user import in user mode, not all Table; 2, User: Allow User Import It belongs to all objects of the user itself; 3, Full Database: Allows the user IMPORT all Database objects must be given the Imp-Full-Database role. Import example IMP system / manager ... import file: expdat.dmp> Enter Insert buffer size (minimum is 4096) 30720> Export file create by Export: V 07.01.03 Note: 1, IMPORT's permissions must be greater than, equal to Export Permissions; 2, for long colums due to special requirements for memory (memory access to memory) export and import are sometimes unsuccessful; 3, for backup to tape, Export and Import recommends using the same tape drive.

Third, use the tar command to do physical backup 1, # su - oracle 2,% TAR CVF / DEV / RMT / 0. Back to all files under the Oracle path to the tape drive 3,% TAR XVF / DEV / RMT / 0 put back up tape All files are restored to Oracle Current Path 4,% TAR TVF / DEV / RMT / 0 View What files on the tape four, the database expansion 1, add a table space when we want to develop a large application, it is best Create a corresponding table space. Command example: SVRMGR> CREATE TABLESPACE APRMGR> CREATE TABLESPACE /DBS/Application.dbf 'Size 3M Add Rollback and Temporal Space Commands for Specific Cases: SVRMGR> Create Rollback TableSpace RBS8 DataFile' / USR / ORACLE / DBS /rbs8.dbf 'size 4m svrmgr> create tablespace tmp8 datafile' /usr/racle/dbs/tmp8.dbf 'size 550k rollback and temporary table space After running, you can delete or make it offline svrmgr> Drop TableSpace RBS8; SVRMGR > drop tablespaces tmp8; SVRMGR> alter tablespace rbs offline; SVRMGR> alter tablespace tmp8 offline; rollback establishing example: SVRMGR> create rollback segment rs11 tablespace tmp8; SVRMGR> alter rollback segment rs11 online; SVRMGR> alter rollback segment rs11 offline; 2. Increasing the size of a table space When a table space is not satisfied, the tablespace should be expanded. Example: SVRMGR> ALTER TABLESPACLE/dbs/sys338.dbf 'size 3m; 5, add Oracle's users and give users 1, add Oracle users, and give users: SVRMGR> create user newuser identified by userpasswd default tablespace application temporary tablespace tmp8; SVRMGR> grant connect to newuser; SVRMGR> grant resource to newuser; SVRMGR> grant update on emp to newuser; 2, increase the role of the oracle oracle default roles have connect, Resource, DBA. It is a set of permissions that can be assigned to other Role or users. Connect has 8 permissions. Resource has 5 permissions, and DBA has 77 permissions. Give us a general connection to the user's Connect, give the general programmers to add Resource, only the database administrator has DBA permissions.

转载请注明原文地址:https://www.9cbs.com/read-46810.html

New Post(0)